Contract Address (Rinkeby Testnet): 0x5bc522d7ef9b8534ba5856be0cc9e03ab1898f84 (Rinkeby Block Explorer)
- Open the contract file (Cricket.sol) in Remix IDE.
- Compile and Deploy the code in Remix IDE (env = Remix VM).
- Go to deployed contracts section, enter a number from 1 to 6 and then click on
runIncrement
button to generate a random number. - Click on
isOut
button to check whether the batsman is out or notout, i.e., if isOut is true or false, respectively. - Click on
score
button to check the score of the batsman (random number accumulating). - Once the
isOut
variable becomes true, therunIncrement
button won't work until you reset the game usingreset
button.
- Initially, the
isOut
is set to false andscore
is set to 0.
- Once you click
runIncrement
and then checkscore
, it has changed, however,isOut
remains false. - You can repeat this process until batsman gets out.
- As the
isOut
becomes true, therunIncrement
button would stop affecting thescore
until you clickreset
button to reset the game.
- The deployed smart contract and transaction details can be viewed here.
- Open the scenario.json file in Remix IDE and then open Deploy & Run Transactions section while keeping the scenario.json file tab open. In the Transactions Recorded section, press Run.