The go-ethereum Contract Tutorial greeter, deployed with the greeting: hello cibi
Historical Significance
The Contract Tutorial was the introduction to Solidity that shipped with go-ethereum, and deploying the greeter was its final step. Each copy therefore preserves the sentence its author chose to write onto a public chain while learning the tools. The Solidity source here was recovered by compiling the tutorial text with period compilers until the output matched the deployed bytecode exactly.
Context
The Contract Tutorial on the go-ethereum wiki was written for Frontier in 2015 and stayed in use as an introduction to Solidity well past the Homestead fork of March 2016. Copies of its greeter went on being deployed to mainnet by people working through the tutorial, compiled with whichever Solidity release was current when they reached the last step.
Key Facts
Description
The greeter is the worked example of the Contract Tutorial on the go-ethereum wiki. It inherits a base contract named mortal, which records the account that created it and exposes kill(), a function that self-destructs the contract and sends its balance to that account. Only the creator can call it.
The greeter itself adds one string. The constructor stores the greeting given at deployment and greet() returns it. There is no setter, so the greeting a copy is born with is the only greeting it ever has, and no account other than the creator can affect it.
This copy was deployed with the greeting: hello cibi
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Tangerine Whistle Era
Emergency fork to address DoS attacks. Repriced IO-heavy opcodes.
Bytecode Overview
Verified Source Available
This contract has verified source code on Etherscan.
Show source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
contract mortal {
/* Define variable owner of the type address*/
address owner;
/* this function is executed at initialization and sets the owner of the contract */
function mortal() { owner = msg.sender; }
/* Function to recover the funds on the contract */
function kill() { if (msg.sender == owner) suicide(owner); }
}
contract greeter is mortal {
/* define variable greeting of the type string */
string greeting;
/* this runs when the contract is executed */
function greeter(string _greeting) public {
greeting = _greeting;
}
/* main function */
function greet() constant returns (string) {
return greeting;
}
}
External Links
Related contracts
ECVerifyLib
Same eraSignature recovery library for the Devcon 2 attendee token
0x1dd4ab...4aa8cbNovember 2, 2016Contract 0xeeee2a...6133e5
Same eraEvent emitter library for the Devcon 2 attendee token
0xeeee2a...6133e5November 2, 2016Contract 0xec0d00...5cb4c8
Same eraSignature recovery library for the Devcon 2 attendee token
0xec0d00...5cb4c8November 2, 2016TokenEventLib
Same eraEvent emitter library for the Devcon 2 attendee token
0x63f94e...1392fbNovember 2, 2016Contract 0xaf5d0d...7ce190
Same eraEvent emitter library for the Devcon 2 attendee token
0xaf5d0d...7ce190November 2, 2016Contract 0xfdc627...e76d7f
Same eraAn address to address map with iteration, deployed as a shared library
0xfdc627...e76d7fNovember 7, 2016