In blockchain you must be able to stop the chaos. Sometimes you could not think of everything, and at some point the mechanisms you built in fail. One mechanism is still left then: a switch that turns things on and off.
This slide was shown at Devconnect 2025, held in Buenos Aires, Argentina.
Pausable in OpenZeppelin
That is what the Pausable mechanism and interface in the OpenZeppelin library are for. On the slide above it is added to an ERC20 token through ERC20Pausable. Only the holder of PAUSER_ROLE can pause and unpause the contract, and functions marked whenNotPaused do not run while it is paused:
I strongly recommend Pausable to every smart contract developer. Never forget about it: when everything else has already failed, it is the one thing that lets you stop the contract.