An ether wrapper that meets nine of the ten mandatory EIP-20 requirements under execution. Its bounds helper checks a + b > a rather than a + b >= a, so a transfer of zero throws instead of succeeding.
Historical Significance
Deployed in block 1,059,698 on 25 February 2016, this is the closest any contract on Ethereum mainnet came to full EIP-20 compliance before 0xacFD9D15fA769EaBb68410c4c675Ff2030f26416 reached it on 20 March 2016. Tested by execution against the ten mandatory requirements of EIP-20 as finalised, it passes nine. The one it fails is the rule that a transfer of zero must be treated as a normal transfer and must emit the event: its overflow helper returns a + b > a, so adding zero to a balance fails the check and the call throws. The March contract is the same code for its first 2,342 bytes and differs only in that helper, comparing with ADD LT ISZERO where this one compares with ADD GT. A single opcode is the whole distance between the two. It is also an ether wrapper a year before WETH9, with deposit(), withdraw(uint256), a totalSupply() that returns the contract's own ether balance so supply and collateral cannot drift apart, and the Deposit and Withdrawal event topics WETH9 would later carry.
Key Facts
Description
Deployed 25 February 2016. The same ether wrapper as 0xacFD9D15fA769EaBb68410c4c675Ff2030f26416: deposit() credits the caller, withdraw(uint256) pays back, totalSupply() returns the contract's own ether balance, the fallback forwards to deposit(), and the Deposit and Withdrawal event signatures match WETH9's.
The two runtimes agree for their first 2,342 bytes and diverge in one comparison in the tail overflow helper. Here it returns a + b > a; in the March deployment it returns a + b >= a. With the strict form an amount of zero makes the check false and the throw fires, so transfer(to, 0) reverts instead of succeeding and emitting an event. That is the one opcode separating this contract from the first fully EIP-20 compliant one.
Its only transaction is its creation.
Source recovered by compiling against solc v0.3.0+commit.11d67369 with the optimizer off, reproducing the deployed runtime exactly.
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
This contract has verified source code.
View Verification ProofShow source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
contract EtherToken {
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Deposit(address indexed _owner, uint256 _value);
event Withdrawal(address indexed _owner, uint256 _value);
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function transfer(address _to, uint256 _value) returns (bool success) {
if (balances[msg.sender] < _value) throw;
if (!safeToAdd(balances[_to], _value)) throw;
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
if (balances[_from] < _value) throw;
if (allowed[_from][msg.sender] < _value) throw;
if (!safeToAdd(balances[_to], _value)) throw;
allowed[_from][msg.sender] -= _value;
balances[_from] -= _value;
balances[_to] += _value;
Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
function totalSupply() constant returns (uint256 supply) {
return this.balance;
}
function withdraw(uint256 _value) returns (bool success) {
if (balances[msg.sender] >= _value) {
if (msg.sender.call.value(_value)()) {
balances[msg.sender] -= _value;
Withdrawal(msg.sender, _value);
return true;
}
}
}
function deposit() returns (bool success) {
balances[msg.sender] += msg.value;
Deposit(msg.sender, msg.value);
return true;
}
function () returns (bool success) {
return deposit();
}
function safeToAdd(uint a, uint b) internal returns (bool) {
return (a + b > a);
}
}External Links
Related contracts
token
Same eraAn early ERC-20-like token deployed in Ethereum's first week, built directly from the example in the official Ethereum Frontier Guide documentation.
0x8374f5...46609aAugust 7, 2015token
Same eraA second deployment of the FirstCoin tutorial token by the same creator, 11 blocks after the original — both derived from the official Ethereum Frontier Guide e
0x3b4446...295f52August 7, 2015Contract 0xd958b5...ec4c9f
Same eraEthereum.org tutorial Coin contract deployed on Frontier day 1. Contains a bug: balance(address) ignores its argument and returns msg.sender balance.
0xd958b5...ec4c9fAugust 7, 2015token
Same eraEarly tutorial-derived coin contract compiled with Solidity v0.1.1, deployed 9 days after Ethereum Frontier launch.
0x3c401b...da1634August 8, 2015token
Same eraTutorial-derived coin contract (Solidity v0.1.1), one of multiple token instances deployed by the same address on Aug 8, 2015.
0x33e986...395d13August 8, 2015CoinStub
Same eraCoin tutorial stub — mapping getter + empty function returning default bool.
0x4fb5ac...3b08aeAugust 8, 2015