remainingRewards Is Not Updated After closePot() Distribution, Causing Stale AccountingclosePot() uses remainingRewards to compute manager and claimant payouts, but it never updates remainingRewards after performing those transfers.
Because the state variable is left unchanged, getRemainingRewards() reports outdated values after closure and no longer reflects actual token balance in the pot. This creates accounting drift between state and reality, which can mislead monitoring, off-chain automation, and admin decision-making.
The issue occurs on every successful close where distribution executes, because the state variable is never synchronized post-transfer.
This is primarily a state-accounting correctness issue. It does not directly create a new public theft path by itself, but it degrades observability and lifecycle correctness.
The stale accounting is demonstrated by the following PoC test:
After closure, the contract balance is 36, while getRemainingRewards() still returns 60, proving the value is stale.
Run:
Output:
Finalize remainingRewards as part of closure so state matches post-settlement reality.
A practical approach is to calculate total distributed amount and subtract it from remainingRewards, or set it to zero if closure is intended to be terminal.
If closure should strictly finalize the pot, combine this with a one-time close guard and set remainingRewards to zero after handling residual dust by policy.
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.