Fees are calculated based on players.length, but when a refund is made the address in the array is changed to address 0 instead of popping the array and removing the refunded address. This way the length of the array is remaining the same , but there are less tokens in the contract because the one address was refunded.
When the winner is selected he may receive less funds , or the call can fail which will revert the function.
Furthermore there is a downcasting of the fee variable which may lead to a loss of funds, also totalFee may overflow!
Prizepool and fee calculation:
Downcasting:
High
Manual review
Keep track of refunded users , or pop the array when a refund is made.
Funds are locked to no one. If someone gets the refund issue, they also got this issue. IMPACT: High Likelihood: High
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.