The withdrawFees function is intended to allow the protocol fee recipient to withdraw accumulated raffle fees once active players have finished.
However, totalFees is typed as uint64 and incremented in Solidity 0.7.6 without overflow checks, causing it to silently overflow when accumulated fees exceed ~18.44 ETH. Furthermore, withdrawFees enforces a strict balance equality check require(address(this).balance == uint256(totalFees)). If totalFees overflows, or if any external ether is forcefully sent to the contract (e.g. via selfdestruct), the balance will never equal totalFees, permanently bricking fee withdrawals.
Likelihood:
Solidity 0.7.6 lacks built-in overflow protection, and anyone can send 1 wei of ETH via selfdestruct to break the strict balance check at any time.
Impact:
Medium. Protocol fees become permanently inaccessible and locked inside the contract forever, causing financial loss to the protocol fee address.
Accumulating fees beyond the 64-bit unsigned integer limit triggers silent overflow to zero, and any unexpected contract balance prevents fees from ever being withdrawn.
Upgrade Solidity to ^0.8.0, change totalFees to uint256, and avoid strict balance equality in withdrawFees by verifying the contract holds at least totalFees.
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.