# Accrual ignores pause close expiry state

Time-based accrual that keeps running or stops early across pause, close, or expiry transitions

_Area: DeFi accounting and math bugs. Seen in 4 disclosed reports; latest 2024-09-03. Updated 2026-10-25._

## How it works
A time-based accumulator (interest index, penalty counter, reward rate, DSR) advances on a schedule, but the state machine around it (pause, close, expiry, shutdown) changes what users can do. The bug is a mismatch: accrual keeps running while users are blocked from acting, or settlement snapshots debt before pending accrual is charged. Either the accumulator ignores the transition, or the settlement path ignores pending accrual. The invariant that breaks: accrual and the ability to repay/settle must move together.

## Where it shows up
- Pause switches that gate repay/liquidation but not the interest index update [E3](https://bugbountylibrary.com/r/c4%3A2024-07-benddao%3AM-02.md)
- Shutdown/cage flows that freeze one contract's rate but leave another minter or dripper live [E1](https://bugbountylibrary.com/r/h1%3A672664.md)
- Close/settlement paths that compute debt from a current scaleFactor without checking pending time-based penalty state [E2](https://bugbountylibrary.com/r/c4%3A2023-10-wildcat%3AH-01.md)
- Queued withdrawal batches where repayment is only applied on expiry, not immediately [E4](https://bugbountylibrary.com/r/c4%3A2023-10-wildcat%3AM-09.md)
- `lastUpdateTimestamp` not reset or excluded across paused intervals [E3](https://bugbountylibrary.com/r/c4%3A2024-07-benddao%3AM-02.md)

## How to review
Enumerate every time-based accumulator and every state transition. For each transition, ask: does accrual stop, pause, or get charged at settlement? Check that (a) paused duration is excluded from accrual, or repay stays open during pause [E3](https://bugbountylibrary.com/r/c4%3A2024-07-benddao%3AM-02.md); (b) every contract that can mint or accrue value is frozen at shutdown, not just the main vault [E1](https://bugbountylibrary.com/r/h1%3A672664.md); (c) settlement/close charges all pending accrual before snapshotting debt [E2](https://bugbountylibrary.com/r/c4%3A2023-10-wildcat%3AH-01.md); (d) early repayment immediately reduces pending batch debt [E4](https://bugbountylibrary.com/r/c4%3A2023-10-wildcat%3AM-09.md). The property: no user can gain or lose value purely from the timing of a state transition relative to accrual.

## Variants seen
- Uncaged minter keeps accruing after rate freeze at shutdown [E1](https://bugbountylibrary.com/r/h1%3A672664.md)
- Close settles debt ignoring still-pending delinquency penalty, shifting cost to last lender [E2](https://bugbountylibrary.com/r/c4%3A2023-10-wildcat%3AH-01.md)
- Interest compounds through pause while repay is blocked, creating liquidation backlog [E3](https://bugbountylibrary.com/r/c4%3A2024-07-benddao%3AM-02.md)
- Early repayment not applied to pending withdrawal batch until expiry [E4](https://bugbountylibrary.com/r/c4%3A2023-10-wildcat%3AM-09.md)

## Impact and severity
Ranged from theft of all collateral via post-shutdown minting [E1](https://bugbountylibrary.com/r/h1%3A672664.md), to borrowers escaping half of penalty fees borne by the last lender [E2](https://bugbountylibrary.com/r/c4%3A2023-10-wildcat%3AH-01.md), to mass liquidation of borrowers who could not repay during pause [E3](https://bugbountylibrary.com/r/c4%3A2024-07-benddao%3AM-02.md), to borrowers overpaying interest on already-repaid debt [E4](https://bugbountylibrary.com/r/c4%3A2023-10-wildcat%3AM-09.md). Severity rises when the transition is attacker-triggerable and the mispriced value is large and withdrawable.

## Why fixes fail
Evidence does not show regressed fixes; the recurring failure is partial coverage — freezing one contract but not all minters [E1](https://bugbountylibrary.com/r/h1%3A672664.md), or fixing the settlement formula without checking pending accrual state [E2](https://bugbountylibrary.com/r/c4%3A2023-10-wildcat%3AH-01.md).

## Evidence
- E1: https://bugbountylibrary.com/r/h1%3A672664.md
- E2: https://bugbountylibrary.com/r/c4%3A2023-10-wildcat%3AH-01.md
- E3: https://bugbountylibrary.com/r/c4%3A2024-07-benddao%3AM-02.md
- E4: https://bugbountylibrary.com/r/c4%3A2023-10-wildcat%3AM-09.md
