The State Machine example from the Solidity documentation's common patterns page, deployed as written with its empty function bodies.
Context
Deployed 27 December 2015, during the Frontier era.
Key Facts
Description
The StateMachine example from the common patterns page of the Solidity documentation, deployed unchanged. It holds a Stages enum running from AcceptingBlindedBids through RevealBids, AnotherStage and AreWeDoneYet to Finished, and a creationTime recorded at deployment. The timedTransitions modifier advances the stage once ten days have passed for the first and twelve for the second, and the remaining stages advance only when a function carrying transitionNext is called. bid and reveal have empty bodies in the documentation and are empty here too, so the contract does nothing but hold and advance a stage counter. Deployed by the same address as the SimpleAuction at 0xa46f385e79c13449ffad2ab75073d7a616626d7d thirty seven minutes earlier, in a run through the documentation's examples.
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)
contract StateMachine {
enum Stages {
AcceptingBlindedBids,
RevealBids,
AnotherStage,
AreWeDoneYet,
Finished
}
// This is the current stage.
Stages public stage = Stages.AcceptingBlindedBids;
uint public creationTime = now;
modifier atStage(Stages _stage) {
if (stage != _stage) throw;
_
}
function nextStage() internal {
stage = Stages(uint(stage) + 1);
}
// Perform timed transitions. Be sure to mention
// this modifier first, otherwise the guards
// will not take the new stage into account.
modifier timedTransitions() {
if (stage == Stages.AcceptingBlindedBids &&
now >= creationTime + 10 days)
nextStage();
if (stage == Stages.RevealBids &&
now >= creationTime + 12 days)
nextStage();
// The other stages transition by transaction
}
// Order of the modifiers matters here!
function bid()
timedTransitions
atStage(Stages.AcceptingBlindedBids)
{
// We will not implement that here
}
function reveal()
timedTransitions
atStage(Stages.RevealBids)
{
}
// This modifier goes to the next stage
// after the function is done.
// If you use `return` in the function,
// `nextStage` will not be called
// automatically.
modifier transitionNext()
{
_
nextStage();
}
function g()
timedTransitions
atStage(Stages.AnotherStage)
transitionNext
{
// If you want to use `return` here,
// you have to call `nextStage()` manually.
}
function h()
timedTransitions
atStage(Stages.AreWeDoneYet)
transitionNext
{
}
function i()
timedTransitions
atStage(Stages.Finished)
{
}
}External Links
Related contracts
SimpleAuction
Same deployerThe Simple Open Auction from the Solidity documentation, opened for 1000 seconds with the deployer as beneficiary.
0xa46f38...626d7dDecember 27, 2015myKwh
Same deployerIdentical-runtime sibling. The ethereum.org 'advanced' MyToken (Homestead, Mar 2016): an issuer-minted token with mintToken, freezeAccount/FrozenFunds and the s
0x3cf9b4...9626c9February 10, 2016windKwh
Same deployerTwenty five indivisible units standing for kilowatt hours of wind generation.
0xcb9df5...7341e0February 14, 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, 2015basicInfoGetter
Same eraA tour of the EVM globals, carrying the constructor of the file it was copied from
0xad826c...d33547August 31, 2015Contract 0x3ea0db...b922e0
Same eraThe basic info getter from the solidity-baby-steps tutorials, a read only window onto the block and message globals.
0x3ea0db...b922e0August 31, 2015