Contract f322e40647696ff6c5b53a2f5e05f953a5a8c9b5d3fead752c37f08cd40c398a

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.88.0

Instances

  • CA2FOEKPD25ZKLERL4P752TIFSYNU7X7OHPD7VTLATCIJS5NRKNVKGLF

Interface

Transfer tokens through contract - receives token from sender and sends 1 XLM back

Parameters:

  • sender: The address sending the token and receiving 1 XLM (must sign the transaction)
  • token: The token contract address to receive from sender
  • amount: Amount of tokens to receive from sender

Example: Send 10 AQUA to contract, receive 1 XLM back

fn transfer(
    env: soroban_sdk::Env,
    sender: soroban_sdk::Address,
    token: soroban_sdk::Address,
    amount: i128,
) -> Result<(), ContractError>

Get the balance of an address for a specific token Useful for checking balances before/after transfer

fn get_balance(
    env: soroban_sdk::Env,
    address: soroban_sdk::Address,
    token: soroban_sdk::Address,
) -> i128

Imports

WebAssembly Text (WAT) ▶