Contract 02eacac2332ae8308becf4a0428b469b8b47f9ca0bfba8ef6418b6000b657e4a

← Back to Index 📥 Download WASM

Meta

cliver 23.2.1#496ac35be7a7d8d923fcde9bbbc650ee593d1f6f
rssdkver 23.2.1#ab415a33cc1f6bdce20ac4a12f0ddbe41a648949
rsver 1.89.0

Instances

  • CDFI34II7BQU4CG7OHVMSYECEBF6UK3LMNIH4Y2POZZ3NCAUM32MD5M5

Interface

Initializes the contract with a public key for signature verification and an owner address

Arguments

  • public_key - The public key used to verify signatures for withdrawals
  • owner - The address of the contract owner who has administrative privileges
fn constructor(
    env: soroban_sdk::Env,
    public_key: soroban_sdk::BytesN<65>,
    owner: soroban_sdk::Address,
)

Changes the contract owner to a new address

Arguments

  • owner - The new owner address
fn set_owner(env: soroban_sdk::Env, owner: soroban_sdk::Address)

Allows the owner to withdraw tokens from the contract

Arguments

  • amount - The amount of tokens to withdraw
  • token - The token address to withdraw from
fn owner_withdraw(env: soroban_sdk::Env, amount: u128, token: soroban_sdk::Address)

Extends the contract instance TTL to prevent expiration

fn increase_instance_ttl(env: soroban_sdk::Env)

Removes a deposit record from storage

Arguments

  • nonce - The nonce of the deposit to clear
fn clear_deposit(env: soroban_sdk::Env, nonce: u128)

Updates the public key used for signature verification

Arguments

  • public_key - The new public key to set
fn set_public_key(env: soroban_sdk::Env, public_key: soroban_sdk::BytesN<65>)

Processes a withdrawal request after verifying the signature

Arguments

  • amount - The amount to withdraw
  • nonce - A unique identifier for this withdrawal
  • token - The token address to withdraw
  • receiver - The address to receive the tokens
  • signature - The signature authorizing this withdrawal
fn withdraw(
    env: soroban_sdk::Env,
    amount: u128,
    nonce: u128,
    token: soroban_sdk::Address,
    receiver: soroban_sdk::Address,
    signature: soroban_sdk::BytesN<65>,
)

Processes a deposit from Stellar to another chain

Arguments

  • sender_id - The address sending the tokens
  • amount - The amount of tokens to deposit
  • token - The token address being deposited
  • receiver_id - The recipient address on the target chain
  • client_timestamp - Timestamp used as nonce

Returns

  • The nonce used for this deposit
fn deposit(
    env: soroban_sdk::Env,
    sender_id: soroban_sdk::Address,
    amount: u128,
    token: soroban_sdk::Address,
    receiver_id: soroban_sdk::BytesN<32>,
    nonce: u128,
) -> u128

Retrieves deposit data by nonce

Arguments

  • nonce - The nonce of the deposit to retrieve

Returns

  • The deposit data as bytes
fn get_deposit(env: soroban_sdk::Env, nonce: u128) -> soroban_sdk::Bytes

Gets the current ledger timestamp

Returns

  • The current ledger timestamp
fn get_timestamp(env: soroban_sdk::Env) -> u64

Retrieves the public key used for signature verification

Returns

  • The public key as bytes
fn get_public_key(env: soroban_sdk::Env) -> soroban_sdk::BytesN<65>

Checks if a withdrawal with the given nonce has been executed

Arguments

  • nonce - The nonce to check

Returns

  • True if the withdrawal has been executed, false otherwise
fn is_executed(env: soroban_sdk::Env, nonce: u128) -> bool

Gets the contract owner address

Returns

  • The owner address
fn get_owner(env: soroban_sdk::Env) -> soroban_sdk::Address

Verifies a hot omni bridge deposit

Arguments

  • wallet_id - The wallet identifier
  • data - The data to verify containing nonce and hash

Returns

  • True if verification succeeds, false otherwise
fn hot_verify(
    env: soroban_sdk::Env,
    wallet_id: soroban_sdk::String,
    data: soroban_sdk::BytesN<48>,
) -> bool

Imports

WebAssembly Text (WAT) ▶