Skip to content
medium Logic / State No SWC entry CWE-665

Storage vs Memory Misuse Causing State Bug

SAFE-0081 Logic / State Checked automatically by the scanner
1

What goes wrong

Declaring a complex type as memory when storage was intended (or vice versa) means updates don't persist (or unintended aliasing occurs), silently corrupting state.

2

How to fix it

the pattern that is safe
User storage u = users[id]; u.balance += 1;  // persists
Use the correct storage/memory location.
Check your own contract for this

The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0081 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