Project Coinflip utilizes Ethereum smart contracts and a front-end built in React which culminates into a betting dApp. Part of the complexity herein lies in the random number problem in blockchain. This dApp fetches a random number by sending a call to the Provable (formerly Oraclize) oracle and waiting for a callback which holds the "random number"--randomized by Provable--that can also be confirmed by the network.
git clone
this repo to your local environment.cd project-coinflip-v-6
into your project directory.npm
the required dependencies.- Confgure the
truffle-config.js
file to Ganache or another Ethereum node. - Initialize node.
- In the command line, run
truffle migrate
. - Run
npm run start
to get the front end running. - Fetch the coinflip contract address from the build abi and replace the existing address inside of
../src/components/Main
- Make bets and flip some coins!