Skip to content
high Logic / State No SWC entry CWE-837

Missing Claimed Flag — Double Claim

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

What goes wrong

A claim/withdraw/redeem does not record that the caller (or the id) has already claimed. The same entitlement is claimed repeatedly until the contract is drained.

2

The vulnerable pattern

proof of concept — how it is exploited
// claim() pays amount but never sets a flag.
// attacker calls claim() in a loop -> drains the distribution.
3

How to fix it

the pattern that is safe
require(!claimed[msg.sender], "already claimed");
claimed[msg.sender] = true;
_payout(msg.sender, amount);
Record and check a claimed flag before paying out.
Check your own contract for this

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