Member join
fn join(
env: soroban_sdk::Env,
member: soroban_sdk::Address,
deposit_amount: i128,
) -> Result<(), soroban_sdk::Error>
Vote on a proposal
fn vote(
env: soroban_sdk::Env,
voter: soroban_sdk::Address,
proposal_id: u64,
choice: VoteChoice,
) -> Result<(), soroban_sdk::Error>
Create a new proposal
fn propose(
env: soroban_sdk::Env,
proposer: soroban_sdk::Address,
proposal_type: ProposalType,
) -> Result
Sponsor a candidate for joining (sponsor must be an Active member)
fn sponsor(
env: soroban_sdk::Env,
sponsor: soroban_sdk::Address,
candidate: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Upgrade contract WASM code (admin only) Contract address and all storage data are preserved.
fn upgrade(
env: soroban_sdk::Env,
new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>
Get vote record (C2: from persistent storage)
fn get_vote(
env: soroban_sdk::Env,
proposal_id: u64,
voter: soroban_sdk::Address,
) -> Result
Get round information (C2: from persistent storage)
fn get_round(env: soroban_sdk::Env, round_id: u64) -> Result
Contribution
fn contribute(
env: soroban_sdk::Env,
member: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Get configuration
fn get_config(env: soroban_sdk::Env) -> Result
Get member information
fn get_member(
env: soroban_sdk::Env,
address: soroban_sdk::Address,
) -> Result
Initialize the contract
fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
config: RoscaConfig,
) -> Result<(), soroban_sdk::Error>
Get list of all member addresses
fn get_members(
env: soroban_sdk::Env,
) -> Result, soroban_sdk::Error>
Step 2: Accept admin transfer (pending admin only)
fn accept_admin(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>
Get proposal information (C2: from persistent storage)
fn get_proposal(
env: soroban_sdk::Env,
proposal_id: u64,
) -> Result
Check if a proposal has been cancelled (public query)
fn is_cancelled(env: soroban_sdk::Env, proposal_id: u64) -> bool
Request exit (two-step: sets ExitPending, actual exit happens at settle_round)
fn request_exit(
env: soroban_sdk::Env,
member: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Settle round (including recipient selection and payout) C3: Permissionless — anyone can call after round ends + grace period
fn settle_round(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>
Get statistics
fn get_statistics(env: soroban_sdk::Env) -> Result
Top up deposit (replenish after violation deductions) NOTE: Intentionally allows top-up during Paused status. This is by design — members should be able to replenish their deposit (e.g. after violation deductions) even while the ROSCA is paused, so they are ready when it resumes. Only Dissolved is blocked.
fn top_up_deposit(
env: soroban_sdk::Env,
member: soroban_sdk::Address,
amount: i128,
) -> Result<(), soroban_sdk::Error>
Step 1: Propose admin transfer (current admin only)
fn transfer_admin(
env: soroban_sdk::Env,
new_admin: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Cancel a proposal (only the proposer can cancel, before voting period ends)
fn cancel_proposal(
env: soroban_sdk::Env,
proposer: soroban_sdk::Address,
proposal_id: u64,
) -> Result<(), soroban_sdk::Error>
Late contribution (with late fee)
fn contribute_late(
env: soroban_sdk::Env,
member: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Execute a proposal after voting ends
fn execute_proposal(
env: soroban_sdk::Env,
executor: soroban_sdk::Address,
proposal_id: u64,
) -> Result<(), soroban_sdk::Error>
Get current round number
fn get_current_round(env: soroban_sdk::Env) -> Result
Get insurance pool balance
fn get_insurance_pool(env: soroban_sdk::Env) -> Result
Calculate recipient for current round (priority-based, deterministic query) This function is for querying who has highest priority, non-consuming, for reference only
fn calculate_recipient(
env: soroban_sdk::Env,
) -> Result
Process exit refund while ROSCA is Paused. During Pause, settle_round cannot run, so ExitPending members would be stuck. This function allows any ExitPending member to claim their refund directly.
fn process_paused_exit(
env: soroban_sdk::Env,
member: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>