withdrawFees() requires the contract balance to be exactly equal to totalFees. But ETH can be forced into the contract without a receive() function (e.g. via selfdestruct from another contract). A single wei of forced ETH makes the check fail forever, and there is no way to remove it — no sweep function exists.
Likelihood: Low — it requires a deliberate griefer to force ETH into the contract.
Impact: Low — a griefer can permanently lock all protocol fees (the 20% cut) for 1 wei. No player funds are at risk, but the protocol's revenue is bricked.
The test runs a normal raffle (fees accrue to 0.8 ETH), forces 1 wei in via selfdestruct, and shows withdrawFees() reverts forever afterwards.
Use >= instead of ==, or track fees in a way that does not depend on the exact contract balance.
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.