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)