A simple name registry from ether.camp: an address registers a name and can look names and addresses up in both directions.
Key Facts
Description
NameReg stores one name per address and one address per name. An address can register, change or remove its own name.
Source Verified
Exact runtime and creation bytecode match with soljson v0.1.1+commit.6ff4cd6, optimizer off. Source: github.com/ether-camp/contracts, revision blob 99115cbfbf (author original, verbatim). Verified on Etherscan. Not submitted to Sourcify: its oldest supported compiler is v0.1.7.
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 abstract {}
contract owned is abstract {
address owner;
function owned() {
owner = msg.sender;
}
modifier onlyowner() {
if (msg.sender==owner) _
}
}
contract mortal is abstract, owned {
function kill() {
if (msg.sender == owner) suicide(owner);
}
}
contract NameReg is mortal {
mapping (address => bytes32) toName;
mapping (bytes32 => address) toAddress;
mapping (bytes32 => address) nameOwner;
event Register(address indexed addr, bytes32 name);
event Unregister(address indexed addre, bytes32 name);
function NameReg() {
toName[this] = "NameReg";
toAddress["NameReg"] = this;
nameOwner["NameReg"] = msg.sender;
Register(this, "NameReg");
}
function register(bytes32 name) {
if (toAddress[name] != address(0) && nameOwner[name] != tx.origin) return;
bytes32 oldName = toName[msg.sender];
if (oldName != "") {
toAddress[oldName] = address(0);
nameOwner[oldName] = address(0);
Unregister(msg.sender, oldName);
}
toName[msg.sender] = name;
toAddress[name] = msg.sender;
nameOwner[name] = tx.origin;
Register(msg.sender, name);
}
function unregister() {
bytes32 name = toName[msg.sender];
if (name == "" || nameOwner[name] != tx.origin) return;
toName[msg.sender] = "";
toAddress[name] = address(0);
nameOwner[name] = address(0);
Unregister(msg.sender, name);
}
function addressOf(bytes32 name) constant returns (address addr) {
return toAddress[name];
}
function nameOf(address addr) constant returns (bytes32 name) {
return toName[addr];
}
}External Links
Related contracts
NameReg
Same deployerA simple name registry from ether.camp: an address registers a name and can look names and addresses up in both directions.
0x985509...3d00daSeptember 2, 2015Greeter
Same eraA HelloWorld greeter deployed at block 51,909 on 8 August 2015, one of a run of contracts from the same account that week.
0x412fda...7267edAugust 8, 2015Greeter
Same eraA Greeter with the message 'Ethereum will change the world smarter' - deployed Aug 8, 2015 by a developer connected to the Tokyo Smart Contract meetup.
0xda0c1c...7a68ebAugust 8, 2015MessageStore
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, 2015Greeter
Same eraThe go-ethereum Contract Tutorial greeter, deployed with the greeting: Hello World!
0x506f4b...466983August 8, 2015Contract 0xd4eae4...a2c77a
Same eraThe ethereum.org crowdsale tutorial, deployed on the ninth day of the public chain, with the funding goal, deadline and price fixed at construction.
0xd4eae4...a2c77aAugust 8, 2015