Contract e3efe4534a0ba89a5b02c4fb54fc0eb7adcb5e7821e0c1980348122ab4395acc

← Back to Index 📥 Download WASM

Meta

rssdkver 23.0.2#a97daf8b07cdf24e9bd45e344db51a21b9ea77d3
rsver 1.89.0

Instances

  • CCJKUBIAPUFMBOGGG3NVQA3D2IHIL6BQV36R4FJQO5OROHUNMFSEPIOB

Interface

Initialize the contract with an owner and optional limits

fn init(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    max_limit: Option,
    min_limit: Option,
)

Transfer admin rights to a new address

fn transfer_admin(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Get current admin

fn admin(env: soroban_sdk::Env) -> Result

Check if contract is paused

fn is_paused(env: soroban_sdk::Env) -> bool

Get current count

fn get_count(env: soroban_sdk::Env) -> u32

Get complete counter state

fn get_state(env: soroban_sdk::Env) -> CounterState

Pause the contract (admin only)

fn pause(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>

Unpause the contract (admin only)

fn unpause(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>

Set limits for the counter (admin only)

fn set_limits(
    env: soroban_sdk::Env,
    max_limit: Option,
    min_limit: Option,
) -> Result<(), soroban_sdk::Error>

Increment the counter

fn inc(
    env: soroban_sdk::Env,
    by: u32,
    user: soroban_sdk::Address,
) -> Result

Decrement the counter

fn dec(
    env: soroban_sdk::Env,
    by: u32,
    user: soroban_sdk::Address,
) -> Result

Reset the counter (admin only)

fn reset(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>

Get user-specific increment count

fn get_user_count(env: soroban_sdk::Env, user: soroban_sdk::Address) -> u32

Get recent history (last 10 entries)

fn get_history(env: soroban_sdk::Env) -> soroban_sdk::Vec

Emergency stop - completely disable the contract (admin only)

fn emergency_stop(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>

Imports

WebAssembly Text (WAT) ▶