Initializes the contract with a public key for signature verification and an owner address
public_key - The public key used to verify signatures for withdrawalsowner - The address of the contract owner who has administrative privilegesfn constructor(
env: soroban_sdk::Env,
public_key: soroban_sdk::BytesN<65>,
owner: soroban_sdk::Address,
)
Changes the contract owner to a new address
owner - The new owner addressfn set_owner(env: soroban_sdk::Env, owner: soroban_sdk::Address)
Allows the owner to withdraw tokens from the contract
amount - The amount of tokens to withdrawtoken - The token address to withdraw fromfn 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
nonce - The nonce of the deposit to clearfn clear_deposit(env: soroban_sdk::Env, nonce: u128)
Updates the public key used for signature verification
public_key - The new public key to setfn set_public_key(env: soroban_sdk::Env, public_key: soroban_sdk::BytesN<65>)
Processes a withdrawal request after verifying the signature
amount - The amount to withdrawnonce - A unique identifier for this withdrawaltoken - The token address to withdrawreceiver - The address to receive the tokenssignature - The signature authorizing this withdrawalfn 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
sender_id - The address sending the tokensamount - The amount of tokens to deposittoken - The token address being depositedreceiver_id - The recipient address on the target chainclient_timestamp - Timestamp used as noncefn 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
nonce - The nonce of the deposit to retrievefn get_deposit(env: soroban_sdk::Env, nonce: u128) -> soroban_sdk::Bytes
Gets the current ledger timestamp
fn get_timestamp(env: soroban_sdk::Env) -> u64
Retrieves the public key used for signature verification
fn get_public_key(env: soroban_sdk::Env) -> soroban_sdk::BytesN<65>
Checks if a withdrawal with the given nonce has been executed
nonce - The nonce to checkfn is_executed(env: soroban_sdk::Env, nonce: u128) -> bool
Gets the contract owner address
fn get_owner(env: soroban_sdk::Env) -> soroban_sdk::Address
Verifies a hot omni bridge deposit
wallet_id - The wallet identifierdata - The data to verify containing nonce and hashfn hot_verify(
env: soroban_sdk::Env,
wallet_id: soroban_sdk::String,
data: soroban_sdk::BytesN<48>,
) -> bool