There is a chance where the totalAmountCollected
might be computed grater than the contract balance.
In function selectWinner at line 131
uint256 totalAmountCollected = players.length * entranceFee;
if the array length is not reduced in refund function after deleting the address of the player.
As the totalAmountCollected is calculated is based on the number of players. When some player already claimed refund and the number of the player is not reduced the totalAmountCollected will be higher than the contract balance, hence results in a denial of service.
Foundry
Git
Manual review
Reduce the array size after deleting the player in the refund function.
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.