Lottery dApp: https://lottery.dapp.hkwtf.com/
A Youtube video demo can be seen here.
It is a lottery app where users can come and create lottery pot to play with their friends. They will specify the pot closed time, minimum stake to participate, the pot type (equal opportunity or weighted opportunity), and the stake they will take.
Then the lottery pot is open and allow anyone to participate. Once the closed time is reached, further interaction will mark the contract as closed, and winner can be determined randomly.
Finally the winner can withdraw money from the lottery pot.
The consensys project repo are at:
- main repo, with two git submodules of,
- the smart contracts using truffle framework,
- and the React frontend. It is created with the create-react-app boilerplate.
To setup the local server,
-
Install Ganache and run it locally on port
7545
. -
git clone the smart contracts repo and run
# to compile the project yarn compile # to migrate the smart contract to blockchain truffle migrate # to run all the truffle test yarn test
This will build the contract artifacts under
build/contracts
folder. -
Then, git clone the frontend repo, and symbolic link the contract artifact folder at
src/contracts
.Now you can
# to run the dev version yarn start:dev # to build the production version yarn build