When a Pot contract is created, the amount of rewards each player should receive and total rewards are recorded in the contract. However, these are two separate variables updated independently. Misconfiguration will result in at least one player to not be able to claim the reward from the Pot contract after it is funded.
The vulnerability lies in the constructor function of the Pot contract, specifically in line 27 and line 33 of the contract.
The playersToRewards mapping and remainingRewards variable is updated separately and there are no checks done to ensure that sum of rewards received by players is equivalent to the expected total rewards. This would lead to a potential arithmetic underflow revert at line 44 when a player tries to call claimCut.
The result of this vulnerability would lead to at least one player not being able to claim the expected reward from the Pot contract after it is funded.
Foundry, manual review
To mitigate this vulnerability, the sum of the rewards array should be calculated and verified to be equivalent to totalRewards in the constructor 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.