fn upgrade(
env: soroban_sdk::Env,
new_wasm_hash: soroban_sdk::BytesN<32>,
operator: soroban_sdk::Address,
)
Get the owner address.
fn get_owner(env: soroban_sdk::Env) -> Option
Initialize the factory with the oracle WASM hash.
owner - The owner address that can update the WASM hashupgrader - The upgrader address that can upgrade the factoryoracle_wasm_hash - The WASM hash of the oracle contract to deployAlreadyInitialized - Factory has already been initializedfn initialize(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
upgrader: soroban_sdk::Address,
oracle_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), FactoryError>
Get the upgrader address.
fn get_upgrader(env: soroban_sdk::Env) -> Option
Set a new upgrader address. Only callable by the current upgrader.
The upgrader role is independent from ownership — the owner cannot change the upgrader, and the upgrader cannot perform owner actions.
NotInitialized - Factory has not been initializedNoUpgraderSet - No upgrader has been setUnauthorized - Caller is not the current upgraderfn set_upgrader(
env: soroban_sdk::Env,
new_upgrader: soroban_sdk::Address,
) -> Result<(), FactoryError>
Deploy a new oracle contract.
The salt is derived on-chain from the oracle parameters, so each parameter tuple has a canonical address.
oracle_owner - The owner of the new oraclept - The PT token address being pricedmaturity - The maturity timestampinitial_implied_apy - The initial implied APY (18 decimals)future_pt_value - The future PT value at maturitydecimals - The decimals for the price outputReturns the address of the newly deployed oracle.
NotInitialized - Factory has not been initializedfn deploy_oracle(
env: soroban_sdk::Env,
oracle_owner: soroban_sdk::Address,
pt: soroban_sdk::Address,
maturity: u64,
initial_implied_apy: i128,
future_pt_value: i128,
decimals: u32,
) -> Result
Accept ownership transfer. Must be called by the pending owner.
fn accept_ownership(env: soroban_sdk::Env)
Renounce ownership permanently. Only callable by the owner.
fn renounce_ownership(env: soroban_sdk::Env)
Transfer ownership to a new address. Only callable by the current owner.
fn transfer_ownership(
env: soroban_sdk::Env,
new_owner: soroban_sdk::Address,
live_until_ledger: u32,
)
Get the oracle WASM hash.
NotInitialized - Factory has not been initializedfn get_oracle_wasm_hash(
env: soroban_sdk::Env,
) -> Result, FactoryError>
Update the oracle WASM hash. Only callable by the owner.
NotInitialized - Factory has not been initializedfn set_oracle_wasm_hash(
env: soroban_sdk::Env,
new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), FactoryError>