Contract 401ec68c5aa2f56691b12407eedbf2ce6c24ce43bd9503a45cce6071ba2e63d0

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.90.0

Instances

  • CCYQMXYGJJYLYBC2DEWMWTL26MDOXXJ7EPKCDUVHEGTPVRWCTQDWEUBQ

Interface

Initialize the contract with a fee collector address

fn init(env: soroban_sdk::Env, fee_collector: soroban_sdk::Address) -> ()

Transfer tokens with an automatic fee deduction.

  • token_contract: token contract address (USDC or native XLM contract id)
  • from: account sending tokens (must be the invoker)
  • to: recipient (e.g. Binance deposit address)
  • amount: total amount user wants to transfer
  • fee_bps: fee in basis points (e.g. 100 = 1%)
fn transfer_usdc(
    env: soroban_sdk::Env,
    token_contract: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
    fee_bps: u32,
) -> ()

send XLM with fee deduction

fn transfer_xlm(
    env: soroban_sdk::Env,
    token_contract: soroban_sdk::Address,
    sender: soroban_sdk::Address,
    recipient: soroban_sdk::Address,
    amount: i128,
    fee: i128,
) -> ()

Calculate the transaction fee for XLM or USD sent.

  • amount: total amount to be transferred
  • fee_bps: fee in basis points (e.g. 100 = 1%) Returns the calculated fee amount
fn calculate_fee(env: soroban_sdk::Env, amount: i128, fee_bps: u32) -> i128

Imports

WebAssembly Text (WAT) ▶