https://github.com/zeroekkusu/smartcontract-lottery
Overly documented, example Brownie project
https://github.com/zeroekkusu/smartcontract-lottery
brownie chainlink etherscan-api python solidity
Last synced: 4 months ago
JSON representation
Overly documented, example Brownie project
- Host: GitHub
- URL: https://github.com/zeroekkusu/smartcontract-lottery
- Owner: ZeroEkkusu
- License: mit
- Created: 2021-12-11T12:03:48.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-26T11:10:19.000Z (about 4 years ago)
- Last Synced: 2025-01-03T09:46:43.416Z (about 1 year ago)
- Topics: brownie, chainlink, etherscan-api, python, solidity
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About
This is an example of a full scale smart contract project, made using [Solidity](https://github.com/ethereum/solidity) and [Brownie](https://github.com/eth-brownie/brownie). You can use this repo as a refresher on how to use Brownie and write smart contracts.
How the contract works:
1. Anyone can enter the lottery with 50 USD or more worth of ETH
2. The owner will choose when the lottery is over
3. The lottery will select one random winner and transfer the funds
### Todo
- [ ] Further decentralize using Chainlink Keepers
# Setup
*Note: This isn't a guide on how to set up system for development! For that, see [PatrickAlphaC/smartcontract-lottery](https://github.com/PatrickAlphaC/smartcontract-lottery/blob/main/README.md), on which this project is based.*
To set up your new project, either:
Use [chainlink-mix](https://github.com/brownie-mix/chainlink-mix)
```bash
brownie bake chainlink-mix && mv chainlink
```
Or start from scratch
```bash
brownie init
```
## Other files
Create a `.env` file inside your project's directory and add the following
```
export PRIVATE_KEY_1 =
export PRIVATE_KEY_2 =
export WEB3_INFURA_PROJECT_ID =
export ETHERSCAN_TOKEN =
```
To encrypt your private key, add it to Brownie instead
```bash
brownie accounts new
```
# Usage
### Compile
```bash
brownie compile
```
### Test
```bash
brownie test --network -s
```
### Deploy
```bash
brownie run scripts/deploy_lottery.py --network
```