Inside the 'selectwinner' function there is a bug in the fee calculation.
We are using uint64 but we should be using uint256.
Using uint64 in the 'totalFees = totalFees + uint64(fee)' calculation could result in a overflow bug when the fees are greater than 18.4 ETH.
The fee calculation will overflow when the collected fee is greater then 18.4 ETH.
Which will result in the fees being calculated in a wrong way causing the fees to be less then they should be.
Vs Code
Foundry
Always use uint256 for these kind of values.
In this case it will need a fee greater than 18.4 ETH to overflow but if the raffle gains good traction this is certainly possible so it should be avoided.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.