The bare owned base contract, deployed alone at 326 bytes on 12 March 2016.
Historical Significance
This is the two line ownership mixin from the ethereum.org token tutorial, deployed by itself rather than inherited by anything. All it does is record its deployer and expose a changeOwner setter behind an onlyOwner modifier. At 326 bytes of runtime it is one of the smallest deliberate deployments of the period, and the shape of it suggests someone working through the tutorial one code block at a time and pressing deploy on each.
Context
Homestead had activated two days earlier at block 1,150,000.
Key Facts
Description
A minimal ownership contract. It stores an owner address, exposes it for reading, and lets the current owner hand the role to another address. Contracts of this kind are inherited rather than used on their own. Deployed March 2016 by 0x39afc3556daa4d11a0a8f16ec1a490cd84aa6945.
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.
Show source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
if (msg.sender != owner) throw;
_
}
function transferOwnership(address newOwner) onlyOwner {
owner = newOwner;
}
}
contract MyToken is owned {
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
uint256 public sellPrice;
uint256 public buyPrice;
/* This creates an array with all balances */
mapping (address => uint256) public balanceOf;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event Transfer(address indexed from, address indexed to, uint256 value);
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
function MyToken(uint256 initialSupply, string tokenName, uint8 decimalUnits, string tokenSymbol, address centralMinter) {
if (initialSupply == 0) initialSupply = 1000000; // if supply not given then generate 1 million
if(centralMinter != 0 ) owner = msg.sender; // Sets the minter
balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
decimals = decimalUnits; // Amount of decimals for display purposes
}
/* Send coins */
function transfer(address _to, uint256 _value) {
if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough
if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
if (frozenAccount[msg.sender]) throw; // Check if frozen
balanceOf[msg.sender] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place
}
function mintToken(address target, uint256 mintedAmount) onlyOwner {
balanceOf[target] += mintedAmount;
Transfer(0, target, mintedAmount);
}
function freezeAccount(address target, bool freeze) onlyOwner {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner {
sellPrice = newSellPrice;
buyPrice = newBuyPrice;
}
function buy() {
uint amount = msg.value / buyPrice; // calculates the amount
if (balanceOf[this] < amount) throw; // checks if it has enough to sell
balanceOf[msg.sender] += amount; // adds the amount to buyer's balance
balanceOf[this] -= amount; // subtracts amount from seller's balance
Transfer(this, msg.sender, amount); // execute an event reflecting the change
}
function sell(uint256 amount) {
if (balanceOf[msg.sender] < amount ) throw; // checks if the sender has enough to sell
balanceOf[this] += amount; // adds the amount to owner's balance
balanceOf[msg.sender] -= amount; // subtracts the amount from seller's balance
msg.sender.send(amount * sellPrice); // sends ether to the seller
Transfer(msg.sender, this, amount); // executes an event reflecting on the change
}
} External Links
Related contracts
Contract 0xc0beee...dea23d
Same deployerA token with transfers and third-party allowances, and an owner who can mint new units, deployed March 2016.
0xc0beee...dea23dMarch 6, 2016MessageStore
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, 2015Logger
Same eraA minimal event-logging contract with a single function log(uint256) that emits MyEvent. Compiled with soljson v0.1.2, optimizer off.
0x7b6556...86239cOctober 1, 2015Greeter
Same eraDeployment of the official Solidity Greeter tutorial, initialized with "Hello World!" and compiled with soljson v0.1.1.
0x3860fc...c6ff6fOctober 6, 2015