An optimized two-party escrow whose access guard uses a buggy || instead of &&, so both functions always throw and the contract is bricked.
Key Facts
Description
Deployed May 17, 2017 by Vitalik Buterin (0x1db3439a22ee7c4d034e9b26437d3960b5af0517). An optimized build of a two-party escrow (buyer, seller, arbitrator): finalize() is meant to pay the seller and refund() the buyer. The access guard is written with a buggy || instead of &&: if (msg.sender != buyer || msg.sender != arbitrator) throw;. Because no caller can equal both buyer and arbitrator at once, that condition is always true, so both functions always throw and the contract is effectively bricked: any funds sent can never be released. This exact operator choice reproduces the target's short-circuit codegen; the && form compiles 2 bytes longer. Compiled with solc 0.4.11, optimizer on. The executable runtime reproduces byte-for-byte; only the trailing swarm metadata hash differs. runtime sha256 b1e345aaecdee9afa5ddc48f57dbc700faafcbbf16250c0a35791825bfd65442.
Source Verified
Executable runtime reproduces byte-for-byte from the reconstructed source with solc 0.4.11, optimizer on; only the swarm metadata hash differs. The buggy || guard (always true) is required to match. runtime sha256 b1e345aaecdee9afa5ddc48f57dbc700faafcbbf16250c0a35791825bfd65442.
Spurious Dragon Era
Continued DoS protection. State trie clearing.
Bytecode Overview
Verified Source Available
This contract has verified source code.
View Verification ProofShow source code (Solidity)
// Verified by EthereumHistory (ethereumhistory.com)
contract Escrow {
address buyer;
address seller;
address arbitrator;
function Escrow(address _seller, address _arbitrator) {
seller = _seller;
arbitrator = _arbitrator;
buyer = msg.sender;
}
function finalize() {
if (msg.sender != buyer || msg.sender != arbitrator) throw;
seller.send(this.balance);
}
function refund() {
if (msg.sender != seller || msg.sender != arbitrator) throw;
buyer.send(this.balance);
}
}External Links
Related contracts
SerpentGamble
Same deployerProvably-fair betting game where players choose their own odds. The owner settles bets with a commit-reveal random seed. Includes a 2-day emergency refund.
0x034df8...200e2fSeptember 20, 2015SerpentGamble
Same deployerSibling of 0x034dF870 (SerpentGamble). Provably-fair Serpent betting game; players choose their own odds, owner settles via commit-reveal seed, 2-day refund.
0x9ca7e9...fa8bb4September 21, 2015SerpentGamble
Same deployerSibling of 0x034dF870 (SerpentGamble). Provably-fair Serpent betting game; players choose their own odds, owner settles via commit-reveal seed, 2-day refund.
0x75649a...176028September 21, 2015SerpentGamble
Same deployerIntermediate build of serpent_gamble, a provably-fair betting dapp (Bet/Win/Loss/NewSeed), related to verified sibling 0x59375871. Source not yet reconstructed.
0xe1a99f...0d2457September 21, 2015SerpentGamble
Same deployerIntermediate build of serpent_gamble, a provably-fair betting dapp (Bet/Win/Loss/NewSeed), related to verified sibling 0x59375871. Source not yet reconstructed.
0xdc00a9...15861fSeptember 21, 2015SerpentGamble
Same deployerIntermediate build of serpent_gamble, a provably-fair betting dapp (Bet/Win/Loss/NewSeed), related to verified sibling 0x59375871. Source not yet reconstructed.
0xd0ed09...300b48September 21, 2015