Revised ExpRegistrar, deployed six minutes before its source was committed to ethereum/dapp-bin. Seeds itself with the names gavofyork and NameReg.
Historical Significance
The finished form of Gavin Wood's escalating price registrar, and one of the few Frontier contracts that can be dated against the exact commit that describes it.
Context
Deployed on 13 August 2015 at 11:30 UTC by 0xb7576e9d314df41ec5506494293afb1bd5d3f65d. The matching source was committed to ethereum/dapp-bin as registrar/ExpRegistrar.sol at 11:36 UTC the same morning, in commit 411eecfed0, under the message Fixes and whatnot. The deployment came first and the commit followed six minutes later. This contract cannot be verified on Etherscan: the build that produced it was never released. Solidity v0.1.1 reproduces the runtime exactly but cannot compile the constructor, and v0.1.2 compiles the constructor but drops the STOP byte that v0.1.1 places between code and data, leaving it one byte short. Both were submitted and both were rejected. The source here is nonetheless exact, and the reconstruction is described in the description field.
Key Facts
Description
A revision of ExpRegistrar 0x96d76ae3397b52d9f61215270df65d72358709e3. The price step rises from double to ten times per sale, a buyer can no longer take an unowned name by paying its stored price, and the single Changed event is split so that a sale emits OwnerChanged and a reverse name update emits AddressChanged. The constructor writes two records before anyone can touch the contract: gavofyork, owned by 0x00fc9b9fd6ae40fd47941399915b9ce4fd5e1f28, and NameReg, owned by the contract itself. Both are priced at 2 to the power 200, which puts them out of reach of any buyer.
Verification: the deployed build sits between Solidity v0.1.1+commit.6ff4cd6 and v0.1.2+commit.d0d36e3, and no compiler was ever released in that window. v0.1.1 with the optimizer on reproduces all 3021 bytes of the runtime exactly, but errors out on the constructor, which assigns to a struct member through a string keyed mapping. v0.1.2 compiles the constructor and reproduces its 576 bytes exactly, but drops the STOP byte that v0.1.1 places between code and data. Putting the v0.1.2 constructor prefix, the v0.1.1 style header and the v0.1.1 runtime together reproduces all 3611 bytes of the on chain creation code with no bytes left over.
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)
// Simple global registrar with fixed-fee reservations.
// @authors:
// Gav Wood <g@ethdev.com>
contract Registrar {
event Changed(string indexed name);
function owner(string _name) constant returns (address o_owner);
function addr(string _name) constant returns (address o_address);
function subRegistrar(string _name) constant returns (address o_subRegistrar);
function content(string _name) constant returns (bytes32 o_content);
function name(address _addr) constant returns (string o_name);
}
contract ExpRegistrar is Registrar {
struct Record {
address addr;
address subRegistrar;
bytes32 content;
address owner;
uint price;
}
event OwnerChanged(string indexed name);
event AddressChanged(address indexed name);
modifier onlyrecordowner(string _name) { if (m_record[_name].owner == msg.sender) _ }
function ExpRegistrar() {
m_record["gavofyork"].owner = 0x00fc9b9fd6ae40fd47941399915b9ce4fd5e1f28;
m_record["gavofyork"].price = 2**200;
m_reverse[0x00fc9b9fd6ae40fd47941399915b9ce4fd5e1f28] = "gavofyork";
m_record["NameReg"].owner = this;
m_record["NameReg"].price = 2**200;
m_reverse[uint160(this)] = "NameReg";
}
function setName(string _name) {
m_reverse[uint160(msg.sender)] = _name;
AddressChanged(msg.sender);
}
function setAddr(string _name, address _a) onlyrecordowner(_name) {
m_record[_name].addr = _a;
Changed(_name);
}
function reserve(string _name) {
Record rec = m_record[_name];
if ((rec.owner == 0 && msg.value >= 1 ether) || (rec.owner != 0 && msg.value >= rec.price)) {
if (rec.price > 0)
rec.owner.send(rec.price);
else
rec.price = msg.value;
rec.price *= 10;
rec.owner = msg.sender;
OwnerChanged(_name);
}
}
function transfer(string _name, address _newOwner) onlyrecordowner(_name) {
m_record[_name].owner = _newOwner;
Changed(_name);
}
function setSubRegistrar(string _name, address _registrar) onlyrecordowner(_name) {
m_record[_name].subRegistrar = _registrar;
Changed(_name);
}
function setContent(string _name, bytes32 _content) onlyrecordowner(_name) {
m_record[_name].content = _content;
Changed(_name);
}
function record(string _name) constant returns (address o_addr, address o_subRegistrar, bytes32 o_content, address o_owner) {
Record rec = m_record[_name];
o_addr = rec.addr;
o_subRegistrar = rec.subRegistrar;
o_content = rec.content;
o_owner = rec.owner;
}
function addr(string _name) constant returns (address) { return m_record[_name].addr; }
function subRegistrar(string _name) constant returns (address) { return m_record[_name].subRegistrar; }
function content(string _name) constant returns (bytes32) { return m_record[_name].content; }
function owner(string _name) constant returns (address) { return m_record[_name].owner; }
function name(address _addr) constant returns (string) { return m_reverse[uint160(_addr)]; }
string[2**160] m_reverse;
mapping (string => Record) m_record;
}External Links
Related contracts
NameReg
Same deployerFixed fee name registry deployed 7 August 2015, the night before NameRegistry and by the same account. Same 69 ETH fee, no read functions.
0xc076cf...a339a5August 7, 2015NameRegistry
Same deployerFixed-fee name registry from Day 9 of Ethereum (Aug 8, 2015). Reserve names for 69 ETH, resolve addresses. A precursor to ENS.
0xa1a111...b8af00August 8, 2015ExpRegistrar
Same deployerFirst deployment of Gavin Wood's ExpRegistrar, a name registry where every name has a standing price that doubles on each sale.
0x96d76a...8709e3August 12, 2015