Skip to content
high Governance No SWC entry CWE-682

Vote Double-Counting / Delegation Snapshot Bug

SAFE-0062 Governance Checked automatically by the scanner
1

What goes wrong

Flawed checkpoint/delegation logic lets the same tokens vote twice (e.g. transfer-then-vote, or delegate and self-vote), inflating effective voting power.

2

How to fix it

the pattern that is safe
require(!hasVoted[id][msg.sender], "voted"); hasVoted[id][msg.sender]=true;
tally += token.getPastVotes(msg.sender, snapshot);
Use ERC20Votes snapshots and per-proposal vote tracking.
3

Where this has happened

Largest recorded losses in the same failure class — related, not the same bug:

Check your own contract for this

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