The July 2015 ethereum.org crowdsale tutorial, with a fallback that reverts on every contribution.
Context
Deployed 22 October 2015, during the Frontier era.
Key Facts
Description
A crowdfunding contract compiled from the July 2015 revision of the ethereum.org crowdsale tutorial. The constructor takes a beneficiary, a funding goal, a duration in minutes, a price per token and the address of a token contract. checkGoalReached, which its modifier allows only after the deadline, either sends the whole balance to the beneficiary or pays every funder back in turn, and self destructs either way. The fallback that is supposed to record a contribution reads funders[++funders.length]: the pre increment raises the array length to n plus one and the index is that same n plus one, one slot past the last valid entry, so the bounds check fails and every payment sent to this contract reverts. The deployment passed no constructor arguments, so the beneficiary and the token address are the zero address, the funding goal and the price are zero, and the deadline is the deployment timestamp.
Source Verified
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Frontier Era
The initial release of Ethereum. A bare-bones implementation for technical users.
Bytecode Overview
Verified Source Available
Source verified through compiler archaeology and exact bytecode matching.
View Verification ProofShow source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
contract token { mapping (address => uint) public coinBalanceOf; function token() {} function sendCoin(address receiver, uint amount) returns(bool sufficient) { } }
contract CrowdSale {
address public beneficiary;
uint public fundingGoal; uint public amountRaised; uint public deadline; uint public price;
token public tokenReward;
Funder[] public funders;
event FundTransfer(address backer, uint amount, bool isContribution);
/* data structure to hold information about campaign contributors */
struct Funder {
address addr;
uint amount;
}
/* at initialization, setup the owner */
function CrowdSale(address _beneficiary, uint _fundingGoal, uint _duration, uint _price, token _reward) {
beneficiary = _beneficiary;
fundingGoal = _fundingGoal;
deadline = now + _duration * 1 minutes;
price = _price;
tokenReward = token(_reward);
}
/* The function without name is the default function that is called whenever anyone sends funds to a contract */
function () {
Funder f = funders[++funders.length];
f.addr = msg.sender;
f.amount = msg.value;
amountRaised += f.amount;
tokenReward.sendCoin(msg.sender, f.amount/price);
FundTransfer(f.addr, f.amount, true);
}
modifier afterDeadline() { if (now >= deadline) _ }
/* checks if the goal or time limit has been reached and ends the campaign */
function checkGoalReached() afterDeadline {
if (amountRaised >= fundingGoal){
beneficiary.send(amountRaised);
FundTransfer(beneficiary, amountRaised, false);
} else {
FundTransfer(0, 11, false);
for (uint i = 0; i < funders.length; ++i) {
funders[i].addr.send(funders[i].amount);
FundTransfer(funders[i].addr, funders[i].amount, false);
}
}
suicide(beneficiary);
}
}External Links
Related contracts
Multiply7
Same deployerThe hello-world of Solidity: multiply(x) returns x*7. The ethereum.org tutorial contract. 120 copies deployed Sep 2015 through Feb 2016.
0xfc3c99...90d3d6October 24, 2015Contract 0x2273df...27ef78
Same deployerA copy of the coin contract from the Frontier Guide where the contract was renamed but its constructor was not, leaving the supply function callable by anyone.
0x2273df...27ef78October 24, 2015Contract 0xb00de1...a6a7f9
Same deployerA copy of the coin contract from the Frontier Guide where the contract was renamed but its constructor was not, leaving the supply function callable by anyone.
0xb00de1...a6a7f9October 24, 2015Contract 0x2ad2be...696e00
Same deployerA copy of the coin contract from the Frontier Guide where the contract was renamed but its constructor was not, leaving the supply function callable by anyone.
0x2ad2be...696e00October 24, 2015Contract 0x36626e...60d957
Same deployerA copy of the coin contract from the Frontier Guide where the contract was renamed but its constructor was not, leaving the supply function callable by anyone.
0x36626e...60d957October 24, 2015Contract 0x60fce8...c84ef7
Same deployerA copy of the coin contract from the Frontier Guide where the contract was renamed but its constructor was not, leaving the supply function callable by anyone.
0x60fce8...c84ef7October 24, 2015