Contract 4aa7d889845894e482539cf834a8dcc0c84534762b0f66eb99a15358f67f0912

← Back to Index 📥 Download WASM

Meta

binver 0.1.0
rssdkver 23.5.1#59fcef437260ed4da42d1efb357137a5c166c02e
rsver 1.93.1

Instances

  • CC4LJJ657M3VXUK76N27XMLP2WOAUOTY4TAHVU3HGVNGX5OKZIQ2WKWM

Interface

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.

Arguments

  • owner - The owner address that can update the WASM hash
  • upgrader - The upgrader address that can upgrade the factory
  • oracle_wasm_hash - The WASM hash of the oracle contract to deploy

Errors

  • AlreadyInitialized - Factory has already been initialized
fn 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.

Errors

  • NotInitialized - Factory has not been initialized
  • NoUpgraderSet - No upgrader has been set
  • Unauthorized - Caller is not the current upgrader
fn 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.

Arguments

  • oracle_owner - The owner of the new oracle
  • pt - The PT token address being priced
  • maturity - The maturity timestamp
  • initial_implied_apy - The initial implied APY (18 decimals)
  • future_pt_value - The future PT value at maturity
  • decimals - The decimals for the price output

Returns the address of the newly deployed oracle.

Errors

  • NotInitialized - Factory has not been initialized
fn 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.

Errors

  • NotInitialized - Factory has not been initialized
fn get_oracle_wasm_hash(
    env: soroban_sdk::Env,
) -> Result, FactoryError>

Update the oracle WASM hash. Only callable by the owner.

Errors

  • NotInitialized - Factory has not been initialized
fn set_oracle_wasm_hash(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), FactoryError>

Imports

WebAssembly Text (WAT) ▶