The greeter with a changeable greeting and a block number reader
Context
Deployed in December 2015 on the Frontier chain.
Key Facts
Description
The greeter that repeats a string given at construction, extended past the tutorial version: setGreeting lets the creator replace the greeting after deployment, and getBlockNumber returns the current block, included by its author as a demonstration of reading a global rather than for any purpose of its own. kill returns the balance to the creator. The declaration order matters to the compiled result: kill is written above setGreeting, and putting them the other way round moves a jump and changes the bytecode.
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)
/*
The following is an extremely basic example of a solidity contract.
It takes a string upon creation and then repeats it when greet() is called.
*/
contract Greeter // The contract definition. A constructor of the same name will be automatically called on contract creation.
{
address creator; // At first, an empty "address"-type variable of the name "owner". Will be set in the constructor.
string greeting; // At first, an empty "string"-type variable of the name "greeting". Will be set in constructor and can be changed.
function Greeter(string _greeting) public // The constructor. It accepts a string input and saves it to the contract's "greeting" variable.
{
creator = msg.sender;
greeting = _greeting;
}
function greet() constant returns (string)
{
return greeting;
}
function getBlockNumber() constant returns (uint) // this doesn't have anything to do with the act of greeting
{ // just demonstrating return of some global variable
return block.number;
}
function kill()
{
if (msg.sender == creator)
suicide(creator); // kills this contract and sends remaining funds back to creator
}
function setGreeting(string _newgreeting)
{
greeting = _newgreeting;
}
/**********
Standard kill() function to recover funds
**********/
}External Links
Related contracts
Greeter
Same deployerThe Greeter from the solidity-baby-steps tutorials, deployed with an empty greeting.
0x68b58d...dc2dc0December 1, 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, 2015CoinFlipper
Same eraA coin flip on the block timestamp that pays double or keeps the stake
0x6c8dda...5ef84eAugust 8, 2015Contract 0xa85146...9bbf06
Same erago-ethereum's built-in hash registrar, mapping a key to a content hash
0xa85146...9bbf06August 10, 2015Ballot
Same eraDelegated voting with a proposal count fixed at deployment
0x3cf26c...b6a8e1August 18, 2015Ballot
Same eraDelegated voting with a proposal count fixed at deployment
0x56ce77...b44745August 18, 2015