Skip to content

Instantly share code, notes, and snippets.

@resilience-me
Last active January 14, 2019 08:17
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 resilience-me/8e877bc39a9f8d86f17f08bc62d71d70 to your computer and use it in GitHub Desktop.
Save resilience-me/8e877bc39a9f8d86f17f08bc62d71d70 to your computer and use it in GitHub Desktop.
// this labyrinth contract as a public utility can be used as an "entropy crawler",
// using the state itself as a source of entropy (generated entirely from human social coordination
// that is highly random. )
contract Labyrinth {
uint entropy;
function getRandomNumber() public returns (uint) {
entropy ^= uint(blockhash(entropy % block.number));
return entropy;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment