Skip to content

Instantly share code, notes, and snippets.

@trapp
Last active March 23, 2017 05:39
Show Gist options
  • Save trapp/b67001a5a88bcc1f110edf25f0ebc98c to your computer and use it in GitHub Desktop.
Save trapp/b67001a5a88bcc1f110edf25f0ebc98c to your computer and use it in GitHub Desktop.
Ethereum Fork Oracle - Am I on the Fork?
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;
// 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 <= 1921200) {
forked = darkDAO.balance < 3600000 ether;
}
}
// don't accept value transfers
function() {
throw;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment