Contract cb3c0e119fee28b7f3623b9848cd0eb632aae32b9d2dc955c49f348db6031b00

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.89.0

Instances

  • CDDMT5CNBFZCO6TEP357XRJ6Z2G5GV4UJTJT5ZHBECUPQ6S32NEV6BHB

Interface

One-time setup. Records the admin and the escrowed token (the native XLM SAC on Tabungan), and unpauses the contract.

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    token: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Parent deposits amount of the vault token into their family vault. Returns the new total vault balance.

Auth: the parent's signature, which also covers the inner SAC transfer(parent -> contract).

fn deposit(
    env: soroban_sdk::Env,
    parent: soroban_sdk::Address,
    amount: i128,
) -> Result

Parent sets the absolute allowance a recipient can claim. Passing a smaller value lowers it; passing 0 clears it. The total of all allowances may never exceed the parent's deposited balance. Returns the parent's unallocated (still-withdrawable) balance.

Auth: the parent's signature.

fn set_allowance(
    env: soroban_sdk::Env,
    parent: soroban_sdk::Address,
    recipient: soroban_sdk::Address,
    amount: i128,
) -> Result

Recipient claims amount from the allowance parent set for them. The contract pays out from its own balance. Returns the recipient's remaining allowance.

Auth: the recipient's signature — binds the payout to them.

fn claim(
    env: soroban_sdk::Env,
    parent: soroban_sdk::Address,
    recipient: soroban_sdk::Address,
    amount: i128,
) -> Result

Parent withdraws amount of the unallocated balance back to their wallet. Allocated allowances stay reserved for recipients. Returns the new total vault balance.

Auth: the parent's signature.

fn withdraw_unallocated(
    env: soroban_sdk::Env,
    parent: soroban_sdk::Address,
    amount: i128,
) -> Result

The parent's vault (balance + allocated). Returns a zeroed vault if the parent has never deposited, so the UI can render an empty state.

fn get_vault(env: soroban_sdk::Env, parent: soroban_sdk::Address) -> Vault

The unallocated (withdrawable) portion of a parent's vault.

fn unallocated(env: soroban_sdk::Env, parent: soroban_sdk::Address) -> i128

The current claimable allowance for a (parent, recipient) pair.

fn get_allowance(
    env: soroban_sdk::Env,
    parent: soroban_sdk::Address,
    recipient: soroban_sdk::Address,
) -> i128
fn get_token(env: soroban_sdk::Env) -> Result
fn get_admin(env: soroban_sdk::Env) -> Result
fn is_paused(env: soroban_sdk::Env) -> bool
fn pause(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>
fn unpause(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>
fn set_admin(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Replace the contract's own Wasm (admin-gated). Lets us ship fixes without migrating vault state — important for a future mainnet deploy.

fn upgrade(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>

Imports

WebAssembly Text (WAT) ▶