Skip to content

Instantly share code, notes, and snippets.

@trapp
Last active March 23, 2017 05:39
Show Gist options
  • Select an option

  • Save trapp/b67001a5a88bcc1f110edf25f0ebc98c to your computer and use it in GitHub Desktop.

Select an option

Save trapp/b67001a5a88bcc1f110edf25f0ebc98c to your computer and use it in GitHub Desktop.

Revisions

  1. trapp revised this gist Jul 20, 2016. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion amionthefork.sol
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,6 @@ contract AmIOnTheFork {
    // Dark DAO address
    address constant darkDAO = 0x304a554a310c7e546dfe434669c62820b7d83490;

    // Check the fork condition during creation of the contract.
    // This function should be called between block 1920000 and 1921200.
    // Approximately between 2016-07-20 12:00:00 UTC and 2016-07-20 17:00:00 UTC.
    // After that the status will be locked in.
  2. trapp revised this gist Jul 17, 2016. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions amionthefork.sol
    Original file line number Diff line number Diff line change
    @@ -6,10 +6,11 @@ contract AmIOnTheFork {
    address constant darkDAO = 0x304a554a310c7e546dfe434669c62820b7d83490;

    // Check the fork condition during creation of the contract.
    // This function should be called between block 1920000 and 1930000.
    // This function should be called between block 1920000 and 1921200.
    // Approximately between 2016-07-20 12:00:00 UTC and 2016-07-20 17:00:00 UTC.
    // After that the status will be locked in.
    function update() {
    if (block.number >= 1920000 && block.number <= 1930000) {
    if (block.number >= 1920000 && block.number <= 1921200) {
    forked = darkDAO.balance < 3600000 ether;
    }
    }
  3. trapp revised this gist Jul 17, 2016. 1 changed file with 5 additions and 6 deletions.
    11 changes: 5 additions & 6 deletions amionthefork.sol
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,16 @@
    contract AmIOnTheFork {
    //Tracks whether hard fork is effective on this chain. True means the fork is passed, false it hasn't.
    // Tracks whether hard fork is effective on this chain. True means the fork is passed, false it hasn't.
    bool public forked = false;

    // Dark DAO address
    address constant darkDAO = 0x304a554a310c7e546dfe434669c62820b7d83490;

    // Check the fork condition during creation of the contract.
    // This should happen as close as possible to the fork block 1920000
    function AmIOnTheFork () {
    // This function should be called between block 1920000 and 1930000.
    // After that the status will be locked in.
    function update() {
    if (block.number >= 1920000 && block.number <= 1930000) {
    forked = darkDAO.balance < 3600000 ether;
    } else {
    // don't create the contract when the base conditions are not met.
    throw;
    }
    }

  4. trapp created this gist Jul 17, 2016.
    22 changes: 22 additions & 0 deletions amionthefork.sol
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    contract AmIOnTheFork {
    //Tracks whether hard fork is effective on this chain. True means the fork is passed, false it hasn't.
    bool public forked = false;
    // Dark DAO address
    address constant darkDAO = 0x304a554a310c7e546dfe434669c62820b7d83490;

    // Check the fork condition during creation of the contract.
    // This should happen as close as possible to the fork block 1920000
    function AmIOnTheFork () {
    if (block.number >= 1920000 && block.number <= 1930000) {
    forked = darkDAO.balance < 3600000 ether;
    } else {
    // don't create the contract when the base conditions are not met.
    throw;
    }
    }

    // don't accept value transfers
    function() {
    throw;
    }
    }