closePot should run once: distribute the leftover pool after 90 days and leave the Pot closed.
The function has no "closed" flag and does not reset remainingRewards after distributing. Every later call recomputes managerCut and claimantCut from the same value and pays them again for as long as the Pot's balance allows. getRemainingRewards() keeps reporting a pool that has already been paid out.
Likelihood:
When the admin calls closeContest a second time for the same Pot, for example as a retry after an RPC timeout or through an off-chain script that closes all expired contests on a schedule. Nothing on-chain says the Pot is already closed, and the second call succeeds.
Impact:
The manager receives the 10% cut several times, which is more than the protocol defines. Combined with H-02, every extra cut is also locked in ContestManager.
Players whose playersToRewards is still non-zero (see M-01) find the Pot drained. getRemainingRewards() / getContestRemainingRewards() report wrong data after closing.
There are 4 players with 25 each, and only player1 claims (remainingRewards = 75). Each close pays 7 + 17 tokens. Three calls drain the Pot from 75 to 3 while remainingRewards stays 75.
The test uses the setup of the existing test/TestMyCut.t.sol.
Add bool flag "closed" and error type "Pot__AlreadyClosed" to the Pot.sol
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.