Skip to content

Commit

Permalink
update CoinToss comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed Sep 27, 2024
1 parent 92c7f15 commit 28bc2fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion solidity/src/CoinToss.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ contract CoinToss is CadenceRandomConsumer {
delete coinTosses[msg.sender];

// fulfill the random request within the inclusive range [0, 1]
uint8 coinFace = uint8(_fulfillRandomInRange(requestId, uint64(0), uint64(1)));
// NOTE: Could use % 2 without risk of modulo bias since the range is a multiple of the modulus
// but using _fulfillRandomInRange for demonstration purposes
uint8 coinFace = uint8(_fulfillRandomInRange(requestId, 0, 1));

// get the value sent in the flipCoin function & remove the request from the openRequests mapping
uint256 amount = openRequests[requestId];
Expand Down

0 comments on commit 28bc2fc

Please sign in to comment.