We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4537259 commit b4711baCopy full SHA for b4711ba
contracts/standard/rng/BlockhashRNGFallbackRange.sol
@@ -30,7 +30,8 @@ contract BlockHashRNGFallback is BlockHashRNG {
30
*/
31
function saveRN(uint _block) public {
32
if (_block < block.number && randomNumber[_block] == 0) { // If the random number is not already set and can be.
33
- // The below equation is valid for all cases (last 256 blockhash of blocks or even earlier than that).
+ // Returns the blockhash of _block if accessible (one of the last 256 blocks).
34
+ // If the blockhash hasn't been saved in time, return a blockhash of a block in range as a fallback.
35
randomNumber[_block] = uint(blockhash((block.number-1) - (block.number-1-_block)%256));
36
}
37
0 commit comments