Skip to content

Latest commit

 

History

History
23 lines (21 loc) · 1.1 KB

Storage Layout.md

File metadata and controls

23 lines (21 loc) · 1.1 KB

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


Slide Screenshot

115.jpg


Slide Text

  • Storage Variables
  • Storage Slots
  • Multiple Vars
  • Compact -> Same Slot
  • State Var Order
  • Stored Contiguously
  • Exceptions: Dyn Arrays & Mappings

References


Tags

Storage, Stack Memory, Storage, and Flow Operations, Storage Packing, Storage Layout & Ordering, [Storage Layout & Inheritance], Storage Layout for Mappings & Dynamic Arrays