Contract dd3fe2de6eb14f4498d9676b1e11879c1223a98faf230c3038cbb90f6b27bd0a

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.88.0

Instances

  • CBVOW7FBOYF2FVLOOPFAGXDJIOMRG4V6PYAIDBNONDPABIQUSAVHVKP5

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) ▶