The lottery game dapp where players choose a lucky number and bet money after wait for owner publish the result (you win or lose).
- Bet with number and money
- History bet
- Show the number of players are betting
- Random number from Chainlink VRF V2
- Hardhat framework (Write, test and deploy smart contract)
- Solidity 0.8.0
- Chai (Test smart contract)
- Reactjs (Use function component)
- MUI (UI)
- Etherjs
- Chainlink (Verifiable Random)
- Infura, Goerli (Deploy smart contract)
- cd smart-contract
- npm install
- Deploy smart contract (local)
- npx hardhat node (keep terminal run, import accounts to metamask)
- npx hardhat run scripts/deploy.js --network localhost (open another terminal)
- Deploy smart contract (Goerli testnet)
- Create .env file and add:
INFURA_API_KEY_URL: "rinkeby-network-endpoint-from-infura"
RINKEBY_PRIVATE_KEY: "account-private-key" - npx hardhat run scripts/deploy.js --network goerli
- cd web-app
- npm install
- npm start