An early coin contract with balance transfers and a delegated-spending approval system.
Context
Deployed on 29 February 2016. It follows the standardized contract APIs pattern for coins that circulated in early Ethereum.
Key Facts
Description
A coin contract that credits its deployer with an initial balance when it is constructed and lets holders move units to another account with sendCoin. It supports delegated spending through sendCoinFrom together with approve, approveOnce and disapprove, so one account can authorise another address to move its balance up to a limit. Balances are readable with coinBalance and coinBalanceOf, and a CoinSent event is logged on every transfer.
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 currency {
struct Account {
uint balance;
mapping ( address => uint) withdrawers;
}
mapping ( address => Account ) accounts;
event CoinSent(address indexed from, uint256 value, address indexed to);
function currency() {
accounts[msg.sender].balance = 1000000;
}
function sendCoin(uint _value, address _to) returns (bool _success) {
if (accounts[msg.sender].balance >= _value && _value < 340282366920938463463374607431768211456) {
accounts[msg.sender].balance -= _value;
accounts[_to].balance += _value;
CoinSent(msg.sender, _value, _to);
_success = true;
}
else _success = false;
}
function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) {
uint auth = accounts[_from].withdrawers[msg.sender];
if (accounts[_from].balance >= _value && auth >= _value && _value < 340282366920938463463374607431768211456) {
accounts[_from].withdrawers[msg.sender] -= _value;
accounts[_from].balance -= _value;
accounts[_to].balance += _value;
CoinSent(_from, _value, _to);
_success = true;
_success = true;
}
else _success = false;
}
function coinBalance() constant returns (uint _r) {
_r = accounts[msg.sender].balance;
}
function coinBalanceOf(address _addr) constant returns (uint _r) {
_r = accounts[_addr].balance;
}
function approve(address _addr) {
accounts[msg.sender].withdrawers[_addr] = 340282366920938463463374607431768211456;
}
function isApproved(address _proxy) returns (bool _r) {
_r = (accounts[msg.sender].withdrawers[_proxy] > 0);
}
function approveOnce(address _addr, uint256 _maxValue) {
accounts[msg.sender].withdrawers[_addr] += _maxValue;
}
function isApprovedOnceFor(address _target, address _proxy) returns (uint256 _r) {
_r = accounts[_target].withdrawers[_proxy];
}
function disapprove(address _addr) {
accounts[msg.sender].withdrawers[_addr] = 0;
}
}External Links
Related contracts
MessageStore
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, 2015EtherPot (draft build)
Same eraA pre-release August 2015 test build of the EtherPot blockhash lottery, deployed three weeks into Frontier and never played.
0x47f53b...416adfAugust 21, 2015EtherPot
Same eraThe public EtherPot lottery, an August 2015 Frontier contract whose blockhash-based winner selection became an early cautionary tale about on-chain randomness.
0x539f29...9587f9August 25, 2015Contract 0xba575c...78733f
Same eraA contract built to probe what the msg globals actually return, endowed with 5 ETH, deployed 1 September 2015.
0xba575c...78733fSeptember 1, 2015Contract 0x46dce1...3086aa
Same eraA contract built to probe what the msg globals return, endowed with 3 ETH on 1 September 2015.
0x46dce1...3086aaSeptember 1, 2015Contract 0x4959e0...f0d5bd
Same eraA coin flip wager contract endowed with 6 ETH, deployed 2 September 2015.
0x4959e0...f0d5bdSeptember 2, 2015