Returns the USDC-like Stellar asset contract address used by the pool.
fn token(env: soroban_sdk::Env) -> soroban_sdk::Address
Returns the parent payout wallet address.
fn parent(env: soroban_sdk::Env) -> soroban_sdk::Address
OFW sibling contributes to the monthly family pool. The sibling authorizes the call, tokens move from sibling wallet to the contract, and once the target is met the contract releases the consolidated payout to the parent. Returns true only when this contribution triggered the final payout.
fn contribute(env: soroban_sdk::Env, from: soroban_sdk::Address, amount: i128) -> bool
Returns the monthly target amount.
fn get_target(env: soroban_sdk::Env) -> i128
Initializes one family support pool. token = Stellar asset contract address for USDC-like demo token. parent = HatiHatid wallet that receives the final family payout. target = required pooled amount before release, e.g. 160 USDC in the demo.
fn initialize(
env: soroban_sdk::Env,
token: soroban_sdk::Address,
parent: soroban_sdk::Address,
target: i128,
)
Returns the current monthly pool balance held by the contract.
fn get_balance(env: soroban_sdk::Env) -> i128
Returns true after the monthly family payout has been released.
fn is_released(env: soroban_sdk::Env) -> bool
Returns true when an Extra Ambag request is currently active.
fn extra_active(env: soroban_sdk::Env) -> bool
A sibling approves the Extra Ambag request. The MVP rule is 2 approvals before the supplemental pool can accept contributions.
fn approve_extra(env: soroban_sdk::Env, sibling: soroban_sdk::Address) -> u32
Returns true after the Extra Ambag payout has been released.
fn extra_released(env: soroban_sdk::Env) -> bool
Returns whether the contract was initialized.
fn is_initialized(env: soroban_sdk::Env) -> bool
OFW sibling contributes to the approved Extra Ambag request. Once the emergency amount is fully funded, the contract releases it to the parent wallet. Returns true only when this contribution triggered the emergency payout.
fn contribute_extra(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
amount: i128,
) -> bool
Returns how much a specific sibling has contributed to the monthly pool.
fn get_contribution(env: soroban_sdk::Env, sibling: soroban_sdk::Address) -> i128
Returns the requested Extra Ambag amount.
fn get_extra_amount(env: soroban_sdk::Env) -> i128
Returns the reason text for the Extra Ambag request, e.g. "Medicine".
fn get_extra_reason(env: soroban_sdk::Env) -> soroban_sdk::String
Returns current funded balance of the Extra Ambag pool.
fn get_extra_balance(env: soroban_sdk::Env) -> i128
Parent creates an Extra Ambag request for medicine, bills, tuition, etc. This does not modify the original monthly pool; it opens a separate supplemental pool.
fn create_extra_request(
env: soroban_sdk::Env,
parent: soroban_sdk::Address,
amount: i128,
reason: soroban_sdk::String,
)
Returns a sibling's total contribution to the Extra Ambag request.
fn get_extra_contribution(env: soroban_sdk::Env, sibling: soroban_sdk::Address) -> i128
Returns how many siblings approved the Extra Ambag request.
fn get_extra_approval_count(env: soroban_sdk::Env) -> u32