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)