https://king-of-gambling.firebaseapp.com
This demo includes 2 parts:
- the browser UI (the frontend)
- the Contract (the backend)
This application is deployed on ethereum's testnet (Ropsten network). This is a betting application for the price of ETH will go up or down or unchanged within the next 3 hours (because when using the Chainlink reference data contract
every after 10800 seconds, aggregator smart contract calls oracles to get the new trusted answer). The person who correct prediction will be awarded 1.9 times the bet amount .
If in the future time to get price of the chainlink reference contract is faster, then the bet time will be less than 3 hours.
This particular dapp UI is written in Reactjs + Redux
- Update Price : Because it is not possible to show realtime when the price changes, the top button will take the price of ethereum on the chainlink reference contract.
- Going up / Unchanged / Going down : For users to predict the price of ethereum
- 0.01 ETH /0.1 ETH/ 1 ETH : Amount of money the user wants to bet
- Send : Send predict results
- Node : > v12.16
- Have eth in ropsten network
First set up the network and account by editing the .env.example file to .env file and enter MNEMONIC and RPC_URL (eg url provided by infura)
MNEMONIC =
RPC_URL=
Then using command
cd contract
yarn install
yarn migrate:live
cd frontend
yarn install
yarn start
ln -s $PWD/contract/build/contracts $PWD/frontend/src