One-time setup. Records the admin and the XLM SAC token address, and unpauses the contract.
fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
token: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Contribute amount of XLM into the community fund. Pulls the deposit into
the contract's custody and tracks the member's cumulative stake. Returns
the member's new total contribution.
Auth: the member's signature also authorizes the inner SAC transfer.
fn contribute(
env: soroban_sdk::Env,
member: soroban_sdk::Address,
amount: i128,
) -> Result
Open a funding proposal asking for amount to be sent to recipient.
Returns the new proposal id (1-based).
fn create_proposal(
env: soroban_sdk::Env,
proposer: soroban_sdk::Address,
recipient: soroban_sdk::Address,
amount: i128,
) -> Result
Cast a vote on a proposal. One vote per member per proposal. When the
yes-votes cross a strict majority of members (2 * yes > member_count)
and the treasury holds enough, the contract disburses to the recipient in
the same call. Returns the proposal's resulting status.
Auth: the voter's signature.
fn vote(
env: soroban_sdk::Env,
voter: soroban_sdk::Address,
proposal_id: u64,
in_favor: bool,
) -> Result
Complete a proposal that already won its vote (Passed) once the treasury
has the funds. Idempotent guard against double-pay. Admin-gated fallback
for the auto-disbursement in vote.
fn disburse(
env: soroban_sdk::Env,
proposal_id: u64,
) -> Result
fn get_member(env: soroban_sdk::Env, member: soroban_sdk::Address) -> i128
fn get_proposal(
env: soroban_sdk::Env,
proposal_id: u64,
) -> Result
fn has_voted(
env: soroban_sdk::Env,
proposal_id: u64,
voter: soroban_sdk::Address,
) -> bool
fn member_count(env: soroban_sdk::Env) -> u32
fn total_contributed(env: soroban_sdk::Env) -> i128
fn total_released(env: soroban_sdk::Env) -> i128
fn available(env: soroban_sdk::Env) -> i128
fn proposal_count(env: soroban_sdk::Env) -> u64
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 code (admin-gated). Ships fixes without migrating treasury state.
fn upgrade(
env: soroban_sdk::Env,
new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>