fn boost(env: soroban_sdk::Env, vault: soroban_sdk::Address, amount: i128)
fn deposit(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
vault: soroban_sdk::Address,
amount: i128,
)
Sends amount tokens from a campaign's tracked budget to to. Admin
only. Used for refunds (returning unspent budget to depositors) or for
reallocating between vaults.
⚠️ This function grants the admin role full power to drain any
campaign's available() budget to any address. Depositors should be
aware that admin can redirect their funds — this is by design, the
admin is the trusted operator of the treasury. For tokens that arrived
OUTSIDE deposit() (direct transfers, dust, mistaken sends), use
rescue_orphan instead, which is bounded by the campaign-tracked totals
and cannot accidentally move funds attributed to a campaign.
fn transfer(
env: soroban_sdk::Env,
vault: soroban_sdk::Address,
amount: i128,
to: soroban_sdk::Address,
)
fn get_admin(env: soroban_sdk::Env) -> soroban_sdk::Address
fn get_manager(env: soroban_sdk::Env) -> soroban_sdk::Address
fn set_manager(env: soroban_sdk::Env, new_manager: soroban_sdk::Address)
Accepts a pending admin transfer. Must be called by the exact address that was previously proposed. Clears the pending slot on success.
fn accept_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)
fn get_campaign(env: soroban_sdk::Env, vault: soroban_sdk::Address) -> Campaign
fn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
manager: soroban_sdk::Address,
)
Proposes a new admin. The new address must call accept_admin to take
the role. Calling again with a different address overwrites the pending
slot; calling with the current admin's own address effectively cancels.
fn propose_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)
Sweeps tokens out of the treasury that aren't accounted for in any campaign — direct transfers, refunds from a vault, dust, mistaken sends. Admin only.
The function computes orphan = balance(token) - sum_of_available() for
every campaign whose asset == token, and refuses to send more than
orphan. This bound ensures that an admin typo cannot move tokens
attributed to an active campaign — rescue_orphan is strictly safer
than transfer() for handling unaccounted balances.
fn rescue_orphan(
env: soroban_sdk::Env,
token: soroban_sdk::Address,
to: soroban_sdk::Address,
amount: i128,
)
fn update_campaign(env: soroban_sdk::Env, vault: soroban_sdk::Address, active: bool)
fn get_pending_admin(env: soroban_sdk::Env) -> Option
Registers a boost campaign for a single-asset DeFindex vault. Admin must
pass asset explicitly and the contract asserts the vault's
get_assets() returns the same address — this prevents a malicious or
misconfigured vault from steering subsequent deposit / boost token
transfers to an unexpected token.
fn register_campaign(
env: soroban_sdk::Env,
vault: soroban_sdk::Address,
asset: soroban_sdk::Address,
)
fn unregister_campaign(env: soroban_sdk::Env, vault: soroban_sdk::Address)