Back to Home

Contract 0xe0381e00e1f4...0c31a3b59a9f

Utility
0xe0381e00e1f4...0c31a3b59a9f
FrontierContract #391DecompiledEdit this contract
Deployed August 21, 2015 (11 years ago)Block 122,372

The ethereum.org crowdsale tutorial: contributions run to a deadline against a goal, pay out a separate reward token, and are refunded if the goal is missed.

Frontier Era

Historical Significance

This is what a token sale looked like before ERC-20 existed: a fixed price, a deadline, a threshold, an automatic refund if the threshold is missed, and the tokens themselves held in a separate contract addressed through sendCoin rather than transfer. The all-or-nothing goal it implements is the pattern token sales kept using for years after this code was replaced.

Context

Ethereum's Frontier network went live on 30 July 2015 and the ethereum.org tutorials were the main worked examples anyone had. This crowdsale predates ERC-20, which is why the token it pays out is addressed through sendCoin and coinBalanceOf rather than transfer and balanceOf.

Key Facts
Deployment Block
122,372
Deployment Date
Aug 21, 2015, 09:41 PM
Code Size
2.3 KB
Gas at Deploy
672,068
Transactions by Year
20151

Description

A crowdfunding contract from the 2015 ethereum.org tutorial. Its constructor fixes five things that can never be changed afterwards: who receives the money, the funding goal, how many minutes the campaign runs, the price of one reward token, and the address of the token contract that pays contributors.

Contributions arrive through the fallback function. Each sender is appended to a public funders array along with the amount, the running total goes up, and the reward token is asked to send that contributor the amount divided by the price. Once the deadline has passed anyone may call checkGoalReached(): if the total met the goal the balance goes to the beneficiary, otherwise the contract walks the funders array and refunds each one in turn. Either way it then self-destructs to the beneficiary.

The reward tokens have to be sitting in this contract before the sale opens and nothing here checks that they are. The refund loop is unbounded, so a campaign with enough contributors cannot be closed inside a block's gas limit, and neither the refunds nor the payout check whether send() succeeded.

This one pays 0x8d7bb355b02ca6822f767a92d9125007011c313e on success. It was opened with a goal of 100 ether, a window of 30 minutes, and a price of 0.02 ether for one token, handing out the token at 0xa1a040d54c897b7e7476cea14525c5c2ab7c3c00.

Heuristic Analysis

The following characteristics were detected through bytecode analysis and may not be accurate.

Detected Type: Utility

Bytecode Overview

Opcodes2,387
Unique Opcodes144
Jump Instructions63
Storage Operations54

External Links

Related contracts