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>