Withdraws the currently releasable amount to the recipient, on the recipient's own authorization. Partial and repeatable; the cumulative withdrawal can never exceed the amount vested to date.
fn claim(env: soroban_sdk::Env, id: u64) -> i128
Refunds exactly the unvested remainder to the sender, on the sender's authorization and only if the Lockup was created cancelable. Everything vested at this instant stays claimable by the recipient forever.
fn cancel(env: soroban_sdk::Env, id: u64) -> i128
Pushes the currently releasable amount to the recipient without the recipient's signature, so a treasurer can drive payouts. Funds can only ever move to the recipient, so this path grants no extra power over escrow.
Because anyone may call it, a payout must clear MIN_RELEASE_BPS of the
deposit — the floor stops a third party forcing a dust transfer every
ledger, which would bleed the recipient on a token that charges per
transfer. It lifts as soon as nothing more can accrue, so the final
remainder is always sweepable however the Lockup ended, and claim never
applies it.
fn release(env: soroban_sdk::Env, id: u64) -> i128
Reads a Lockup by id, with its status, vested total, and claimable amount resolved at the current ledger timestamp.
fn get_lockup(env: soroban_sdk::Env, id: u64) -> LockupView
Sets the administrator, whose only power is the creation kill-switch — it can never touch escrowed funds, pause claims, or upgrade the contract.
Requiring the admin's own authorization stops an address being named administrator without its consent. It does not stop a third party initializing the instance with an address they control before the deployer gets there — only a deploy-time constructor closes that, which the workspace's SDK predates.
fn initialize(env: soroban_sdk::Env, admin: soroban_sdk::Address)
Creates one Lockup per (recipient, amount) pair under a shared schedule and
batch id, pulling the total deposit into escrow with a single
transfer_from (approve-then-act) and returning the new ids in recipient
order. The service fee moves before the escrow pull; a zero fee_amount
skips it.
batch_ref is the sender's own name for the batch, which is what lets a
recipient list too large for one transaction land as a single batch: every
call under the same reference joins the batch the first one opened, and
None always opens a fresh one. References live in the sender's own
namespace, so one caller can never join another's batch.
fn create_batch(
env: soroban_sdk::Env,
sender: soroban_sdk::Address,
token: soroban_sdk::Address,
recipients: soroban_sdk::Vec,
amounts: soroban_sdk::Vec,
schedule: Schedule,
cancelable: bool,
batch_ref: Option,
fee_token: soroban_sdk::Address,
fee_recipient: soroban_sdk::Address,
fee_amount: i128,
) -> soroban_sdk::Vec
Returns the amount of a Lockup claimable at the current ledger timestamp.
fn get_releasable(env: soroban_sdk::Env, id: u64) -> i128
Returns one page of the Lockup ids belonging to batch_id, alongside how
many pages exist.
fn get_batch_index(env: soroban_sdk::Env, batch_id: u64, page: u32) -> IndexPage
Returns one page of the Lockup ids created by creator, alongside how many
pages exist. Page 0 is always readable — an address with no Lockups reports
a page count of 0 and no ids — and any later page past the count panics
with PageOutOfRange. Every paged read below follows the same rule.
fn get_creator_index(
env: soroban_sdk::Env,
creator: soroban_sdk::Address,
page: u32,
) -> IndexPage
fn is_creation_paused(env: soroban_sdk::Env) -> bool
Returns one page of the Lockup ids vesting to recipient, alongside how
many pages exist.
fn get_recipient_index(
env: soroban_sdk::Env,
recipient: soroban_sdk::Address,
page: u32,
) -> IndexPage
Engages or lifts the creation kill-switch, which blocks create_batch
only. Claims, releases, and cancellations remain callable in every state.
fn set_creation_paused(env: soroban_sdk::Env, paused: bool)
Hydrates one page of a batch's index into full Lockups. Reading a batch this way costs pages proportional to the batch, not to the creator's whole history, which is what keeps a batch addressable for a creator who has made many.
fn get_lockups_by_batch(env: soroban_sdk::Env, batch_id: u64, page: u32) -> LockupPage
Hydrates one page of a creator's index into full Lockups, carrying the page count so a client walking pages learns where to stop from this same call.
fn get_lockups_by_creator(
env: soroban_sdk::Env,
creator: soroban_sdk::Address,
page: u32,
) -> LockupPage
Hydrates one page of a recipient's index into full Lockups.
fn get_lockups_by_recipient(
env: soroban_sdk::Env,
recipient: soroban_sdk::Address,
page: u32,
) -> LockupPage