Alex Van de Sande's post-DAO-fork ETH/ETC replay-protection splitter. Routes ether or ERC20 tokens to different recipients depending on which chain it runs on.
Key Facts
Description
Deployed on 2016-07-27, the week after the DAO hard fork that split Ethereum into ETH and ETC. The constructor records a known main-chain blockhash into a public chainSignature, and the etherSplit and tokenSplit functions route value to one recipient on the main chain and a different recipient on the other fork, so a single signed transaction cannot replay value across both chains. I cracked it to a byte-for-byte runtime match with soljson v0.3.5 (optimizer ON); two of the deployer's sibling ReplayProtection contracts are verified on Etherscan.
Source Verified
Byte-for-byte runtime match. soljson v0.3.5+commit.5f97274a, optimizer ON. Runtime SHA-256 a6e5ae070945319e9e945dd8bb0cfe9ededeef0ee1453dbfc25600244fec04be. Reproduce with verify.js in the proof folder.
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
DAO Fork Era
The controversial fork to recover funds from The DAO hack.
Bytecode Overview
Verified Source Available
Source verified through compiler archaeology and exact bytecode matching.
View Verification ProofShow source code (Solidity)
contract Token {
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
}
// replay protection
contract ReplayProtection {
bytes32 public chainSignature;
function ReplayProtection() {
bytes32 blockHash = 0xcf9055c648b3689a2b74e980fc6fa27817622fa9ac0749d60a6489a7fbcfe831;
for (uint i = 1; i < 64; i++) {
if (blockHash == block.blockhash(block.number - i)) chainSignature = blockHash;
}
}
function etherSplit(address recipient, address altChainRecipient, bytes32 _chainSignature) returns(bool) {
if (chainSignature == _chainSignature && recipient.send(msg.value)) {
return true;
} else if (chainSignature != _chainSignature && altChainRecipient.send(msg.value)) {
return true;
}
throw;
}
function tokenSplit(address recipient, address altChainRecipient, address tokenAddress, uint amount, bytes32 _chainSignature) returns (bool) {
if (msg.value > 0 ) throw;
Token token = Token(tokenAddress);
if (chainSignature == _chainSignature && token.transferFrom(msg.sender, recipient, amount)) {
return true;
} else if (chainSignature != _chainSignature && token.transferFrom(msg.sender, altChainRecipient, amount)) {
return true;
}
throw;
}
function () {
throw;
}
}External Links
Related contracts
Association (Mist D.A.O.)
Same deployerA token-weighted governance contract deployed by Avsa on Dec 3, 2015, using MistCoin as voting shares. 0.1 ETH remains locked after 10 years.
0x8d554c...d9b8dcDecember 3, 2015Congress
Same deployerAlex Van de Sande's Congress DAO from Dec 28, 2015: on-chain voting with member registry (mapping) and configurable quorum.
0xb3d47f...7c6c0cDecember 28, 2015Congress
Same deployerAlex Van de Sande's Congress DAO from Dec 28, 2015: on-chain voting system for proposals with configurable quorum and majority threshold.
0x7f6b46...03f101December 28, 2015Congress
Same deployerAlex Van de Sande's Congress DAO from Dec 28, 2015: on-chain voting system for proposals with configurable quorum and majority threshold.
0x1e5cbb...b7ff63December 28, 2015Doge-ETH Bounty DAO
Same deployerThe Doge-Ethereum Bounty DAO created by avsa on Dec 28, 2015. Funded over 5,400 ETH in bridge development, holds 50,000 MistCoin. Active 2015-2021.
0xdbf03b...c8c6fbDecember 28, 2015Unicorns
Same deployerUnicorns (๐ฆ) token by avsa โ 1830B variant A. Source recovered by bytecode analysis, verified on Etherscan and Sourcify.
0x1a3970...dd1076February 11, 2016