Last active
July 20, 2016 19:31
-
-
Save trapp/75f15803910b0e2775a7b39864f0bf77 to your computer and use it in GitHub Desktop.
Splits ETH into 2 addresses, depending on which chain it runs on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract ReplaySafeSplit { | |
// Fork oracle to use | |
AmIOnTheFork amIOnTheFork = AmIOnTheFork(0x2bd2326c993dfaef84f696526064ff22eba5b362); | |
// Splits the funds into 2 addresses | |
function split(address targetFork, address targetNoFork) returns(bool) { | |
if (amIOnTheFork.forked() && targetFork.send(msg.value)) { | |
return true; | |
} else if (!amIOnTheFork.forked() && targetNoFork.send(msg.value)) { | |
return true; | |
} | |
throw; | |
} | |
// Reject value transfers. | |
function() { | |
throw; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment