totalFees is a uint64 (max ≈ 18.45 ETH) and the contract uses Solidity 0.7.6, where arithmetic is unchecked — both the uint64(fee) cast and the + silently wrap instead of reverting.
Likelihood: Medium — it triggers in any raffle whose 20% fee exceeds ~18.45 ETH (e.g. 93+ players at a 1 ETH entrance fee).
Impact: Medium — the fee accounting is corrupted and withdrawFees() can never succeed afterwards, because it requires balance == totalFees. PoC: 100 players × 1 ETH → fee = 20 ETH, but uint64(20 ether) truncates to ≈ 1.55 ETH, so 20 ETH of protocol fees are permanently locked (balance 20 ETH vs totalFees 1.55 ETH).
The test enters 100 players at 1 ETH each, runs selectWinner(), and shows the fee was truncated by the uint64 cast and withdrawFees() reverts forever.
Use uint256 for totalFees (no gas benefit justifies uint64 here), and upgrade to Solidity ≥ 0.8, where arithmetic is checked by default.
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.