Contract b3c988b2a5406d123189ec545b46daf836f391e93b60541f5f8e8a5849185b9c

← Back to Index 📥 Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 26.0.1#f52b6aad85f18c5e312ff3f60e57cb613274e6bb
rsver 1.95.0

Instances

  • CDCYXCVRVFXEM7D76EIM6CSYJJMUJFVDCBH25FLVJFDZMDSMLNHRRYKS

Interface

Buy tres_amount (TRES base units) paying the payment asset at the current price. Returns the payment cost in stroops. The buyer authorizes both this call and the payment transfer out of their account.

fn buy(env: soroban_sdk::Env, buyer: soroban_sdk::Address, tres_amount: i128) -> i128
fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address
fn price(env: soroban_sdk::Env) -> i128

Payment cost (stroops) for tres_amount TRES base units at the current price.

fn quote(env: soroban_sdk::Env, tres_amount: i128) -> i128
fn treasury(env: soroban_sdk::Env) -> soroban_sdk::Address

TRES still available for sale (contract balance, in base units).

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

Admin: update the fixed price (payment-asset stroops per whole TRES).

fn set_price(env: soroban_sdk::Env, price: i128)

Admin: change where incoming payment is sent.

fn set_treasury(env: soroban_sdk::Env, treasury: soroban_sdk::Address)

Runs once at deploy. price is payment-asset stroops per one whole TRES.

fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    tres_sac: soroban_sdk::Address,
    pay_sac: soroban_sdk::Address,
    treasury: soroban_sdk::Address,
    price: i128,
)

Admin: recover unsold TRES from the contract.

fn withdraw_tres(env: soroban_sdk::Env, to: soroban_sdk::Address, amount: i128)

Imports

WebAssembly Text (WAT) ▶