Contract d221683a32846eb77000b82fd172f95467f2c3c6f522272758e6a52cbb2a847a

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.94.1

Instances

  • CAI5XNUF67WFCLEZINO5PRYPIG5ORKM36YQIVJ7GASHNBVXHU57NPRAQ

Interface

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 to move budget out of the treasury. To move budget between campaigns without an external round-trip, use reallocate instead.

⚠️ 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

Moves amount of tracked budget from one campaign to another that uses the same asset, without any token leaving the treasury. Admin only.

This lets the operator rebalance budget between vaults directly, instead of transfer-ing to an interim wallet and re-deposit-ing. Both campaigns must already be registered and share the same asset. The treasury's real token balance is unchanged, so the per-token tracked total is preserved: source available() falls by amount and the destination's rises by the same amount.

fn reallocate(
    env: soroban_sdk::Env,
    from_vault: soroban_sdk::Address,
    to_vault: soroban_sdk::Address,
    amount: i128,
)
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)

Imports

WebAssembly Text (WAT) ▶