Skip to content

Upgradeable Storage Layout Corruption

SAFE-0034 Upgradeability Checked automatically by the scanner
1

What goes wrong

A new implementation reorders, removes, or inserts state variables relative to the prior one. After upgrade, existing storage maps to the wrong variables, silently corrupting balances and permissions.

2

How to fix it

the pattern that is safe
// Append-only; reserve gaps:
uint256[50] private __gap;   // in each upgradeable base contract
Use OpenZeppelin Upgrades layout validation.
Check your own contract for this

The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0034 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.

Run the scanner See how it is attacked Read the docs