Current admin address.
fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address
Current price in XLM stroops per 1 LBX (10^7 units).
fn price(env: soroban_sdk::Env) -> i128
Buy LBX tokens by sending XLM.
buyer: The address paying XLM (may be a lockb0x C-address or G-address).dest_lockb0x: The destination C-address receiving LBX tokens.xlm_amount: The amount of XLM to spend (stroops).Returns the amount of LBX delivered (stroops).
When buyer is a lockb0x, require_auth() triggers __check_auth
which sees a SAC transfer context under domain LBXCTXV1.
fn buy_lbx(
env: soroban_sdk::Env,
buyer: soroban_sdk::Address,
dest_lockb0x: soroban_sdk::Address,
xlm_amount: i128,
min_lbx_out: i128,
) -> i128
LBX SAC contract address.
fn lbx_sac(env: soroban_sdk::Env) -> soroban_sdk::Address
Admin-only: upgrade the contract WASM.
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
XLM SAC contract address.
fn xlm_sac(env: soroban_sdk::Env) -> soroban_sdk::Address
Admin-only: withdraw tokens from this contract (e.g. accumulated XLM).
fn withdraw(
env: soroban_sdk::Env,
token: soroban_sdk::Address,
to: soroban_sdk::Address,
amount: i128,
)
Transfer admin role. Admin-only.
fn set_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)
Update the XLM-per-LBX price (in stroops). Admin-only.
fn set_price(env: soroban_sdk::Env, price_xlm_per_lbx: i128)
Maximum LBX that can be purchased in a single transaction (stroops).
fn max_purchase(env: soroban_sdk::Env) -> i128
Atomically initialize the vendor with SAC addresses and pricing.
fn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
xlm_sac: soroban_sdk::Address,
lbx_sac: soroban_sdk::Address,
price_xlm_per_lbx: i128,
max_purchase: i128,
bootstrap_grant_amount: i128,
)
Deliver the constructor-fixed LBX Starter Pack amount exactly once.
The trusted bootstrap service derives grant_id from its durable
redemption record. Keeping the replay record in contract storage means
a service retry cannot mint a second package after an uncertain result.
fn grant_bootstrap(
env: soroban_sdk::Env,
grant_id: soroban_sdk::BytesN<32>,
recipient: soroban_sdk::Address,
) -> i128
Update the maximum LBX purchase amount per transaction (in stroops). Admin-only.
fn set_max_purchase(env: soroban_sdk::Env, max_purchase: i128)
Constructor-fixed LBX amount delivered by grant_bootstrap.
fn bootstrap_grant_amount(env: soroban_sdk::Env) -> i128