@stdlib/stoppable
Provides traits that allow to stop a contract. Useful for emergency or maintenance modes. Requires an Ownable
trait from @stdlib/ownable
. This trait just manages a single flag stopped
in the contract and handling stopped state have to be done in the contract itself.
To use this library, import @stdlib/stoppable
:
Traits
Stoppable
Trait Stoppable
implements receiver for the Message string “Stop” that can be sent by owner, implements stopped()
getter function that returns true
if contract is stopped (or false
otherwise) and provides private (non-getter) functions requireNotStopped()
and requireStopped()
.
Source code:
Usage example:
Resumable
Resumable
trait extends Stoppable
trait and allows to resume contract execution.
Source code:
Usage example: