The value of the totalFees goes through unsafe casting from 'uint256' to 'uint64'.
In the selectWinner() function, 'fee' is unsafely casted from 'uint256' to 'uint64'. This makes it possible for the amount to be recorded to be lower than the actual amount expected.
For example.
If the value of fee is larger than 2 ** 64 - 1 then the unsafe cast will only keep the rightmost bits, which in turn will result in a value much smaller than defined in uint256 fee.
Loss of funds for the totalFees.
Manual Review.
totalFees should be stored as uint256.
Could also use the OpenZeppelin's SafeCast library, when casting from uint256 to uint64.
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.