multiversx_sc_modules::pause

Trait PauseModule

Source
pub trait PauseModule: ContractBase + Sized {
    // Required methods
    fn pause_event(&self);
    fn unpause_event(&self);
    fn paused_status(&self) -> SingleValueMapper<Self::Api, bool>;

    // Provided methods
    fn is_paused(&self) -> bool { ... }
    fn not_paused(&self) -> bool { ... }
    fn set_paused(&self, paused: bool) { ... }
    fn pause_endpoint(&self) { ... }
    fn unpause_endpoint(&self) { ... }
    fn require_paused(&self) { ... }
    fn require_not_paused(&self) { ... }
}
Expand description

Standard smart contract module that, when added to a smart contract, offers pausability.

It provides a flag that contracts can use to check if owner decided to pause the entire contract. Use the features module for more granular on/off switches.

It offers:

  • an endpoint where the owner can pause/unpause contract
  • a method to check if contract is paused or not

Required Methods§

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<C> PauseModule for C
where C: AutoImpl,