$megatools --storage-packer --client-side
Solidity Storage Layout & Gas Packing Optimizer
Visualize EVM 32-byte storage slots, simulate struct and variable packing, eliminate wasted padding bytes, and optimize SSTORE gas costs with 1-click bin-packing.
⚡ Load Preset:
Storage Slots
7slots (224 bytes)
9 state variables mappedPacking Efficiency
64%density
144B data / 80B paddingWasted Space
80bytes (36%)
Lost to unoptimized packingPotential Gas Savings
-2slots saved
~44,200 gas on first SSTORE📐 EVM Storage Memory Layout (32 Bytes per Slot)
Solidity stores values starting at offset 0 up to 31. When a variable exceeds the remaining bytes in a slot, EVM spills it to byte 0 of the next slot.
Packed Variable Wasted Padding Space
Slot 020 / 32 bytes used12B padding wasted
owner (20B)
0●
1●
2●
3●
4●
5●
6●
7●
8●
9●
10●
11●
12●
13●
14●
15●
16●
17●
18●
19●
20∅
21∅
22∅
23∅
24∅
25∅
26∅
27∅
28∅
29∅
30∅
31∅
Byte 0 (LSB / Start)Byte 31 (MSB / End)
Slot 132 / 32 bytes used
totalStaked (32B)
0●
1●
2●
3●
4●
5●
6●
7●
8●
9●
10●
11●
12●
13●
14●
15●
16●
17●
18●
19●
20●
21●
22●
23●
24●
25●
26●
27●
28●
29●
30●
31●
Byte 0 (LSB / Start)Byte 31 (MSB / End)
Slot 21 / 32 bytes used31B padding wasted
isPaused (1B)
0●
1∅
2∅
3∅
4∅
5∅
6∅
7∅
8∅
9∅
10∅
11∅
12∅
13∅
14∅
15∅
16∅
17∅
18∅
19∅
20∅
21∅
22∅
23∅
24∅
25∅
26∅
27∅
28∅
29∅
30∅
31∅
Byte 0 (LSB / Start)Byte 31 (MSB / End)
Slot 332 / 32 bytes used
rewardRate (32B)
0●
1●
2●
3●
4●
5●
6●
7●
8●
9●
10●
11●
12●
13●
14●
15●
16●
17●
18●
19●
20●
21●
22●
23●
24●
25●
26●
27●
28●
29●
30●
31●
Byte 0 (LSB / Start)Byte 31 (MSB / End)
Slot 44 / 32 bytes used28B padding wasted
lockPeriod (4B)
0●
1●
2●
3●
4∅
5∅
6∅
7∅
8∅
9∅
10∅
11∅
12∅
13∅
14∅
15∅
16∅
17∅
18∅
19∅
20∅
21∅
22∅
23∅
24∅
25∅
26∅
27∅
28∅
29∅
30∅
31∅
Byte 0 (LSB / Start)Byte 31 (MSB / End)
Slot 532 / 32 bytes used
maxStakers (32B)
0●
1●
2●
3●
4●
5●
6●
7●
8●
9●
10●
11●
12●
13●
14●
15●
16●
17●
18●
19●
20●
21●
22●
23●
24●
25●
26●
27●
28●
29●
30●
31●
Byte 0 (LSB / Start)Byte 31 (MSB / End)
Slot 623 / 32 bytes used9B padding wasted
feeCollector (20B)earlyWithdrawalFeeBps (2B)allowEmergencyUnstake (1B)
0●
1●
2●
3●
4●
5●
6●
7●
8●
9●
10●
11●
12●
13●
14●
15●
16●
17●
18●
19●
20●
21●
22●
23∅
24∅
25∅
26∅
27∅
28∅
29∅
30∅
31∅
Byte 0 (LSB / Start)Byte 31 (MSB / End)