Contract 0eb3a9c49b66b4af26b0a95337a334b31d981a89258d0fbe0b8d7390a36fc2aa

← Back to Index 📥 Download WASM

Meta

cliver 25.1.0#a048a57a75762458b487052e0021ea704a926bee
rssdkver 25.1.1#94c2a3b3a5ded6b9cf9cef0c207bf8804f3eb294
rsver 1.90.0

Instances

  • CDB4HHQL3U5ZZ3MMI4OXXHY3TGLXQR6SJPKX3EXNQGJTX5DM7F3M6J64
  • CDUKWQZ2YALRQQWAPJFWDMTGBZ3QAE4N2DHQPNU2DNMDH7KIVC4CXGYM

Interface

Get the treasury fee for a cross-chain message.

Returns 0 if fee collection is disabled. For ZRO payments, delegates to the ZRO fee library.

fn get_fee(
    env: soroban_sdk::Env,
    sender: soroban_sdk::Address,
    dst_eid: u32,
    total_native_fee: i128,
    pay_in_zro: bool,
) -> i128
fn __constructor(env: soroban_sdk::Env, owner: soroban_sdk::Address)

Sets the native fee percentage in basis points.

Arguments

  • native_fee_bp - Fee percentage in basis points (0-10000, where 10000 = 100%)
fn set_native_fee_bp(env: soroban_sdk::Env, native_fee_bp: u32)

Enables or disables fee collection globally.

Arguments

  • fee_enabled - Whether fee collection is enabled
fn set_fee_enabled(env: soroban_sdk::Env, fee_enabled: bool)

Sets or removes the ZRO fee library for custom ZRO token fee calculations.

Arguments

  • zro_fee_lib - The ZRO fee library contract address, or None to remove
fn set_zro_fee_lib(env: soroban_sdk::Env, zro_fee_lib: Option)

Withdraws any token (including native XLM) from the contract to a specified address.

Only the contract owner can execute this method.

Arguments

  • token - The token contract address (can be native XLM or any other token)
  • to - The recipient address
  • amount - The amount to withdraw (must be positive)
fn withdraw_token(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)

Returns the native fee percentage in basis points.

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

Returns whether fee collection is enabled.

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

Returns the ZRO fee library address if set.

fn zro_fee_lib(env: soroban_sdk::Env) -> Option
fn authorizer(env: soroban_sdk::Env) -> Option

Returns the current owner address, or None if no owner is set.

fn owner(env: soroban_sdk::Env) -> Option

Returns the pending owner address for 2-step transfer, or None if no transfer is pending.

fn pending_owner(env: soroban_sdk::Env) -> Option

Transfers ownership immediately to a new address.

Use with caution - if you transfer to a wrong address, ownership is lost forever. Consider using begin_ownership_transfer instead.

Panics

  • OwnerNotSet if no owner is currently set
  • TransferInProgress if a 2-step transfer is in progress
fn transfer_ownership(env: soroban_sdk::Env, new_owner: soroban_sdk::Address)

Begins an ownership transfer to a new address.

The new owner must call accept_ownership() within ttl ledgers to complete the transfer. The pending transfer will automatically expire after.

Arguments

  • new_owner - The proposed new owner
  • ttl - Number of ledgers the new owner has to accept. Use 0 to cancel a pending transfer (new_owner must match pending).

Panics

  • OwnerNotSet if no owner is currently set
  • NoPendingTransfer when cancelling and no pending transfer exists
  • InvalidTtl if ttl exceeds max TTL
  • InvalidPendingOwner when cancelling with wrong new_owner address
fn begin_ownership_transfer(
    env: soroban_sdk::Env,
    new_owner: soroban_sdk::Address,
    ttl: u32,
)

Accepts a pending 2-step ownership transfer.

Must be called by the pending owner before the TTL expires.

Panics

  • NoPendingTransfer if there is no pending transfer (or it expired)
fn accept_ownership(env: soroban_sdk::Env)

Permanently renounces ownership.

Panics

  • OwnerNotSet if no owner is currently set
  • TransferInProgress if a 2-step transfer is in progress (cancel it first)
fn renounce_ownership(env: soroban_sdk::Env)

Extends the instance TTL.

Arguments

  • threshold - The threshold to extend the TTL (if current TTL is below this, extend).
  • extend_to - The TTL to extend to.
fn extend_instance_ttl(env: soroban_sdk::Env, threshold: u32, extend_to: u32)

Sets TTL configs for instance and persistent storage.

  • None values remove the corresponding config (disables auto-extension for that type)
  • Validates that threshold <= extend_to <= MAX_TTL

Arguments

  • instance - TTL config for instance storage
  • persistent - TTL config for persistent storage

Panics

  • TtlConfigFrozen if configs are frozen
  • InvalidTtlConfig if validation fails
fn set_ttl_configs(
    env: soroban_sdk::Env,
    instance: Option,
    persistent: Option,
)

Returns the current TTL configs as (instance_config, persistent_config).

fn ttl_configs(env: soroban_sdk::Env) -> (Option, Option)

Permanently freezes TTL configs, preventing any future modifications.

This is irreversible and provides immutability guarantees to users. Emits TtlConfigsFrozen event.

Panics

  • TtlConfigAlreadyFrozen if already frozen
fn freeze_ttl_configs(env: soroban_sdk::Env)

Returns whether TTL configs are frozen.

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

Imports

WebAssembly Text (WAT) ▶