The subcurrency example from the Solidity documentation with a payable deposit bolted on.
Historical Significance
The Solidity documentation opened with a subcurrency because it is the smallest program that is obviously a program about money: an issuer, a ledger and a transfer that refuses to overdraw. Everything a token standard later argued about, who may create units, who may move them, what a client is told when they move, is present here in the form it took before anyone had proposed a standard at all.
Context
Deployed in 2015 on the Ethereum Frontier network.
Key Facts
Description
Coin is the first real contract in the Solidity documentation: a minter address, a balance mapping, mint(address,uint256) that only the minter may call, and send(address,uint256) that moves a balance and fires an event. This deployment adds two things the documentation does not have. deposit() is payable and credits the caller's own balance with the ether sent, turning the example into a one way wrapper with no way to withdraw, and queryBalance(address) is restricted to the minter, so a holder cannot read their own balance through it. The storage slot between the minter and the balances is declared and never touched, so its width is recoverable but its name and type are not. Source recovered by exact bytecode match: solc v0.1.4+commit.5f6c3cdf with the optimizer off reproduces all 866 bytes of the deployed code.
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 Coin {
address minter;
uint supply;
mapping (address => uint) balances;
event Send(address from, address to, uint amount);
function Coin() {
minter = msg.sender;
}
function mint(address receiver, uint amount) {
if (msg.sender != minter) return;
balances[receiver] += amount;
}
function send(address receiver, uint amount) {
if (balances[msg.sender] < amount) return;
balances[msg.sender] -= amount;
balances[receiver] += amount;
Send(msg.sender, receiver, amount);
}
function queryBalance(address addr) returns (uint balance) {
if (msg.sender != minter) return;
return balances[addr];
}
function deposit() {
balances[msg.sender] += msg.value;
}
}External Links
Related contracts
Bounce
Same deployerA 132-byte contract with one function, sendBack(), which immediately returns any ether sent with the call.
0x5954f5...ff93b8September 2, 2015Contract 0x578713...7d7060
Same deployerThe Solidity tutorial subcurrency, compiled without the optimiser
0x578713...7d7060September 3, 2015Coin
Same deployerThe Solidity tutorial subcurrency, with the balance reader restricted to the minter
0x4d0cd1...4e6577September 3, 2015Bank
Same deployerA 534-byte deposit ledger: deposit() records the caller's ether, a timestamp and an id, and only the owner can read a balance back. No withdrawal function exists.
0x2e7145...3f0bf6September 4, 2015Bank
Same deployerA 541-byte deposit ledger: deposit() records the caller's ether and a timestamp, and only the owner can read a balance back. No withdrawal function exists.
0x8c953f...984534September 5, 2015Bank
Same deployerA 532-byte deposit ledger: deposit() records the caller's ether and a timestamp, and only the owner can read a balance back. No withdrawal function exists.
0x76000f...0bae2eSeptember 5, 2015