Skip to content

Instantly share code, notes, and snippets.

@austintgriffith
Created March 9, 2018 00:17
Show Gist options
  • Select an option

  • Save austintgriffith/de01418675238d5292fcc7fe0de5586c to your computer and use it in GitHub Desktop.

Select an option

Save austintgriffith/de01418675238d5292fcc7fe0de5586c to your computer and use it in GitHub Desktop.
function genRandom() private view returns (uint) {
uint rand = uint(keccak256(block.blockhash(block.number-1)));
return uint(rand % (10 ** 20));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment