Skip to content

Commit 546eb16

Browse files
fix(RNG): precise comparison
1 parent 36ef15c commit 546eb16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contracts/standard/rng/BeaconRNG.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ contract BeaconRNG {
4848
}
4949
// Post-Merge.
5050
} else {
51-
if (block.number > _block && (block.number - _block) % (LOOKAHEAD + ERROR) > LOOKAHEAD) {
51+
if (block.number > _block && (block.number - _block) % (LOOKAHEAD + ERROR) >= LOOKAHEAD) {
5252
// Eligible block number should exceed LOOKAHEAD but shouldn't be higher than LOOKAHEAD + ERROR.
5353
// In case of the latter LOOKAHEAD gets reset.
5454
return uint(keccak256(abi.encodePacked(msg.sender, block.difficulty)));

0 commit comments

Comments
 (0)