Contract 103b724dcaa8d5b133870acf743cb74f8400c173b2a50bb113f928cb986dc947

← Back to Index 📥 Download WASM

Meta

cliver 23.2.0#8c559e832fd969aa469784b66e70891fadf94f0a
rssdkver 23.5.1#59fcef437260ed4da42d1efb357137a5c166c02e
rsver 1.94.0-nightly

Instances

  • CA3UHSNB4BVXGYQEEWLBE27LRNOXWTOBZJZMY4O7FUAPJHCO7QKTZPJL
  • CACWAPMW2J6CV3MIB5S2VCCNUPEN7PXXXZXEFADOEAQUD3IBHJIHIN54
  • CAMJ77CATAMTJ3AR7WKQNA2OTXULVUH347YNOR3YOCL63TZSQSUGEHHT
  • CAOR7LQCGQ2BI3FHBIILDUVAI3YMPLKBP6U6APFUD2FNLIACPAZOS3HO
  • CBJAWBV3QSDNQQPYC63I55PDYWCXKKWPJRPWQHJRUUPXBECOZEUAKUAT
  • CCOBD5YA7EKMJTM4VXAHVY3KJD5BEKPFR6BKBQTNXUCUXQ4LWQTRHQ7G
  • CD4C7HKXHXRGVFFCZ42TVVRB6HTFBDJKTRYGUJTAC6JWG2D5WLXAEBLS
  • CDGZMPERLCRBXEG7INQYHI4C552SZHQH6D4N4UOYTF7BO34ERKU4JBLH

Interface

UPGRADE: Upgrade the contract WASM to a new version. Requires passkey signature. Challenge: SHA256("upgrade" | new_wasm_hash | nonce)

fn upgrade(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
    signature: soroban_sdk::BytesN<64>,
    auth_data: soroban_sdk::Bytes,
    client_data_json: soroban_sdk::Bytes,
)

Read current nonce (kept for backwards compatibility with immediate transfers).

fn get_nonce(env: soroban_sdk::Env) -> u64

Check if a transaction ID has been used. Returns true if the tx_id has already been executed.

fn is_tx_used(env: soroban_sdk::Env, tx_id: soroban_sdk::BytesN<32>) -> bool

STREAM PAY: Transfer USDC with name, comment metadata and 0.03% fee. Same passkey verification as transfer_usdc. Emits an event with all details. Fee (0.03% of amount) goes to FEE_RECIPIENT, remainder goes to recipient.

fn stream_pay(
    env: soroban_sdk::Env,
    name: soroban_sdk::String,
    comment: soroban_sdk::String,
    recipient: soroban_sdk::Address,
    amount: i128,
    signature: soroban_sdk::BytesN<64>,
    auth_data: soroban_sdk::Bytes,
    client_data_json: soroban_sdk::Bytes,
)

Read the stored passkey pubkey (for debugging/verification).

fn get_passkey(env: soroban_sdk::Env) -> soroban_sdk::BytesN<65>
fn __check_auth(
    env: soroban_sdk::Env,
    signature_payload: soroban_sdk::BytesN<32>,
    signature: ZkAuthSignature,
    auth_context: soroban_sdk::Vec,
) -> Result<(), soroban_sdk::Error>

Constructor: Initialize the contract with the passkey secp256r1 public key (65-byte uncompressed). This is called automatically when the contract is deployed via factory with constructor_args.

fn __constructor(env: soroban_sdk::Env, passkey_pubkey: soroban_sdk::BytesN<65>)

IMMEDIATE TRANSFER: Transfer USDC using sequential nonce (for backwards compatibility). Only the registered passkey can authorize.

fn transfer_usdc(
    env: soroban_sdk::Env,
    recipient: soroban_sdk::Address,
    amount: i128,
    signature: soroban_sdk::BytesN<64>,
    auth_data: soroban_sdk::Bytes,
    client_data_json: soroban_sdk::Bytes,
)

CANCEL SCHEDULED TRANSFER: Cancel a pending scheduled payment.

The user must sign to prove ownership. Once cancelled, the tx_id is marked as used and can never be executed.

The challenge format: SHA256("cancel_scheduled" | tx_id)

tx_id: The transaction ID to cancel

fn cancel_scheduled(
    env: soroban_sdk::Env,
    tx_id: soroban_sdk::BytesN<32>,
    signature: soroban_sdk::BytesN<64>,
    auth_data: soroban_sdk::Bytes,
    client_data_json: soroban_sdk::Bytes,
) -> bool

Get USDC balance of this smart account.

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

SCHEDULED TRANSFER: Transfer USDC using a unique tx_id (for scheduled/auto-pay).

This version uses a unique transaction ID instead of sequential nonce, allowing transactions to be executed in ANY order.

Each tx_id can only be used once. Perfect for:

  • Scheduled payments (execute at specific time)
  • Recurring payments (pre-sign multiple with different tx_ids)
  • Out-of-order execution

The challenge format: SHA256("scheduled_transfer" | recipient | amount | tx_id | deadline)

tx_id: A unique 32-byte identifier (e.g., random bytes or hash of tx details) deadline: Unix timestamp after which this tx is invalid (0 = no deadline)

fn scheduled_transfer(
    env: soroban_sdk::Env,
    recipient: soroban_sdk::Address,
    amount: i128,
    tx_id: soroban_sdk::BytesN<32>,
    deadline: u64,
    signature: soroban_sdk::BytesN<64>,
    auth_data: soroban_sdk::Bytes,
    client_data_json: soroban_sdk::Bytes,
)

Imports

WebAssembly Text (WAT) ▶