Storage, memory and layout
Begin with “Solidity storage slots” and work toward “Storage layout challenge set”. Each available lesson includes a visual explanation and a quick knowledge check.
Read in order or choose a topic below. Completion marks stay in this browser. All 20 lessons in this track are available.
- 01
Solidity storage slots
See how persistent values fit into 32-byte slots.
8 MIN READ - 02
The 32-byte storage word
Storage reads and writes address full words.
4 MIN READ - 03
Pack adjacent value types
Compatible small fields can share one slot.
4 MIN READ - 04
Byte offsets and low-order alignment
Offset zero refers to the low-order end of a packed word.
4 MIN READ - 05
Struct storage layout
A struct starts a fresh slot and packs its own members.
4 MIN READ - 06
Fixed array storage layout
Small array elements can pack within their reserved region.
4 MIN READ - 07
Dynamic array base slots
The declared slot holds length while a hash-derived region holds elements.
4 MIN READ - 08
Mapping entry slot calculations
Hash the properly encoded key with the declared mapping slot.
4 MIN READ - 09
Nested mappings explained
Apply the mapping derivation once for each key layer.
4 MIN READ - 10
Mapping to a struct
A mapping hash selects the struct’s base slot.
4 MIN READ - 11
Short bytes and short strings in storage
Up to thirty-one bytes can share a slot with their length marker.
4 MIN READ - 12
Long bytes and strings in storage
Long content moves to a hash-derived data region.
4 MIN READ - 13
Inheritance and storage ordering
Inherited declarations participate in the final instance layout.
4 MIN READ - 14
Storage layout and proxies
Delegate execution makes layout compatibility part of correctness.
4 MIN READ - 15
Namespaced storage explained
Modules can derive separate roots for structured state.
4 MIN READ - 16
Memory expansion basics
Accessing farther memory can increase execution cost.
4 MIN READ - 17
The free memory pointer
Solidity stores its allocation pointer at memory address 0x40.
4 MIN READ - 18
Calldata versus memory copies
Read-only call input and writable working memory have different roles.
4 MIN READ - 19
Transient storage explained
Transaction-scoped state differs from both persistent storage and per-frame memory.
4 MIN READ - 20
Storage layout challenge set
Combine packing, derived slots and data-location boundaries.
4 MIN READ