Skip to content

Instantly share code, notes, and snippets.

@DoguD
Last active September 27, 2022 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DoguD/6b4032fc2fea8eb2f3d2fa2f5385270c to your computer and use it in GitHub Desktop.
Save DoguD/6b4032fc2fea8eb2f3d2fa2f5385270c to your computer and use it in GitHub Desktop.
pragma solidity ^0.8.0;
contract RandomNumbers{
uint256 public preparationBlockNumber;
bool public canCallRandom;
function prepareRandom() public {
/**
When called sets the preparation block number to the current block number.
*/
require(!canCallRandom, "Already prepared.");
// TODO: Commit the caller to random
preparationBlockNumber = block.number;
canCallRandom = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment