Construct.
Note: __constructor (no double-underscore in Soroban 22) runs
automatically at deploy. We store the immutable display/metadata
fields here. The minter is set in a follow-up call from the
Factory (or YieldStripping) via [Self::initialize_minter].
fn __constructor(env: soroban_sdk::Env, args: PtInitArgs)
Set the minter exactly once. The factory calls this immediately
after deployment with the address of the parent YieldStripping
contract. Subsequent calls revert with AlreadyInitialized.
No require_auth here — calling this address is the bootstrap
privilege. In production deployments the factory wraps the entire
deploy + init pair in one transaction so no other principal can
race the call.
fn initialize_minter(env: soroban_sdk::Env, minter: soroban_sdk::Address)
fn name(env: soroban_sdk::Env) -> soroban_sdk::String
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::String
fn decimals(env: soroban_sdk::Env) -> u32
Maturity timestamp (Unix seconds). Display-only.
fn maturity(env: soroban_sdk::Env) -> u64
The minter address, or panics if not yet initialized.
fn minter(env: soroban_sdk::Env) -> soroban_sdk::Address
Total supply.
fn total_supply(env: soroban_sdk::Env) -> i128
fn balance(env: soroban_sdk::Env, id: soroban_sdk::Address) -> i128
fn transfer(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
amount: i128,
)
fn transfer_from(
env: soroban_sdk::Env,
spender: soroban_sdk::Address,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
amount: i128,
)
fn approve(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
spender: soroban_sdk::Address,
amount: i128,
expiration_ledger: u32,
)
fn allowance(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
spender: soroban_sdk::Address,
) -> i128
Mint amount PT to to. Callable only by the configured minter.
fn mint(env: soroban_sdk::Env, to: soroban_sdk::Address, amount: i128)
Burn amount PT from from. Callable only by the configured
minter; bypasses allowance because the minter is the protocol.
fn burn(env: soroban_sdk::Env, from: soroban_sdk::Address, amount: i128)