Contract 256c131ae6343723dd063eb218d47e7b853ab39293b4d3ebe139cef554e14298

← Back to Index 📥 Download WASM

Meta

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

Instances

  • CDYRUMJ4WMWRGTFKWNUTFR3UE2T5VTQ64REVXOKUZPF6AH25NGE2P5OO

Interface

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>

Imports

WebAssembly Text (WAT) ▶