The Frontier Guide's Coin tutorial contract: a pre-ERC-20 token with coinBalanceOf, sendCoin and a CoinTransfer event.
Historical Significance
The Frontier Guide's Coin contract was the standard worked example for issuing a currency on Ethereum, published more than a year before ERC-20 existed. It shows the pre-standard vocabulary the ecosystem used at the time: coinBalanceOf rather than balanceOf, sendCoin rather than transfer, and a CoinTransfer event rather than Transfer. Contracts like this are the direct ancestors of the token standard that replaced them.
Context
Deployed 2015-09-21 by 0x4bbc2ef7e5482b88e8c9c4bc05c5a3d3ff2b03c7. Thirty-five byte-identical copies of this runtime appear in the Ethereum History archive as undocumented Frontier contracts, deployed by ten distinct addresses between 2015-08-08 and 2015-09-21. One address accounts for twenty of them; the remaining fifteen are spread across nine others, consistent with a mix of repeated experimentation and independent readers working through the same tutorial.
Key Facts
Description
A minimal pre-standard token. The constructor credits the deployer with the supply argument, falling back to 10000 via the old Solidity expression (supply || 10000). sendCoin(address,uint256) returns false instead of reverting when the sender's balance is short, debits and credits two entries of the public coinBalanceOf mapping, and emits CoinTransfer. The runtime is 495 bytes and dispatches two selectors: sendCoin(address,uint256) at 0x90b98a11 and the mapping getter coinBalanceOf(address) at 0xbbd39ac0. There is no allowance mechanism, no total supply accessor and no owner privilege.
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 on Etherscan.
Show source code (Solidity)
contract token {
mapping (address => uint) public coinBalanceOf;
event CoinTransfer(address sender, address receiver, uint amount);
function token(uint supply) {
coinBalanceOf[msg.sender] = (supply || 10000);
}
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
Greeter
Same deployerA Frontier-era Greeter with the message: 'Hello there captain!'
0x5817e8...352f68August 16, 2015Greeter
Same deployerA Frontier-era Greeter with the message: 'Hola!'
0x86cfd9...9ae03dAugust 16, 2015Greeter
Same deployerA Frontier-era Greeter with the message: Hola! (block 97,240)
0xfd8fae...b61974August 16, 2015Greeter
Same deployerA Frontier-era Greeter with the message: 'Hola!'
0x80ca78...6cfa45August 16, 2015Greeter
Same deployerA Frontier-era Greeter with the message: 'Hola!'
0xae0724...4792f2August 16, 2015token
Same deployerThe Frontier Guide's Coin tutorial contract: a pre-ERC-20 token with coinBalanceOf, sendCoin and a CoinTransfer event.
0xe6391f...93554eAugust 16, 2015