Skip to content

Commit

Permalink
adds block.difficulty to the hash
Browse files Browse the repository at this point in the history
  • Loading branch information
flockonus committed Nov 14, 2017
1 parent bbf746e commit bc857ea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contracts/Random.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ contract Random {
}

function maxRandom() public returns (uint256 randomNumber) {
_seed = uint256(keccak256(_seed, block.blockhash(block.number - 1), block.coinbase));
_seed = uint256(keccak256(
_seed,
block.blockhash(block.number - 1),
block.coinbase,
block.difficulty
));
return _seed;
}

Expand Down

0 comments on commit bc857ea

Please sign in to comment.