Skip to content

Instantly share code, notes, and snippets.

@resilience-me
Last active January 14, 2019 08:17

Revisions

  1. resilience-me revised this gist Jan 14, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Labyrinth.sol
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    // this labyrinth contract as a public utility can be used for deterministic random numbers,
    // 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. )

  2. resilience-me revised this gist Jan 13, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Labyrinth.sol
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ contract Labyrinth {
    uint entropy;

    function getRandomNumber() public returns (uint) {
    entropy ^= uint(blockhash(block.number % entropy));
    entropy ^= uint(blockhash(entropy % block.number));
    return entropy;
    }

  3. resilience-me revised this gist Jan 13, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Labyrinth.sol
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ contract Labyrinth {
    uint entropy;

    function getRandomNumber() public returns (uint) {
    entropy ^= blockhash(block.number % entropy);
    entropy ^= uint(blockhash(block.number % entropy));
    return entropy;
    }

  4. resilience-me revised this gist Jan 13, 2019. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions Labyrinth.sol
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    // this labyrinth contract as a public utility can be used for deterministic random numbers,
    // using the state itself as a source of entropy (generated entirely from human social coordination
    // that is highly random. )

    contract Labyrinth {

    uint entropy;
  5. resilience-me revised this gist Jan 13, 2019. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion Labyrinth.sol
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    contract Labyrinth {

    uint entropy;
  6. resilience-me created this gist Jan 13, 2019.
    11 changes: 11 additions & 0 deletions Labyrinth.sol
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@

    contract Labyrinth {

    uint entropy;

    function getRandomNumber() public returns (uint) {
    entropy ^= blockhash(block.number % entropy);
    return entropy;
    }

    }