# Unsatisfiable branch blocks legitimate action

Guard or require that can never pass on a reachable path, reverting the only exit

_Area: Smart contract access control and control flow. Seen in 4 disclosed reports; latest 2025-06-05. Updated 2026-10-23._

## How it works
A guard, minimum, or assertion encodes an assumption that holds in normal operation but not on every reachable path. When a state transition (shutdown, oversold, below-margin, refund) makes the condition impossible to satisfy, the code reverts on the only path that would let the user or keeper proceed. The check is not wrong in isolation; it is wrong because the protocol can reach a state where it can never be true, and nothing else provides an exit.

## Where it shows up
- A `require`/`assert` on a variable that is only assigned inside one branch (e.g. `left > 0` set only when oversold) [E2](https://bugbountylibrary.com/r/sherlock%3A2024-03-zap-protocol%3AH-2.md)
- A no-op or "settle" call that still runs health/margin invariants, so it reverts for accounts near the threshold [E1](https://bugbountylibrary.com/r/sherlock%3A2024-02-perennial-v2-3%3AM-8.md)
- A minimum-per-contribution check applied after a refund, where the refunded amount can fall below the minimum [E3](https://bugbountylibrary.com/r/c4%3A2023-10-party%3AM-06.md)
- A guard enforcing an accounting invariant ("more than one trove") that a pause/shutdown/freeze can violate, trapping the last user [E4](https://bugbountylibrary.com/r/cantina%3Aliquity_april2025%3A3.1.1.md)
- Exit, claim, close, or finalize functions whose only precondition is unreachable in some protocol state

## How to review
For each guard, enumerate the reachable states and ask whether the condition can be false there. The invariant to hold: every legitimate exit/claim/finalize path must have at least one reachable state in which its preconditions are satisfiable, and no protocol transition may make them permanently unsatisfiable. Trace where each checked variable is assigned; if it is populated only on one branch, the check silently disables the other path [E2](https://bugbountylibrary.com/r/sherlock%3A2024-03-zap-protocol%3AH-2.md). For keeper/settle calls, confirm invariants are skipped or relaxed for zero-effect updates [E1](https://bugbountylibrary.com/r/sherlock%3A2024-02-perennial-v2-3%3AM-8.md). For minimums applied after refunds, test `min > max - minTotal` [E3](https://bugbountylibrary.com/r/c4%3A2023-10-party%3AM-06.md). For accounting guards, test exit under shutdown/pause [E4](https://bugbountylibrary.com/r/cantina%3Aliquity_april2025%3A3.1.1.md).

## Variants seen
- Settle-as-no-op reverts on below-margin accounts, DoSing keepers and vaults [E1](https://bugbountylibrary.com/r/sherlock%3A2024-02-perennial-v2-3%3AM-8.md)
- Refund/claim gated on a variable only set in the oversold branch [E2](https://bugbountylibrary.com/r/sherlock%3A2024-03-zap-protocol%3AH-2.md)
- Min-contribution check after refund makes cap unreachable [E3](https://bugbountylibrary.com/r/c4%3A2023-10-party%3AM-06.md)
- Last-user exit blocked by an accounting invariant broken by shutdown [E4](https://bugbountylibrary.com/r/cantina%3Aliquity_april2025%3A3.1.1.md)

## Impact and severity
Led to DoS of oracle settlement and vault functions [E1](https://bugbountylibrary.com/r/sherlock%3A2024-02-perennial-v2-3%3AM-8.md), disabled tax-refund claims [E2](https://bugbountylibrary.com/r/sherlock%3A2024-03-zap-protocol%3AH-2.md), permanently blocked crowdfund finalization [E3](https://bugbountylibrary.com/r/c4%3A2023-10-party%3AM-06.md), and trapped the last trove owner's collateral forever [E4](https://bugbountylibrary.com/r/cantina%3Aliquity_april2025%3A3.1.1.md). Severity rises when the blocked path is the only exit or a keeper loop, and when funds are locked rather than merely delayed.

## Evidence
- E1: https://bugbountylibrary.com/r/sherlock%3A2024-02-perennial-v2-3%3AM-8.md
- E2: https://bugbountylibrary.com/r/sherlock%3A2024-03-zap-protocol%3AH-2.md
- E3: https://bugbountylibrary.com/r/c4%3A2023-10-party%3AM-06.md
- E4: https://bugbountylibrary.com/r/cantina%3Aliquity_april2025%3A3.1.1.md
