The 2015 ethereum.org tutorial token: one balance mapping, the whole supply to the creator, and a sendCoin that predates ERC-20 transfer.
Historical Significance
The ancestor of every copied token contract that followed. It shows how little a token was before ERC-20: a mapping, a subtraction, an addition and an event, with no allowance mechanism and no metadata for a wallet to display.
Context
Ethereum's Frontier network went live on 30 July 2015. The tutorial token of that period predates ERC-20: balances are read through coinBalanceOf, transfers are sent with sendCoin, and the event announcing one is called CoinTransfer.
Contract Information
Key Facts
Description
The token from the 2015 ethereum.org tutorial, in the form that predates ERC-20. It keeps one public mapping of balances, hands the whole supply to whoever creates it, and moves units with sendCoin(receiver, amount), which checks the sender's balance, returns false rather than reverting when it is short, and announces a successful move with a CoinTransfer event.
There is no approval, no allowance, no decimals, no name and no symbol. The supply is set once and cannot be added to.
This one was created with a supply of 10,000 units, which is the tutorial's own default.
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Homestead Era
The first planned hard fork. Removed the canary contract, adjusted gas costs.
Bytecode Overview
Verified Source Available
This contract has verified source code on Etherscan.
Show source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
contract token {
mapping (address => uint) public coinBalanceOf;
event CoinTransfer(address sender, address receiver, uint amount);
/* Initializes contract with initial supply tokens to the creator of the contract */
function token(uint supply) {
if (supply == 0) supply = 10000;
coinBalanceOf[msg.sender] = supply;
}
/* Very simple trade function */
function sendCoin(address receiver, uint amount) returns(bool sufficient) {
if (coinBalanceOf[msg.sender] < amount) return false;
coinBalanceOf[msg.sender] -= amount;
coinBalanceOf[receiver] += amount;
CoinTransfer(msg.sender, receiver, amount);
return true;
}
}
External Links
Related contracts
token (miner)
Same deployerA mineable subcurrency where claimMiningReward() mints 1 token to block.coinbase once per block. Deployed Jun 16 2016.
0xa5192c...968a27June 17, 2016token
Same eraBare Homestead-era token (Mar 14 2016): public balanceOf mapping + a single unchecked transfer firing the standard Transfer event.
0xc77f06...494c69March 14, 2016DinastyCoinToken
Same eraHomestead-era transfer-only token, DinastyCoinToken (DCT), fixed supply 200000000 and 6 decimals.
0x3693fd...c11466March 14, 2016token
Same eraMinimal Homestead-era token shell (Mar 14 2016): just a public balanceOf mapping and its compiler-generated getter, with no other functions.
0x38e1da...41a81aMarch 14, 2016sultancoin
Same eraA fixed-supply token with direct transfers only, deployed March 2016.
0x9a11ff...0b797dMarch 15, 2016666🐏
Same eraSix hundred and sixty six units, named and ticketed with a ram emoji.
0x7684aa...d0ed06March 16, 2016