Skip to content

Forced Ether Reception Breaking Balance Invariants

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

What goes wrong

Logic assumes address(this).balance equals tracked deposits, but selfdestruct or coinbase payments can force-send ETH, breaking strict-equality checks and bricking functions.

2

How to fix it

the pattern that is safe
require(totalDeposits <= address(this).balance); // tolerate forced ether
Never rely on exact native balance equality.
Check your own contract for this

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