Contract 8fcbe728309356fdf3947bbea206fe1f4af93fa8be913c83f61765f30186903a

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.89.0

Instances

  • CAPPYXSC2OCS6S62PM2TW4EWMKAINRFOSTAH5SI23PJX72B3STU6GWTH

Interface

One-time setup. Records the admin and the streamed token (XLM SAC) and unpauses the contract.

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

Lock total_amount of the configured token into a new stream and return its id. Vesting runs linearly from start_time to end_time.

Auth: requires the payer's signature. The same authorization covers the inner SAC transfer(payer -> contract).

fn create_stream(
    env: soroban_sdk::Env,
    payer: soroban_sdk::Address,
    recipient: soroban_sdk::Address,
    total_amount: i128,
    start_time: u64,
    end_time: u64,
) -> Result

Withdraw everything that has vested but not yet been paid out. Funds are always sent to the stream's fixed recipient, so this is intentionally permissionless (anyone may poke it; nobody but the recipient can be paid). Returns the amount transferred.

fn withdraw(env: soroban_sdk::Env, stream_id: u64) -> Result

Stop a stream early. The payer settles whatever has vested so far to the recipient and reclaims the unvested remainder. Returns the reclaimed amount.

Auth: requires the payer's signature.

fn stop(env: soroban_sdk::Env, stream_id: u64) -> Result
fn get_stream(
    env: soroban_sdk::Env,
    stream_id: u64,
) -> Result

Total amount vested so far for a stream (independent of withdrawals).

fn vested_amount(
    env: soroban_sdk::Env,
    stream_id: u64,
) -> Result

Amount the recipient could withdraw right now (vested - withdrawn).

fn withdrawable(
    env: soroban_sdk::Env,
    stream_id: u64,
) -> Result
fn total_streams(env: soroban_sdk::Env) -> u64
fn is_paused(env: soroban_sdk::Env) -> bool
fn get_admin(env: soroban_sdk::Env) -> Result
fn get_token(env: soroban_sdk::Env) -> Result
fn pause(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>
fn unpause(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>
fn set_admin(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Replace the contract's own code (admin-gated). Enables shipping fixes without migrating stream state — important for a mainnet (L6) deploy.

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

Imports

WebAssembly Text (WAT) ▶