GithubHelp home page GithubHelp logo

22388o / decentralized-raffle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from patrickalphac/decentralized-raffle

1.0 0.0 0.0 424 KB

Shell 1.29% JavaScript 2.53% Solidity 26.83% TypeScript 69.35%

decentralized-raffle's Introduction

Decentralized Raffle

Quickstart

Requirements

Installation

git clone 
cd decentralized-raffle
yarn

Deploy contracts

npx hardhat deploy

Deploy and start a local node

npx hardhat node

Deploy to Kovan

To deploy to a testnet or a live network, you need the following environment variables:

  1. KOVAN_RPC_URL=https://eth-ropsten.alchemyapi.io/v2/
  2. PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1

Your KOVAN_RPC_URL is the URL of your blockchain node, for example, from alchemy.

Your PRIVATE_KEY is the private key of your metamask or cryptowallet. Make sure it starts with 0x. You might have to add 0x if you're pulling the key from something like metamask.

You can set them in a file named .env. You can follow the example of .env.example of what the contents of that file will look like.

You'll also need testnet ETH and testnet LINK. You can find both here.

Once you do so, you can run:

npx hardhat deploy --network kovan

Fund your contract with LINK.

npx hardhat fund-link --contract insert-contract-address-here --network kovan

And enter your raffle

npx hardhat run scripts/enter.ts --network kovan

Add keepers

Once you deploy to Kovan, you can register your contract with the kovan keepers registry. Please follow the documentation for more information.

npx hardhat deploy --network kovan

And you can verify once you have an ETHERSCAN_API_KEY

npx hardhat verify --network mainnet DEPLOYED_CONTRACT_ADDRESS args...

Tests

npx hardhat test

decentralized-raffle's People

Contributors

patrickalphac avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.