Testing & Gas Optimization·Lesson 15 of 23·15 min
Storage Packing, Immutables, and Assembly Tricks
This lesson is for enrolled learners
The concept The EVM's storage is organized into 32-byte slots, and Solidity assigns state variables to slots in declaration order. If several adjacently declared variables are each smaller than 32 bytes and together fit within 32 bytes, the compiler packs them into a single slot instead of giving each its own — for example, a uint128, a uint64, and a……
Enroll to continue Already enrolled? Sign in