withdrawFees() only pays out when the contract's ETH balance exactly equals the recorded totalFees, intended as a guard that no raffle is mid-flight.
ETH can be force-sent to any contract (e.g. selfdestruct, or a pre-computed address funded before deployment), bypassing receive/fallback. A single wei of forced ETH makes address(this).balance permanently exceed totalFees, so the strict-equality check never holds again and all fees are locked.
Likelihood:
Occurs whenever any party force-feeds ETH to the contract — a low-cost, permissionless action (1 wei plus a self-destructing helper).
Impact:
All accumulated protocol fees become permanently unwithdrawable, with no rescue path.
The test below runs a normal round so totalFees is set and the balance equals it, then force-sends 1 wei via a self-destructing contract. After that, address(this).balance permanently exceeds totalFees, so withdrawFees() reverts on its strict-equality check and the fees are locked.
Do not tie withdrawal to exact contract balance; track fees with internal accounting and withdraw that amount, or use >=.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.