Root Cause: Missing closed state validation in fundContest()
Impact: Closed pots can be re-funded, inflating balance and breaking accounting invariants
When a pot is closed via closePot(), it has completed its lifecycle and distributed all rewards to claimants and the manager.
The fundContest() function does not verify whether a pot has already been closed before transferring funds to it, allowing additional tokens to be sent to pots that should be immutable.
Likelihood:
The owner can call fundContest() at any time without restriction, including after closePot() has executed.
There is no on-chain enforcement preventing multiple calls to fundContest() for the same pot index.
Administrative errors or misunderstanding of pot state could lead to accidental re-funding.
Impact:
Closed pots receive additional funds that were not part of the original contest design, breaking the immutability assumption.
The pot's token balance becomes inflated beyond remainingRewards, creating accounting discrepancies (e.g., pot balance 1,900 but remainingRewards still 1,000).
Additional funds sent to closed pots have no mechanism to be claimed or distributed, as closePot() has already executed and cannot be called again.
Players may still have unclaimed checkCut() amounts that could now be claimed against the newly injected funds, despite the pot being closed.
The following scenario demonstrates a closed pot being re-funded:
A pot is created with 1,000 tokens total rewards
After 90 days, closeContest() is called, which triggers closePot()
closePot() distributes 100 tokens to ContestManager (manager cut), leaving 900 tokens in the pot
The owner then calls fundContest(0) on the already-closed pot
An additional 1,000 tokens are transferred to the pot
The pot now holds 1,900 tokens but remainingRewards is still 1,000, creating a 900 token discrepancy that breaks protocol invariants.
Add a closed state flag to the Pot contract and validate it in fundContest():
In Pot.sol:
In ContestManager.sol:
Additionally, consider tracking whether a pot has already been funded to prevent double-funding before closure.
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.