Skip to content

Locked Ether — Receives ETH With No Withdraw Path

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

What goes wrong

The contract can receive ETH (payable function, receive() or fallback()) but exposes no function that sends ETH out. Any Ether it accumulates is permanently trapped — no owner or user can ever recover it.

2

The vulnerable pattern

proof of concept — how it is exploited
// contract Vault { receive() external payable {} }  // no way out
// users send ETH; it is stuck forever — no withdraw / sweep function exists.
3

How to fix it

the pattern that is safe
function withdraw() external onlyOwner {
    (bool ok, ) = owner().call{value: address(this).balance}("");
    require(ok, "withdraw failed");
}
Every contract that receives ETH needs an explicit withdrawal path.
Check your own contract for this

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