# Missing delay or reset check blocks close

Close/liquidation gated by a delay that a sibling mutator skips or a dust call resets

_Area: DeFi accounting and math bugs. Seen in 2 disclosed reports; latest 2024-09-16. Updated 2026-10-29._

## How it works
A cooldown or time-lock is meant to stop an actor from changing position state right before a close, liquidation, or settlement. The gate only holds if every state-changing entry point enforces it and if the delay counter cannot be cheaply reset. When one mutating path skips the check, or a dust-sized call restarts the timer, the protected action is blocked or the actor escapes the loss it should bear.

## Where it shows up
- A close/liquidation/settlement path that calls a delay check, while sibling mutators (stop-loss update, debt burn, lock merge) do not.
- Any function that resets a per-account delay or timestamp, especially one callable with a tiny amount (1 wei) [E1](https://bugbountylibrary.com/r/c4%3A2022-12-tigris%3AH-02.md).
- Lock/merge logic that extends or reactivates an expired position without rejecting expiry [E2](https://bugbountylibrary.com/r/cantina%3Azerolend_jan2024%3A3.2.15.md).
- Proportional-loss distribution (redemption, settlement) that snapshots a weight the participant can shrink in the same block [E3](https://bugbountylibrary.com/r/cantina%3Aalchemix_may2025%3A3.2.21.md).

## How to review
Two properties must hold. First, for every action gated by a delay, all state mutations that affect that action's outcome must enforce the same delay, and the delay counter must not be resettable by a call smaller than the protected action's value. Check each mutator against the gate list; a missing check on a sibling mutator is as serious as a cheap reset [E1](https://bugbountylibrary.com/r/c4%3A2022-12-tigris%3AH-02.md). Second, for locks, confirm expired positions are rejected before merge, and that reward checkpoints never divide by zero supply across the gap [E2](https://bugbountylibrary.com/r/cantina%3Azerolend_jan2024%3A3.2.15.md). For proportional settlement, confirm a participant cannot change their weight within the snapshot block (burn/re-mint, add/remove) [E3](https://bugbountylibrary.com/r/cantina%3Aalchemix_may2025%3A3.2.21.md).

## Variants seen
- Stop-loss update skips the delay check; a 1-wei addToPosition resets the timer, blocking limitClose and liquidation indefinitely [E1](https://bugbountylibrary.com/r/c4%3A2022-12-tigris%3AH-02.md).
- Merging an expired lock reactivates it across a zero-supply gap, reverting reward claims [E2](https://bugbountylibrary.com/r/cantina%3Azerolend_jan2024%3A3.2.15.md).
- No time-lock on debt burn lets a borrower burn then re-mint in one block to dodge redemption losses [E3](https://bugbountylibrary.com/r/cantina%3Aalchemix_may2025%3A3.2.21.md).

## Why fixes fail
Gating only the close path leaves sibling mutators open [E1](https://bugbountylibrary.com/r/c4%3A2022-12-tigris%3AH-02.md); taking max of end times without an expiry check still reactivates expired locks [E2](https://bugbountylibrary.com/r/cantina%3Azerolend_jan2024%3A3.2.15.md).

## Impact and severity
Riskless trades and blocked liquidation [E1](https://bugbountylibrary.com/r/c4%3A2022-12-tigris%3AH-02.md); locked or unclaimable rewards [E2](https://bugbountylibrary.com/r/cantina%3Azerolend_jan2024%3A3.2.15.md); evasion of proportional collateral reduction, shifting losses to others [E3](https://bugbountylibrary.com/r/cantina%3Aalchemix_may2025%3A3.2.21.md). Severity rises when the bypass is cheap (dust) and repeatable, and when it blocks liquidation or settlement entirely.

## Evidence
- E1: https://bugbountylibrary.com/r/c4%3A2022-12-tigris%3AH-02.md
- E2: https://bugbountylibrary.com/r/cantina%3Azerolend_jan2024%3A3.2.15.md
- E3: https://bugbountylibrary.com/r/cantina%3Aalchemix_may2025%3A3.2.21.md
