closePot() to be called multiple times, repeatedly redistributing the contract's real token balance using a stale remainingRewards valueSeverity: High
Description:
closePot() computes managerCut and claimantCut from remainingRewards, but never updates or resets remainingRewards afterward, and has no flag or check preventing it from being called more than once:
Because remainingRewards is never decremented inside this function, every subsequent call to closePot() (once the 90-day window has passed) recomputes the same managerCut and claimantCut from the same stale value, and re-sends tokens to the owner and the same set of claimants again. This is not limited to a deliberately malicious owner — the contest README explicitly designates the Owner/Admin as a Trusted actor, so this finding does not rely on assuming bad intent. Rather, the absence of any "already closed" safeguard means this can be triggered by ordinary operational mistakes: a second admin unaware the pot was already closed, a duplicated/retried transaction, or simple human error — with the same damaging result regardless of intent.
Impact:
Repeated calls to closePot() continue transferring real tokens out of the Pot contract — to the manager and to the original claimants — until the contract's actual token balance is exhausted (at which point transfer calls begin reverting). This distributes far more of the pool than was ever intended to the manager and the first set of claimants, at the direct expense of the contract's remaining/reserved balance, and provides no protection against accidental or duplicate execution by an otherwise honest, trusted operator.
Proof of Concept:
Recommendation:
Add an explicit closed-state flag, set before any external calls (consistent with the checks-effects-interactions pattern already correctly used in claimCut()):
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.