A minimal crowdfunding contract: fund() records contributions, refund() returns them if the goal is missed by the deadline, collect() pays out if it's met.
Key Facts
Description
Deployed October 30, 2016 by Vitalik Buterin (0x1db3439a22ee7c4d034e9b26437d3960b5af0517). A minimal crowdfunding contract, one of five byte-identical copies deployed the same day. fund() records the caller and the ETH they send as a Funder in an array. After the deadline, refund() iterates the funders and returns each contribution if the contract balance is below the goal; collect() sends the entire balance to the beneficiary if the balance is at least the goal. deadline is exposed as a public getter. The 846-byte runtime reproduces byte-for-byte from the reconstructed source using solc 0.3.6 with the optimizer off; this compiler predates swarm metadata, so the match is complete with no trailing hash. The bare getters and absence of any msg.value guards pin the compiler to the solc 0.3.x line (0.4.0 and later add non-payable value checks). runtime sha256 f558496da613d2c10a8653c6a5f13c847c42918d25ec58a4ccaddf43f277281e.
Source Verified
Runtime (846 bytes) reproduces byte-for-byte from the reconstructed source using solc 0.3.6, optimizer off (predates swarm metadata). One of five byte-identical copies. runtime sha256 f558496da613d2c10a8653c6a5f13c847c42918d25ec58a4ccaddf43f277281e.
Tangerine Whistle Era
Emergency fork to address DoS attacks. Repriced IO-heavy opcodes.
Bytecode Overview
Verified Source Available
Source verified through compiler archaeology and exact bytecode matching.
View Verification ProofShow source code (Solidity)
// Verified by EthereumHistory (ethereumhistory.com)
contract CrowdFunding {
struct Funder { address addr; uint amount; }
Funder[] funders;
uint goal;
uint public deadline;
address beneficiary;
function fund() {
funders.push(Funder(msg.sender, msg.value));
}
function refund() {
if (now > deadline && this.balance < goal) {
uint i = 0;
while (i < funders.length) {
funders[i].addr.send(funders[i].amount);
i++;
}
}
}
function collect() {
if (now > deadline && this.balance >= goal)
beneficiary.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