Skip to content

Glossary

Storage Slot

A 32-byte cell of a contract's persistent storage, addressed by a 256-bit key. Every contract has 2^256 slots; reading a non-zero slot costs gas.

Each EVM contract has its own keyed storage map: 2^256 slots, each holding 32 bytes. The Solidity compiler assigns state variables to slot indices at compile time; mappings hash the key into a slot; arrays compute slot offsets from a base.

Writing a fresh non-zero value to a zero slot costs 20,000 gas; overwriting a non-zero slot costs 5,000; clearing a slot back to zero gives a refund. Understanding the slot layout is essential when writing assembly, designing upgradeable proxies, or auditing storage collisions.