An emergency pause is the fastest control a protocol has during an exploit, and a badly designed one becomes either a switch nobody can reach in time or a single key that can freeze user funds at will. Smart contracts cannot be patched in place, and upgrades through governance or timelocks take hours or days, so most serious protocols add a way to stop sensitive functions while a fix is prepared. This guide covers how to design pauser roles and key custody, automated circuit breakers and rate limits, how much a pause should stop, safe recovery and unpause paths, and the governance that keeps emergency power accountable. It is for smart contract developers and protocol security leads. It builds on the Smart Contract Security Guide and contains no exploit code.
Key takeaways
- Pause power should be narrow. A pauser should be able to stop things and nothing else: no upgrades, no withdrawals, no parameter changes, which is what justifies letting it act without a timelock.
- Unpausing is a normal change, not an emergency. Resuming should go through full verification and, ideally, a different and higher approval than pausing.
- Circuit breakers buy time automatically. On-chain limits on outflows per period stop the bleeding in the minutes before humans can sign anything.
- Scope the pause to the risk. Stopping deposits, borrows and outflows while leaving repayments and exits open usually protects users better than freezing everything.
- An untested pause is a guess. Rehearse the full path, from alert to executed transaction on chain, on a schedule and after every deployment.
Why emergency controls matter
Ethereum.org's smart contract security documentation describes an emergency stop as a way to block calls to vulnerable functions, and notes that upgrades often need approval from several parties and take time to implement, which gives attackers more time. The emergency stop is the stopgap. The same page warns that an emergency stop increases the need for users to trust developers, and suggests decentralising the trigger through on-chain voting, a timelock or multisig approval.
That tension drives every design decision on this page: a pause must be fast enough to matter during an active exploit and constrained enough that it cannot be abused, or seized by an attacker, to harm users. The Security Alliance (SEAL) Multisig for Protocols framework puts the principle simply: bypass paths should do the minimum necessary and nothing more.
| Mechanism | Trigger | Speed | Main risk |
|---|---|---|---|
| Manual pause (role or multisig) | Human decision after an alert | Minutes to hours, bounded by signer availability | Too slow if signers cannot be reached; abuse if the key is weak |
| Automated circuit breaker | On-chain metric crosses a threshold (outflow per period, price deviation) | Same block | False positives that block legitimate users; thresholds an attacker can stay under |
| Monitoring bot with pause rights | Off-chain detection submits a pause transaction | Seconds to minutes | Bot key becomes a hot key; detection logic errors |
| Guardian cancel on a timelock | Malicious or mistaken queued action | Any time inside the delay | Only stops queued governance actions, not live exploits |
Pauser roles and key custody
The OpenZeppelin Contracts Pausable module is the most common building block. It provides the whenNotPaused and whenPaused modifiers and internal _pause() and _unpause() functions that emit Paused and Unpaused events. Its source notes that a contract is not pausable by inheriting the module alone, only once the modifiers are applied, and the ERC20Pausable extension warns that the developer must define public pause and unpause functions with appropriate access control or the mechanism is unreachable. In other words, the library leaves role design to you.
| Role | Can do | Must not do | Typical holder | Delay |
|---|---|---|---|---|
| Pauser | Call pause() or targeted stop functions | Unpause, upgrade, move funds, change parameters | Low-threshold emergency multisig, and optionally a monitoring bot | None |
| Unpauser | Call unpause() after verification | Pause-only shortcuts; upgrades | Main operations multisig or governance | Short delay or full governance, by risk |
| Guardian or canceller | Cancel queued timelock operations | Propose or execute changes | Security council multisig | None |
| Parameter admin | Change circuit breaker thresholds within bounds | Disable breakers entirely; pause | Operations multisig behind a timelock | Timelocked |
| Upgrader | Change implementation | Pause or unpause directly | Governance through a timelock | Timelocked |
Use role-based access control rather than a single owner so each power above maps to its own role. OpenZeppelin AccessManager supports this centrally: its documentation describes closing or opening a target with setTargetClosed while keeping permissions intact, and assigning a guardian role per role that is allowed to cancel operations. The Smart Contract Access Control Guide covers role design in depth.
Multisig custody
SEAL's use case requirements give a lower threshold, for example 2 of 4, as an illustration for an emergency pause multisig, provided it is constrained to pause-only actions, and state that no single multisig should hold both pause and upgrade capabilities unless the upgrade path is gated by a timelock. Treat 2 of 4 as an example, not a rule; size the threshold to the blast radius.
- Availability over size: SEAL asks that a threshold number of signers be available around the clock, with geographic distribution and backup signers. A 2 of 4 multisig with four signers in one time zone is weaker in practice than it looks.
- Hardware keys only: every pauser signer uses a hardware wallet and verifies the transaction hash on the device.
- Bot keys are non-human identities: if a monitoring service holds a pauser role, store its key in an HSM or managed signer, give it pause-only rights, and alert on every use. See Multisig Treasury Operations Guide for Protocols and Companies for signer selection and rotation.
Circuit breakers and rate limits
A circuit breaker is an automatic, on-chain pause or throttle that trips when a metric crosses a threshold. Ethereum.org gives the off-chain version of the idea, an alert when the amount withdrawn in one transaction crosses a threshold. On-chain breakers act in the same block without waiting for anyone.
- Outflow limits: cap the value that can leave a vault, bridge or pool per rolling period, per asset. ERC-7265, proposed in July 2023 as a circuit breaker standard, registers assets with a metric threshold and a minimum amount to limit, and lets developers choose either to delay settlement, holding outflows during a cooldown period, or to revert them. Treat it as a proposal and check its current status before relying on its interface.
- Price and oracle deviation: halt borrowing or liquidations when an oracle price moves beyond a band or diverges from a second source; see the Oracle Manipulation and Flash Loan Attacks Guide.
- Per-transaction and per-account caps: bound mints, withdrawals and bridge messages so a single call cannot empty a contract.
- Dependency change triggers: pause integrations when a critical external contract changes implementation or admin.
| Design choice | Option A | Option B | Choose A when |
|---|---|---|---|
| On breach | Revert the outflow | Delay settlement and hold funds for a cooldown | Users can easily retry; B when you need funds held for review without blocking all users |
| Threshold basis | Absolute amount per period | Percentage of total value locked | Value locked is small or volatile; B scales with growth |
| Reset | Automatic after the period | Manual reset by an admin | False positives are common; B for high-value vaults |
Set thresholds from historical outflow data, with headroom for legitimate peaks, and expect attackers to stay just under a known limit. Breakers reduce loss; they do not replace a manual pause.
Scope of a pause
A global pause is simple and easy to audit, but it can trap users and break integrations that depend on your contracts. Granular pauses cost more code and more tests, but let you stop the dangerous path while leaving safe paths open. SEAL's example runbook illustrates the split, with one contract using pause() to stop all operations and another using an emergency stop that halts withdrawals only.
| Function class | Pause during an exploit? | Reason |
|---|---|---|
| Deposits, mints, new borrows | Usually yes | Prevents new funds entering a compromised system |
| Withdrawals and bridge outflows | Often yes, or rate limited | The usual path for draining funds |
| Repayments and adding collateral | Usually no | Lets users reduce risk; blocking them can cause unfair liquidations |
| Liquidations | Case by case | Pausing protects borrowers from manipulated prices but lets bad debt grow |
| Recovery functions | Enabled only while paused | Ethereum.org's example allows an emergency withdrawal only when stopped |
Document the pause map for every contract and test that each guarded function really checks the right flag. A missing modifier on one entry point is the most common way a pause fails silently. For token contracts, remember that pausing transfers also stops users moving tokens to safety, and decide that trade-off before deployment.
Recovery and unpause paths
SEAL's emergency pause runbook ends with three steps: fix the underlying issue and test the fix thoroughly, plan the unpause, and execute the unpause with full verification rather than the emergency process. Build that asymmetry into the contracts, so pausing is fast and resuming is deliberate.
- Confirm the pause held: check contract state on chain and watch for calls still succeeding through unguarded paths. SEAL's runbook asks for confirmation within 1 hour and root cause analysis within 24 hours.
- Contain further: revoke compromised roles, rotate keys and cancel any queued timelock actions through the guardian.
- Fix and review: prepare the fix, have it independently reviewed and run it against a fork of mainnet state.
- Stage the unpause: resume the lowest-risk functions first (repayments, withdrawals with limits), then deposits and borrows.
- Roll back if needed: keep the ability to re-pause instantly during the staged resume, and agree beforehand what signal triggers it.
Timelock trade-offs
OpenZeppelin's TimelockController separates PROPOSER_ROLE, EXECUTOR_ROLE and CANCELLER_ROLE and enforces a minimum delay; its documentation advises that the optional admin be renounced after setup in favour of timelocked administration. A timelock gives users time to exit before a change lands, but it also delays your own fixes.
- Keep the pause outside the timelock: SEAL describes emergency pause as direct execution without a timelock, reserved for actions highly constrained in scope.
- Put the unpause and upgrades behind it: where an urgent fix must skip the delay, SEAL suggests a veto or bypass quorum of the standard quorum plus two additional signers.
- Bound the pause in time: consider a maximum pause duration after which governance must explicitly extend it, so a lost or captured pauser key cannot freeze funds indefinitely.
Upgrade mechanics are covered in the Smart Contract Upgradeability and Proxy Security Guide.
Governance and transparency
Emergency power is only legitimate if users can see who holds it and how it is used.
- Publish the role map: list each role, the address that holds it, the threshold, what it can stop and any time limit, as SEAL's registration and documentation guidance expects for multisigs.
- Emit and monitor events:
Paused,Unpaused, role grants and threshold changes should all raise alerts; see the Blockchain Analytics and On-Chain Monitoring Guide. - Report every use: after any pause, publish what happened, why the pause was used and when it was lifted.
- Drill on a schedule: SEAL recommends quarterly communication system tests, paging tests twice a year and an annual full emergency simulation with all signers. Measure time from alert to executed pause.
Testing pause paths
- Unit and invariant tests: assert that every state-changing function either reverts with
EnforcedPausewhen paused or is on the documented allow list. - Role tests: confirm the pauser cannot unpause, upgrade or move funds, and that a removed signer loses access.
- Fork rehearsals: execute the real pause transaction through the multisig against a mainnet fork, including from a backup interface, since SEAL's runbook covers the case where the primary wallet interface is down.
- Breaker tests: replay historical peak outflows to tune thresholds and confirm reset behaviour.
Measuring readiness
Track: median time from alert to executed pause in drills; the share of state-changing functions covered by pause tests; signers reachable within the target window; breaker false positives per quarter; and time from pause to staged unpause in real incidents. The Web3 Incident Response Playbook covers the wider response.
Common failure patterns
- Pause function never exposed: the module is inherited but no public, access-controlled pause function exists.
- Unguarded entry points: a newer function or a second contract lacks the modifier, so the exploit continues while paused.
- Over-powered pauser: the same key can pause, upgrade and withdraw, turning an emergency role into a theft path.
- Unreachable signers: the threshold cannot be met at night or during holidays.
- Permanent freeze risk: no time limit and a single unpauser, so a lost key traps funds.
Framework mapping
| Design element | NIST SP 800-53 Rev 5 | NIST CSF 2.0 |
|---|---|---|
| Separate pause, unpause, upgrade and treasury roles | AC-5 Separation of Duties, AC-6 Least Privilege | PR.AA-05, GV.RR-02 |
| Monitoring and circuit breakers | SI-4 System Monitoring | DE.CM-09 |
| Emergency pause and containment | IR-4 Incident Handling | RS.MI-01 |
| Staged unpause and recovery | CP-2 Contingency Plan | RC.RP-01 |
| Drills and fork rehearsals | IR-3 Incident Response Testing, CP-4 | RC.RP-01 |
Practitioner checklist
- Every contract has a written pause map listing which functions stop, which stay open and which recovery functions work only while paused.
- Pause, unpause, upgrade, parameter and treasury powers sit in separate roles, and the pauser can do nothing but pause.
- The pause multisig uses hardware wallets, has a threshold reachable around the clock and has backup signers.
- Any bot with pause rights holds its key in managed signing, has pause-only rights and alerts on every use.
- Outflow or deviation circuit breakers exist for high-value paths, with thresholds tuned from historical data.
- Unpausing follows full verification, a staged resume plan and a different approval path from pausing.
- Upgrades and threshold changes sit behind a timelock with a guardian able to cancel.
- Tests prove every state-changing function respects the pause, and pause drills run on a schedule against a fork.
- The role map is published and every pause is reported publicly afterwards.
Standards and references
- Ethereum.org: Smart contract security
- Security Alliance (SEAL): Emergency Pause Runbook
- Security Alliance (SEAL): Multisig Use Case Specific Requirements
- Security Alliance (SEAL): Emergency Procedures for Signers
- OpenZeppelin Contracts: Pausable
- OpenZeppelin Contracts: AccessManager
- OpenZeppelin Contracts: TimelockController
- Ethereum Magicians: ERC-7265 Circuit Breaker discussion
Related NHI Mgmt Group resources: Smart Contract Security Guide, DeFi Risk Guide, Smart Contract Deployment Security Checklist, Web3 and Crypto Security Guide.