Skip to content

Commit 12eec73

Browse files
fix(RN): remove storing
1 parent e20dcd9 commit 12eec73

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

contracts/standard/rng/BeaconRNG.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ contract BeaconRNG {
1919
uint public constant ERROR = 32; // Number of blocks after which the lookahead gets reset, so eligible blocks after lookahead don't go long distance, to avoid a possiblity for manipulation.
2020

2121
RNG public blockhashRNG; // Address of blockhashRNG to fall back on.
22-
mapping (uint => uint) public randomNumber; // randomNumber[_block] is the random number for this requested block, 0 otherwise.
2322

2423
/** @dev Constructor.
2524
* @param _blockhashRNG The blockhash RNG deployed contract address.
@@ -52,10 +51,7 @@ contract BeaconRNG {
5251
if (block.number > _block && (block.number - _block) % (LOOKAHEAD + ERROR) > LOOKAHEAD) {
5352
// Eligible block number should exceed LOOKAHEAD but shouldn't be higher than LOOKAHEAD + ERROR.
5453
// In case of the latter LOOKAHEAD gets reset.
55-
if (randomNumber[_block] == 0) {
56-
randomNumber[_block] = block.difficulty;
57-
}
58-
return uint(keccak256(abi.encodePacked(msg.sender, randomNumber[_block])));
54+
return uint(keccak256(abi.encodePacked(msg.sender, block.difficulty)));
5955
} else {
6056
return 0;
6157
}

0 commit comments

Comments
 (0)