In ContestManager::createContest(), rewards[] and totalRewards are both provided by the protocol manager. However, there are no checks to ensure that these values reflect each other, which can lead to numerous issues with the actual contest.
Please view the following two functions:
There are no checks to ensure that totalRewards is actually the sum of all rewards.
This would be a fairly simple mistake to make when creating a new Pot, especially if the length of the players and rewards arrays are very long. If totalRewards is less than the sum of rewards[], then it would be a race to make claims because later claimants would run the risk of the Pot running out of funds. Additionally, if totalRewards is too small for any claimant to claim any rewards, 90% of funds will be stuck at the end of the contest.
PoC - paste this into TestMyCut.t.sol
This creates a contest in which totalSupply is 1, while player1 is due 3.
Manual review
Add a check to make sure that totalRewards is at least equal to the sum of rewards[] to avoid breaking the Pot's functionallity.
Alternatively, if there is no desired instance in which totalRewards is greater than the sum of rewards[], remove it as an argument and calculate it within the contract itself from rewards[].
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.