Contract b8211807a12224a0dd0e0999f656da8e256c427565def998e0cc35ac44335a00

← Back to Index 📥 Download WASM

Meta

rssdkver 23.4.1#e671b396f8bacf1370925f722df158b31c0baae5
rsver 1.90.0

Instances

  • CAH7RKO2ZU232L3BS4LGI3NENMFA232DWNEE4BQL3QTM2UQ3S2FIN6OJ

Interface

Initialize the contract with USDC token address The caller becomes the admin (must sign the transaction) Can only be called once

fn init(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    usdc_address: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Set the balance for a user (Admin only) This will overwrite the existing balance

fn set_balance(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    amount: i128,
) -> Result<(), soroban_sdk::Error>

Add to the balance for a user (Admin only) This will add to the existing balance

fn add_balance(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    amount: i128,
) -> Result<(), soroban_sdk::Error>

Batch set balances for multiple users (Admin only) This will overwrite existing balances for all users in the list

fn batch_set_balance(
    env: soroban_sdk::Env,
    users: soroban_sdk::Vec,
    amounts: soroban_sdk::Vec,
) -> Result<(), soroban_sdk::Error>

Batch add to balances for multiple users (Admin only) This will add to existing balances for all users in the list

fn batch_add_balance(
    env: soroban_sdk::Env,
    users: soroban_sdk::Vec,
    amounts: soroban_sdk::Vec,
) -> Result<(), soroban_sdk::Error>

Withdraw all available USDC balance to the caller Requires authorization from the user

fn withdraw(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Get the balance for a user

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

Get the admin address

fn get_admin(env: soroban_sdk::Env) -> soroban_sdk::Address

Get the USDC token address

fn get_usdc(env: soroban_sdk::Env) -> soroban_sdk::Address

Transfer admin to a new address (Admin only)

fn transfer_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)

Imports

WebAssembly Text (WAT) ▶