1. Context
An edge case in the Risk Fund V2 contract related to the token sweeping mechanism was identified. Specifically, when the contract holds tokens that are not associated with any pool, the preSweepToken function may calculate pool-level token shares incorrectly.
This can cause the sweep operation to revert, creating a denial-of-service scenario for governance-initiated token sweeps. While no user funds are directly at risk, this issue affects the reliability of protocol maintenance actions.
2. Action Required
A targeted fix is proposed to update the per-pool calculation logic so that it uses the actual amount required from pooled funds rather than the total requested sweep amount. This adjustment prevents arithmetic underflow when untracked tokens are present.
The change is limited to a single line in the RiskFundV2.sol contract and does not modify external interfaces or user-facing behavior. If approved, this update would be executed via a VIP.
3. Summary
- An edge case in the Risk Fund sweep logic can cause governance sweep actions to revert
- The issue arises when untracked tokens exist in the contract balance
- The fix improves robustness without impacting users or fund safety
- Execution is subject to approval through a VIP
We welcome community feedback on this proposal ahead of formal governance submission.