Contract f5431c199fa00a606cdcabed881c9fe519be946c5beba49f7f1a83f7a1108b4a

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#28484880988199233a7e8e87c97cb12dac323cb3
rssdkver 21.7.7#5da789c50b18a4c2be53394138212fed56f0dfc4
rsver 1.94.1

Instances

  • CBVPTZLATOL63QV4OZWOFFYP3MW7L74MRUCTEVWSB3C3CM4V4MPPFJ27

Interface

fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address

Sweep any tokens stuck in the contract to the vault (admin only).

fn sweep(env: soroban_sdk::Env, asset: soroban_sdk::Address, amount: i128)
fn fee_vault(env: soroban_sdk::Env) -> soroban_sdk::Address

Transfer admin to a new address (only current admin).

fn set_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)

Collect a fee on any token transfer (reusable for Aquarius, etc.). User sends gross_amount to this contract, which splits it.

Unlike withdraw_with_fee, this doesn't call a pool — the caller must have already transferred tokens to this contract.

fn split_fee(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    gross_amount: i128,
    principal: i128,
) -> (i128, i128)

One-time initialization. Sets admin, vault address, and fee rate. fee_rate_bps: 1500 = 15%, 1000 = 10%, 500 = 5%

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    fee_vault: soroban_sdk::Address,
    fee_rate_bps: u32,
)
fn fee_rate_bps(env: soroban_sdk::Env) -> u32

Update the fee rate (only admin).

fn set_fee_rate(env: soroban_sdk::Env, new_rate_bps: u32)

Update the fee vault address (only admin).

fn set_fee_vault(env: soroban_sdk::Env, new_vault: soroban_sdk::Address)

Withdraw from a lending pool, atomically deduct Nestor's fee, and send the net amount to the user.

Arguments

  • user — the user's address (must authorize)
  • pool — the lending pool contract address (e.g. Blend)
  • asset — the SAC token contract address (e.g. USDC)
  • amount — total amount to withdraw from the pool (stroops, 7 dec)
  • principal — original deposit amount (stroops, 7 dec) fee is only charged on (amount − principal), i.e. yield

Returns

Tuple of (user_receives, fee_collected) both in stroops.

fn withdraw_with_fee(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    pool: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    amount: i128,
    principal: i128,
) -> (i128, i128)

Imports

WebAssembly Text (WAT) ▶