Features:
- Users can enter lottery with ETH based on a USD fee
- An admin will choose when the lottery is over
- The lottery will select a random winner
- Prerequisites
- Installation
- Testnet Development
- Local Development
- Deploy to a testnet / Scripts
- Testing on local blockchain
- Adding additional Chains
- Resources
- License
python3 -m pip install --user pipx
python3 -m pipx ensurepath
# restart your terminal
pipx install eth-brownie
Or
pip install eth-brownie
Set your WEB3_INFURA_PROJECT_ID
by creating a project of Infura, and PRIVATE_KEY
environment variables from your ethereum wallet like metamask.
You'll also need testnet rinkeby ETH and LINK. You can get LINK and ETH into your wallet by using the rinkeby faucets located here.
Then add your environment variables to the .env
file:
export WEB3_INFURA_PROJECT_ID=<PROJECT_ID>
export PRIVATE_KEY=<PRIVATE_KEY>
AND THEN RUN source .env
TO ACTIVATE THE ENV VARIABLES
For local testing install ganache-cli
npm install -g ganache-cli
All the scripts are designed to work locally or on a testnet. You can add a ganache-cli or ganache UI chain like so:
brownie networks add Ethereum ganache host=http://localhost:8545 chainid=1337
brownie run scripts/deploy.py
This will deploy mocks on development enviroment (ganache-local) Or deploy on Kovan/Rinkeby testnet:
brownie run scripts/deploy.py --network rinkeby
brownie test
Or, test on Kovan/Rinkeby testnet:
brownie test --network kovan
brownie test --network rinkeby
brownie networks add Ethereum binance-smart-chain host=https://bsc-dataseed1.binance.org chainid=56
or, for a fork:
brownie networks add development binance-fork cmd=ganache-cli host=http://127.0.0.1 fork=https://bsc-dataseed1.binance.org accounts=10 mnemonic=brownie port=8545
- Chainlink Documentation
- Brownie documentation.
- freeCodeCamp Solidity, Blockchain, and Smart Contract Course.
This project is licensed under the MIT license.