Contract d3019fe8ea30d7265546e2ad134f30812e4460973ddea741d2a163ff2d89fba0

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 27.0.1#19a2d480fffa003e739db7cbee0249111dbfd05c
rsver 1.97.1

Instances

  • CBAPNW2Z6KOV3EJJKS45WPRJBGFIVMSJJVFN4Z5NXNKH7UFE5WWBHYS4
  • CCAKUGVEX7QTBAJ7WKZK7RIVGOOBMX4352AAA3CJLMVGH2ID5NCSIMYS

Interface

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

Imports

WebAssembly Text (WAT) ▶