ContestManager.fundContest() transfers totalRewards tokens into a Pot every time it is called. There is no isFunded flag, no balance check on the Pot, and no revert if the Pot already holds tokens. A second call deposits another totalRewards into the same Pot, giving it 2× the intended balance.
Pot.remainingRewards is set once at construction to totalRewards and decremented only when players claim. It never reads the contract's actual token balance. When closePot runs it distributes only up to remainingRewards — the extra tokens deposited by the second fundContest call are never distributed and cannot be recovered.
Likelihood: Low. Requires owner error (calling fundContest twice) or a UI bug that submits the transaction twice.
Impact: Any excess tokens above i_totalRewards are permanently locked. With standard ERC20 there is no emergencyWithdraw in either Pot or ContestManager to recover them.
The test calls fundContest(0) twice on the same Pot. The second call transfers another totalRewards into the Pot because there is no guard to prevent it. After both calls the Pot holds 2× totalRewards. When closeContest runs, it distributes only up to remainingRewards (set at construction to 1× totalRewards) — the extra 1× never moves. The final assertion confirms the excess is still locked in the Pot after close.
Add an isFunded flag to Pot and revert on a second fund:
Or check the Pot balance inside fundContest:
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.