Contract a50deb171f35f569e06095530f4386df9937d9c0ca8c5dc38f3721724db26f85

← Back to Index 📥 Download WASM

Meta

rssdkver 23.0.3#6aa930b08eabfd578b7824a0d5de473cbd958282
rsver 1.95.0

Instances

  • CBIU5YUBAIDIK75VM647PNPJ4GXE23UUPKV53OVTON656YK7SLOPX7PY

Interface

(Only Owner) Sweep token balances from the contract to to.

fn claim(
    env: soroban_sdk::Env,
    to: soroban_sdk::Address,
    assets: soroban_sdk::Vec,
) -> soroban_sdk::Map

(Only Owner) Deposit USDC from owner into the contract's supply position in source_pool. This is how the owner capitalizes or tops up the contract without needing programmatic access to C-account positions through a wallet UI.

fn deposit(env: soroban_sdk::Env, amount: i128)

(Only Owner) Upgrade the contract to new WASM. The contract ID and all stored state (owner, position, submitters) are preserved.

fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)

(Only Owner) Withdraw USDC from the contract's source_pool position to any address (typically the owner's own wallet). Transfers the amount the pool actually released — Blend caps a withdraw at the available position and rounds in bToken terms, so transferring the realized delta (rather than the requested amount) avoids the off-by-rounding revert.

fn withdraw(env: soroban_sdk::Env, to: soroban_sdk::Address, amount: i128)
fn get_owner(env: soroban_sdk::Env) -> soroban_sdk::Address

(Only Owner) Rotate ownership.

fn set_owner(env: soroban_sdk::Env, new_owner: soroban_sdk::Address)

(Only Owner) Drain the entire USDC position in source_pool to to in one transaction. Passes i128::MAX to the pool (Blend caps it at the live position) and sweeps the full resulting USDC balance, so no caller-side balance query or rounding buffer is needed.

fn withdraw_all(env: soroban_sdk::Env, to: soroban_sdk::Address) -> i128

Initialize the contract.

Arguments

  • owner - Controls claim, withdraw, set_owner, set_source_pool, set_submitters, upgrade.
  • backstop - Blend backstop contract address.
  • usdc - USDC token contract address.
  • source_pool - The Blend pool where this contract holds a USDC supply position. Withdrawals happen from here to fund fills.
  • submitters - Allowlist of accounts permitted to call fill_interest. The owner can update this later via set_submitters.
fn __constructor(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    backstop: soroban_sdk::Address,
    usdc: soroban_sdk::Address,
    source_pool: soroban_sdk::Address,
    submitters: soroban_sdk::Vec,
)

Fill an interest auction. The submitter must be on the allowlist and must authorize the call (it is the fee-bumped source account in the multi-submitter race). USDC is withdrawn from the contract's supply position in source_pool, converted to backstop LP tokens via Comet, and used to fill the auction in pool. Any unused USDC is re-supplied back to source_pool so it keeps earning interest.

Arguments

  • submitter - The racing account invoking this fill (must be allowlisted).
  • pool - Pool whose backstop has the interest auction.
  • fill_percent - Percentage to fill (1-100).
  • max_usdc_in - Upper bound of USDC to spend on this fill.
fn fill_interest(
    env: soroban_sdk::Env,
    submitter: soroban_sdk::Address,
    pool: soroban_sdk::Address,
    fill_percent: u32,
    max_usdc_in: i128,
)
fn get_submitters(env: soroban_sdk::Env) -> soroban_sdk::Vec

(Only Owner) Replace the fill_interest allowlist. Pass the full set of authorized submitter accounts (this overwrites, it does not append).

fn set_submitters(
    env: soroban_sdk::Env,
    submitters: soroban_sdk::Vec,
)
fn get_source_pool(env: soroban_sdk::Env) -> soroban_sdk::Address

(Only Owner) Change the pool this contract withdraws USDC from.

fn set_source_pool(env: soroban_sdk::Env, new_pool: soroban_sdk::Address)

Imports

WebAssembly Text (WAT) ▶