In this track: Meet smart contracts
beginner · 3 MIN READ

What does contract state mean?

The values a contract currently remembers after accepted updates.

LET’S PICTURE IT

A game’s move history and its current board position are related, but they are not the same view.

SEE IT FOR YOURSELF
Pack small values into Solidity storage slotsStep 1 / 4
Pack small values into Solidity storage slotsFirstuint128 A16 bytesSeconduint128 B16 bytesThirduint256 C32 bytesSimple elementary types only; not a complete compiler layoutSlot 0 · 32 bytesUnused · 16 BA · 16 BHigh-order bytes ← → low-order bytesSlot 0 · fullB · 16 BA · 16 BDeclaration order and sizes determine this packingSlot 0BASlot 1C · 32 bytesTry different sequences in the storage-layout tool

In this simple default-layout example, two uint128 values come before one uint256. Each slot holds thirty-two bytes.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

History leads to a current result

Transactions form a history of requests and outcomes. Applying valid state transitions gives a current state. For a counter, the count is part of state; the transactions that led there explain its history.

State is more than a screen

A website might display cached or interpreted values. The contract’s storage follows protocol execution. Changing browser text does not alter that storage, and hiding a field does not make publicly readable network data secret.

Different locations serve different jobs

Storage persists, memory is working space during execution, and calldata carries call input. Confusing those locations can lead to incorrect reasoning about what survives after a function returns.

Execution can roll changes back

A reverted call discards the state changes within its reverted execution. That does not mean no computation occurred or no gas was consumed. Explore the storage and revert lessons to connect persistence with failure.

TURN UNDERSTANDING INTO PRACTICEOpen the Storage layout →
QUICK CHECK · NO PRESSURE

Which location is intended for persistent contract values?

Your progress stays in this browser.
Keep exploring the original referenceethereum.org ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.