Internal accounting (balances, shares) is written before the external token transfer is confirmed to succeed. If the transfer silently fails or returns false, the ledger and the real token balance diverge.
// balances[user] += amt; token.transferFrom(user, this, amt); // transferFrom returns false (fee token / paused) but isn't checked // -> user credited without paying.
bool ok = token.transferFrom(msg.sender, address(this), amount);
require(ok, "transfer failed");
balances[msg.sender] += amount; // only after confirmed
Largest recorded losses in the same failure class — related, not the same bug:
The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0211 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.