Contract 2ec044e90c6d8ab2f1be1d29b3c89a734d38223eea578f200d6e94e367aa56c5

← Back to Index 📥 Download WASM

Meta

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

Instances

  • CCFH5T7YZ5YPVABWQ37WZFE7RQZWXBAKDNVJS6F2XDTCSAZIH6NMLMAE

Interface

One-time setup. Records the admin and the pool's SAC token, then unpauses.

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

Deposit amount of the pool token into the contract's custody.

Auth: requires the funder's signature; the same authorization covers the inner SAC transfer(funder -> contract). Anyone may top up the pool.

fn fund(
    env: soroban_sdk::Env,
    funder: soroban_sdk::Address,
    amount: i128,
) -> Result

Release a grant from the pool to recipient and write a permanent on-chain receipt under grant_ref.

Auth: the contract admin only. A grant can be disbursed exactly once.

fn disburse(
    env: soroban_sdk::Env,
    grant_ref: soroban_sdk::BytesN<32>,
    admin: soroban_sdk::Address,
    recipient: soroban_sdk::Address,
    amount: i128,
) -> Result
fn get_disbursement(
    env: soroban_sdk::Env,
    grant_ref: soroban_sdk::BytesN<32>,
) -> Result
fn is_disbursed(env: soroban_sdk::Env, grant_ref: soroban_sdk::BytesN<32>) -> bool
fn pool_balance(env: soroban_sdk::Env) -> i128
fn total_disbursed(env: soroban_sdk::Env) -> i128
fn total_disbursements(env: soroban_sdk::Env) -> u64
fn is_paused(env: soroban_sdk::Env) -> bool
fn get_admin(env: soroban_sdk::Env) -> Result
fn get_token(env: soroban_sdk::Env) -> Result
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 code (admin-gated). Lets Tulong ship fixes without migrating receipt state — important for a mainnet (L6) deploy.

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

Imports

WebAssembly Text (WAT) ▶