One-time setup. Records the admin and the escrow token (a SAC address, e.g. the native XLM contract). Zeroes the lock counter.
fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
token: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Escrow amount of the token until unlock_ledger. The owner's signature
authorizes both this call and the inner SAC transfer(owner -> contract).
Returns the new lock's id.
fn create_lock(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
amount: i128,
unlock_ledger: u32,
) -> Result
Reclaim a lock's funds to its owner. Fails TooEarly before the unlock
ledger, AlreadyClaimed if the funds were already returned, and
NotOwner if the caller is not the lock's owner.
fn claim(
env: soroban_sdk::Env,
lock_id: u64,
caller: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Every lock an owner holds, as (id, amount, unlock_ledger, claimed).
fn locks_for(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
) -> soroban_sdk::Vec<(u64, i128, u32, bool)>
fn get_lock(env: soroban_sdk::Env, lock_id: u64) -> Option
fn lock_count(env: soroban_sdk::Env) -> u64
fn get_admin(env: soroban_sdk::Env) -> Result
fn get_token(env: soroban_sdk::Env) -> Result