pause

Function pause 

Source
pub fn pause(e: &Env)
Expand description

Triggers paused state.

§Arguments

  • e - Access to Soroban environment.

§Errors

§Events

  • topics - ["paused"]
  • data - []

§Security Warning

IMPORTANT: This function lacks authorization checks and should only be used in admin functions that implement their own authorization logic.

Example:

use stellar_access_control_macros::only_role;

#[only_role(operator, "pauser")] // `only_role` handles authorization
fn emergency_pause(e: &Env, operator: Address) {
    pausable::pause(e);
}