not-anshuman / coinflip

Submission for coinflip dyeus challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

coinflip

Submission for coinflip dyeus challenge using solidity and harmony vrf. Consider 1 and 0 as Heads or Tails while giving input.

Deployment address: 0xf19bbd288716e70B4774117448A0120d05947FcB

For transactions, refer to the images below.

COMPILING: Screenshot (433)

After successful compilation of contract, go to deploy and run transaction => select environment as injected Web3, make sure to add Harmony Testnet in metamask and use it for deployment of contract.

DEPLOYING ON HARMONY TESTNET: Screenshot (434)

Make sure to confirm the transaction popup on metamask.

DEPLOYMENT: Screenshot (435)

Screenshot (436)

After deployment go to deployed contracts, here we can function that are available to us for playing the game. Enter 1 for heads or 0 for tails in placeBet function along with bet amount, and confirm the transaction.

HOW TO PLAY: Screenshot (437)

image

After placing the bet, call the function reward bet. It will show the result of the bet. In this case we case see the "event": "Win", which means that we won also we can verify this by checking the balancing of the wallet.

RESULT: Screenshot (439)

Wallet balance in this case should be 130, as default balance is 100 and we won the bet of amount 30.

BALANCE: Screenshot (440)

About

Submission for coinflip dyeus challenge


Languages

Language:Solidity 100.0%