115 - Storage Layout
State variables of contracts are stored in storage in a compact way such that multiple values sometimes use the same storage slot.
Except for dynamically-sized arrays and mappings, data is stored contiguously item after item starting with the first state variable, which is stored in slot 0
- Storage Variables
- Storage Slots
- Multiple Vars
- Compact -> Same Slot
- State Var Order
- Stored Contiguously
- Exceptions: Dyn Arrays & Mappings
Storage, Stack Memory, Storage, and Flow Operations, Storage Packing, Storage Layout & Ordering, [Storage Layout & Inheritance], Storage Layout for Mappings & Dynamic Arrays