An 89-byte contract with a public uint8 that any plain transfer increments, but only once: the guard permits the step only while the value is still zero.
Historical Significance
A one-shot latch rather than a counter, and a compact demonstration of storage packing: the uint8 is masked into the low byte of a full 32-byte slot, so the increment compiles into a read, a mask, an add and a write rather than a single store. That packing behaviour was one of the details early developers had to see in bytecode to believe.
Context
Deployed 2015-08-27 by 0xfd2605a2bf58fdbb90db1da55df61628b47f9e8c. One instance of this runtime is known. Source recovered by exact runtime bytecode match, verified on Sourcify and Etherscan.
Key Facts
Description
The contract holds a single public uint8 named a in storage slot 0, exposed by the automatic getter at selector 0x0dbe671f. Every call that is not that getter falls through to the fallback, which checks whether a is zero and increments it if so. Because the guard requires a == 0, the counter can only ever move from 0 to 1 and then stops. Nothing can reset it, and the contract holds no other state and accepts no arguments.
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 Counter {
uint8 public a;
function() {
if (a == 0) {
a++;
}
}
}External Links
Related contracts
Lottery
Same deployerThe first draft of the EarlyLottery commit-reveal lottery, deployed on 8 August 2015 a few hours before its rewrite.
0xf6bf0e...ec3b5cAugust 8, 2015EarlyLottery
Same deployerCommit-reveal lottery prototype deployed on 8 August 2015, the earlier draft of the EarlyLottery contract by the same developer.
0x7573ac...ad9fb4August 8, 2015Sha3
Same deployerA tiny utility contract that returns the SHA3 hash of a uint256 input.
0xb179a8...4bf09dAugust 9, 2015Sha3
Same deployerA tiny utility contract that returns the SHA3 hash of a uint256 input.
0x82000e...b0690aAugust 9, 2015Sha3
Same deployerA tiny utility contract that returns the SHA3 hash of a uint256 input.
0x627a6e...25bce8August 9, 2015LotteryPrototype
Same deployerThe first lottery contract deployed on Ethereum mainnet, created August 9, 2015 by one of the earliest recorded Ethereum users. Built, tested with two participa
0xcdd192...1b622cAugust 9, 2015