Affected: ConfidencePool.sweepUnclaimedBonus at src/ConfidencePool.sol:474
sweepUnclaimedBonus decrements totalBonus but only emits BonusSwept with the swept amount, not the new total. Off-chain indexers tracking totalBonus must recompute it from prior events.
sweepUnclaimedBonus at lines 499-501 decrements totalBonus when the bonus is unreserved:
The function emits BonusSwept(msg.sender, recoveryAddress, amount) at line 508. This event includes the swept amount but NOT the new totalBonus value. totalBonus is also increased by contributeBonus, which emits BonusContributed with the contributed amount, not the new total. An indexer tracking totalBonus must maintain running state across all BonusContributed and BonusSwept events, which is fragile across reorgs and missed events.
Compare: totalEligibleStake changes are accompanied by events that allow reconstruction (Staked, Withdrawn, ClaimSurvived, ClaimExpired each include the user's stake amount). totalBonus lacks equivalent coverage.
ConfidencePool.sol is in contest scope. sweepUnclaimedBonus is in the deployed bytecode. No out-of-scope dependency required.
CodeHawks Low: off-chain observability gap. No fund loss. On-chain state is always correct and queryable.
No prior audit reports flag missing events on totalBonus decrement in sweepUnclaimedBonus. The BonusSwept event exists but does not include the new total.
Every bonus sweep when riskWindowStart == 0 or totalEligibleStake == 0 triggers this. No external preconditions beyond normal pool operation.
Off-chain monitoring tools may display incorrect totalBonus values after sweeps. No direct fund loss. Degrades auditability of bonus pool accounting.
Emit TotalBonusUpdated(newTotalBonus) before the sweep transfer:
Alternatively, extend the BonusSwept event to include newTotalBonus as a parameter.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.