The Solidity tutorial subcurrency, a minter and a balance mapping
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 November 2015 on the Frontier chain. The subcurrency example was the first thing most people read after SimpleStorage, and it is the ancestor of the token contracts that followed.
Key Facts
Description
The Coin example from the August 2015 Solidity Tutorial, deployed unchanged apart from the order its functions were written in. The account that deploys it becomes the minter and is the only one who may create units through mint. Holders move balances with send, which checks the sender's balance, adjusts both entries and emits a Send event carrying the sender, the receiver and the amount. queryBalance reads any address's balance. There is no total supply and no approval mechanism, so it predates the token interface that ERC-20 would later standardise.
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;
mapping (address => uint) balances;
event Send(address from, address to, uint value);
function Coin() {
minter = msg.sender;
}
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 mint(address owner, uint amount) {
if (msg.sender != minter) return;
balances[owner] += amount;
}
function queryBalance(address addr) constant returns (uint balance) {
return balances[addr];
}
}External Links
Related contracts
Greeter
Same eraA HelloWorld greeter deployed at block 51,909 on 8 August 2015, one of a run of contracts from the same account that week.
0x412fda...7267edAugust 8, 2015Greeter
Same eraA Greeter with the message 'Ethereum will change the world smarter' - deployed Aug 8, 2015 by a developer connected to the Tokyo Smart Contract meetup.
0xda0c1c...7a68ebAugust 8, 2015MessageStore
Same eraA 6-line contract storing a single public string, deployed Day 9 of Ethereum by a prolific early experimenter who shipped 18 contracts in one week.
0xd2eccd...ff3d6bAugust 8, 2015Greeter
Same eraThe go-ethereum Contract Tutorial greeter, deployed with the greeting: Hello World!
0x506f4b...466983August 8, 2015Contract 0xd4eae4...a2c77a
Same eraThe ethereum.org crowdsale tutorial, deployed on the ninth day of the public chain, with the funding goal, deadline and price fixed at construction.
0xd4eae4...a2c77aAugust 8, 2015Greeter
Same eraA Frontier-era Greeter contract with the message: 'Hello World!'
0x113158...72fa8aAugust 8, 2015