Solidity

Pausable

Pausable is an emergency-control pattern that lets authorized accounts temporarily disable selected contract functions.

A protocol can freeze certain actions during an incident, but only if the pause is scoped and controlled correctly.

Pausable Explained in Detail

Pausable is a pattern for disabling selected functions during an incident. A protocol may pause deposits, swaps, borrows, liquidations, upgrades, or other actions depending on what it is trying to protect.

A pause does not fix a bug by itself. It buys time if the right functions can be paused by the right authority.

Smart contract example

function deposit(uint256 amount) external whenNotPaused {
    asset.safeTransferFrom(msg.sender, address(this), amount);
}

The audit question is whether deposit is the right function to pause, who controls the pause, and whether users can still exit safely.

Pausable in Auditing

Pausable controls affect both security and liveness. A pause can limit damage during an exploit, but it can also block withdrawals, prevent repayments, stop liquidations, or create governance griefing if the pauser is compromised.

Auditors review pause scope, unpause authority, emergency operations, event emissions, and operational controls such as role-based access control, multisigs, and timelocks.

Red flags in code

  • Pause blocks withdrawals or repayment without a safe escape path.

  • Pauser and unpauser are the same hot EOA.

  • Only some dangerous functions are paused, leaving bypass paths open.

  • Pause can be triggered by an untrusted caller or weak role.

  • Critical recovery functions are unavailable while paused.

How to test or review it

  • Test every state-changing function in both paused and unpaused states.

  • Verify who can pause, unpause, and change pauser roles.

  • Check whether users can withdraw, repay, or reduce risk while paused when the protocol design requires it.

  • Test partial-pause scenarios around liquidation, collateral, and rewards.

  • Confirm events and monitoring hooks make pause actions observable.

Sources