Contract eb2e8262657c60520b23c1a02e329257a8cca512329efa30c9c72db6fd799680

← Back to Index 📥 Download WASM

Meta

rssdkver 21.7.7#5da789c50b18a4c2be53394138212fed56f0dfc4
rsver 1.96.0

Instances

  • CCWDMIPD4ZTTIV5LR53PD325MS6VRGF3WJEJRKNCIKK3G7H6AXJ3UE4F

Interface

One-time initializer wiring the native XLM token contract address. After init, the token reference is immutable — there is no setter.

fn init(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Add more funds to an existing vault. Does not alter unlock_timestamp.

fn deposit(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    vault_id: u64,
    amount: i128,
) -> Result<(), soroban_sdk::Error>

Withdraw the full vault balance to the owner address. Reverts with StillLocked if env.ledger().timestamp() < unlock_timestamp.

fn withdraw(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    vault_id: u64,
) -> Result

Read-only — fetch a vault by id.

fn get_vault(env: soroban_sdk::Env, vault_id: u64) -> Result

Read-only — list vault ids owned by owner.

fn list_owned(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
) -> soroban_sdk::Vec

Push the unlock timestamp further into the future by additional_seconds. Reducing or zeroing the lock is impossible — there is no set_unlock API.

fn extend_lock(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    vault_id: u64,
    additional_seconds: u64,
) -> Result

Create a vault and lock initial_deposit of the configured asset. unlock_timestamp is recorded immutably; it can only ever be PUSHED FORWARD via extend_lock.

fn create_vault(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    name: soroban_sdk::String,
    initial_deposit: i128,
    unlock_timestamp: u64,
) -> Result

Imports

WebAssembly Text (WAT) ▶