Skip to main content
A protocol has a paused mode in which a recorded balance may only stay constant or decrease. This template enforces that specific state transition.

Behavior

EmergencyStateAssertion reads the pre-transaction paused flag from slot 0. If it is false, the check returns. Otherwise, it requires the post-transaction value in balance slot 1 to be no greater than its pre-transaction value.

Configuration

Replace both slots and confirm that the direction matches the intended emergency operation. Use a liability counter if the goal is to stop new obligations; do not substitute an asset balance without checking recovery behavior.

Scenarios

Coverage limits

The template does not block withdrawals, prove recovery availability, or measure an ERC-20 balance. Applied to custody, it can permit draining and reject recapitalization. Treat it as a specific stored-counter rule, not a general panic-mode policy.

Source

The reviewed source is a teaching template. The example setup guide provides the pinned checkout and test procedure.