One-time setup. Records the admin (the deployer) and the default token (the XLM Stellar Asset Contract), and unpauses the contract.
fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
token: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Fund (or top up) the match pool pool_id for cause with amount of the
configured token, locking it in the contract. Creates the pool on first
call (binding its sponsor and cause); accumulates on later calls by
the same sponsor for the same cause. Returns the updated pool.
Auth: the sponsor's signature, which also covers the inner SAC
transfer(sponsor -> contract).
fn fund_pool(
env: soroban_sdk::Env,
sponsor: soroban_sdk::Address,
pool_id: soroban_sdk::BytesN<32>,
cause: soroban_sdk::Address,
amount: i128,
) -> Result
Donate amount to the pool's cause. The contract pulls the gift from the
donor, then pays the cause gift + match where match = min(gift, remaining). Both legs settle atomically. Returns the on-chain split.
Auth: the donor's signature, which also covers the inner SAC
transfer(donor -> contract). The contract authorizes its own payout.
fn donate(
env: soroban_sdk::Env,
donor: soroban_sdk::Address,
pool_id: soroban_sdk::BytesN<32>,
amount: i128,
) -> Result
fn get_pool(
env: soroban_sdk::Env,
pool_id: soroban_sdk::BytesN<32>,
) -> Result
fn pool_remaining(env: soroban_sdk::Env, pool_id: soroban_sdk::BytesN<32>) -> i128
fn total_donated(env: soroban_sdk::Env) -> i128
fn total_matched(env: soroban_sdk::Env) -> i128
fn is_paused(env: soroban_sdk::Env) -> bool
fn get_token(env: soroban_sdk::Env) -> Result
fn get_admin(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). Enables shipping fixes without migrating pooled funds.
fn upgrade(
env: soroban_sdk::Env,
new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>