Contract d981274684cd0bd1248663e68f3285d120f0c8cc9c36d89439cb5327438c5236

← Back to Index 📥 Download WASM

Meta

cliver 27.1.0#8e402ea28202950b272fbabc34caad4d2f64fe87
rssdkver 21.7.7#5da789c50b18a4c2be53394138212fed56f0dfc4
rsver 1.95.0

Instances

  • CDYXKWVDGEVA6OSIGN7GRAPPRN6AKID35OJL5ZZQIBCMECZ35KGL45PS

Interface

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

Deposit XLM and receive sXLM tokens.

fn deposit(env: soroban_sdk::Env, user: soroban_sdk::Address, xlm_amount: i128)
fn unpause(env: soroban_sdk::Env)

Upgrade the contract WASM. Only callable by admin.

fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
fn is_paused(env: soroban_sdk::Env) -> bool
fn set_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)

Apply a governance-approved parameter change.

Only the configured governance contract may call this, and only these keys exist — an approved proposal naming anything else does nothing rather than silently succeeding.

fn set_param(env: soroban_sdk::Env, key: soroban_sdk::Symbol, value: i128)

Lend idle XLM for the length of one transaction.

The receiver is called once and must return the amount plus the fee before this function returns. There is no credit risk: if the balance is not restored the assertion fails and the whole transaction reverts, loan included. The fee stays in the vault, so it raises the exchange rate.

Deposits, withdrawals and claims are blocked for the duration. Without that, a borrower could satisfy the balance check by depositing the borrowed XLM and mint themselves shares out of the loan.

fn flash_loan(env: soroban_sdk::Env, receiver: soroban_sdk::Address, amount: i128)
fn governance(env: soroban_sdk::Env) -> soroban_sdk::Address

Initialize the staking contract.

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    sxlm_token: soroban_sdk::Address,
    native_token: soroban_sdk::Address,
    cooldown_period: u32,
)

One-shot storage migration for a contract deployed before derived accounting.

Reconstructs PendingWithdrawals by summing unclaimed queue entries. Required once on any contract upgraded from a build that did not record the liability, or total_assets() counts XLM already owed to the queue.

Legacy TotalXlmStaked, TotalSxlmSupply and LiquidityBuffer entries are left orphaned; nothing reads them.

fn migrate_v2(env: soroban_sdk::Env)

Contribute realised yield to the vault.

The XLM is transferred in. There is no counter to increment: the deposit raises the contract balance, total_assets() reads that balance, and the exchange rate follows. The protocol fee is booked as a liability so it is excluded from the assets backing shares until it is withdrawn.

fn add_rewards(env: soroban_sdk::Env, from: soroban_sdk::Address, amount: i128)

Raw XLM held by the contract, including encumbered amounts.

fn idle_balance(env: soroban_sdk::Env) -> i128
fn set_treasury(env: soroban_sdk::Env, treasury: soroban_sdk::Address)

XLM backing sXLM shares.

fn total_assets(env: soroban_sdk::Env) -> i128

Donate XLM to the vault with no shares minted in return.

No separate buffer counter: the donated XLM is part of the balance, so it backs shares like any other asset.

fn add_liquidity(env: soroban_sdk::Env, from: soroban_sdk::Address, amount: i128)

Bump instance TTL — can be called by anyone to keep the contract alive.

fn bump_instance(env: soroban_sdk::Env)
fn flash_fee_bps(env: soroban_sdk::Env) -> i128

Withdraw protocol fees to the admin address. If amount > 0, withdraw that specific amount; if 0, withdraw all.

fn withdraw_fees(env: soroban_sdk::Env, amount: i128)
fn get_withdrawal(env: soroban_sdk::Env, withdrawal_id: u64) -> WithdrawalRequest

Hand parameter control to the governance contract, once.

This is the step that makes a passed proposal actually do something. It is deliberately separate from deploying the code: handing over control of a live contract is a decision, not a side effect of an upgrade.

fn set_governance(env: soroban_sdk::Env, governance: soroban_sdk::Address)

Claim a delayed withdrawal after cooldown has expired.

fn claim_withdrawal(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    withdrawal_id: u64,
)

XLM free to pay out right now.

fn liquidity_buffer(env: soroban_sdk::Env) -> i128
fn protocol_fee_bps(env: soroban_sdk::Env) -> i128

Retained for client compatibility; identical to total_assets.

fn total_xlm_staked(env: soroban_sdk::Env) -> i128
fn treasury_balance(env: soroban_sdk::Env) -> i128
fn get_exchange_rate(env: soroban_sdk::Env) -> i128
fn total_sxlm_supply(env: soroban_sdk::Env) -> i128

Request withdrawal: burns sXLM and returns XLM.

fn request_withdrawal(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    sxlm_amount: i128,
)
fn withdrawal_fee_bps(env: soroban_sdk::Env) -> i128
fn get_cooldown_period(env: soroban_sdk::Env) -> u32

XLM owed to withdrawals whose shares are already burned.

fn pending_withdrawals(env: soroban_sdk::Env) -> i128
fn set_cooldown_period(env: soroban_sdk::Env, new_cooldown: u32)
fn deployed_to_strategies(env: soroban_sdk::Env) -> i128

Imports

WebAssembly Text (WAT) ▶