Skip to content

0xCorolaire/ethtwlottery-SmartContract

Repository files navigation

SmartContract Lottery

Smart Contract for creating a Lottery that maps an address with a username

@TODO -> Add funds and enable liquidity

Prerequisites

Installation :

pip install eth-brownie
  • Install ChainLink Dependencies
git clone https://github.com/PatrickAlphaC/chainlink-mix
cd chainlink-mix 
brownie bake chainlink-mix
cd chainlink-mix
pip install -r requirements.txt

Environment variables

Set WEB3_INFURA_PROJECT_ID, and PRIVATE_KEY => Infura.

export WEB3_INFURA_PROJECT_ID=<PROJECT_ID>
export PRIVATE_KEY=<PRIVATE_KEY>

AND THEN RUN source .env

Local Development

npm install -g ganache-cli

and then :

brownie networks add Ethereum ganache host=http://localhost:8545 chainid=1337

Deploy to a testnet

brownie run scripts/1_deploy_lottery.py
brownie run scripts/2_start_lottery.py
brownie run scripts/3_enter_lottery.py
brownie run scripts/4_end_lottery.py

Testing

brownie test
brownie test --network <network>

Local development

brownie test

Mainnet fork

brownie test --network mainnet-fork

About

Solidity Custom Smart Contract

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published