Skip to content

Out-of-Gas in Loop Causing Stuck Funds

SAFE-0080 Denial of Service Checked automatically by the scanner
1

What goes wrong

A withdrawal/settlement loop grows with participation; past a threshold the only function that releases funds runs out of gas, permanently locking user balances.

2

How to fix it

the pattern that is safe
function withdrawMine() external nonReentrant {
    uint a = owed[msg.sender]; owed[msg.sender]=0; _send(msg.sender,a);
}
Ensure a per-user pull path exists.
Check your own contract for this

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