After closePot() distributes the manager cut and claimant bonuses, remainingRewards is never set to 0. The state variable retains its pre-close value even though tokens have been transferred out.
While closePot is onlyOwner and unlikely to be called twice, the stale remainingRewards value is exposed via the public getRemainingRewards() getter, providing incorrect information to any external system querying the Pot's state.
Likelihood:
Every call to closePot() leaves remainingRewards at a stale non-zero value.
Impact:
getRemainingRewards() returns an incorrect value after pot closure.
ContestManager.getContestRemainingRewards() reports wrong data to frontends/integrators.
No direct fund loss, but misleading state could cause incorrect decisions by off-chain systems.
The following test shows that after closePot() distributes tokens, the getRemainingRewards() getter still returns the pre-close value instead of 0, providing incorrect data to any external system or frontend querying the Pot's state.
Add remainingRewards = 0 at the end of the closePot() function after all distributions are complete. This ensures the public getter returns an accurate value and prevents any downstream logic from using stale accounting data.
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.