Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions contracts/token/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ impl BcForgeToken {
Ok(())
}

/// Returns whether the contract is currently paused.
pub fn is_paused(env: Env) -> bool {
Self::panic_on_err(&env, Self::ensure_initialized(&env));
bc_forge_lifecycle::is_paused(&env)
}

/// Upgrades the contract's executable to `new_wasm_hash`.
///
/// Gated to `Role::SuperAdmin` (or `Role::Admin`, which is a superset of
Expand Down
10 changes: 10 additions & 0 deletions sdk/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,16 @@ export class bcForgeClient {
return this.invokeContract('unpause', [], source);
}

/**
* Check if the token contract is currently paused.
*
* @returns True if the contract is paused, false otherwise.
*/
async isPaused(): Promise<boolean> {
const result = await this.queryContract('is_paused', []);
return scValToNative(result) as boolean;
}

// ─── Offline Transaction Builders ──────────────────────────────────────────

/**
Expand Down
Loading