createContest sets up a Pot where each player can claim rewards[i] out of a pool of totalRewards.
Nothing links these values. The sum of rewards can exceed totalRewards, the arrays can have different lengths, and players can be empty. A too-large sum makes remainingRewards -= reward underflow, so a player's claim reverts. A shorter rewards array makes the constructor revert. An empty players array makes closePot divide by zero.
Likelihood:
When the admin makes a data-entry mistake in the reward table, for example a typo in totalRewards or an off-by-one in the arrays. The contract accepts it silently, and players only find out when their claim reverts.
Impact:
Players whose reward does not fit into remainingRewards can never claim. Their reward stays in the Pot, and whether it gets redistributed depends on closePot.
An empty contest cannot be closed (/ i_players.length with 0), so any tokens sent to it are locked.
totalRewards = 50 while player1 is owed 65. The first claim reverts with an arithmetic underflow.
The test uses the setup of the existing test/TestMyCut.t.sol.
Check the "totalRewards" value, add error type "Pot__InvalidInput"
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.