Contract 8382ff90b60f888ea2c3080743de58153236d01faf2ef480abb46ae2a5bbbfcc

← Back to Index 📥 Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 23.4.0#673d6c4f2368d282d25da29bda55c21b8be69ca6
rsver 1.95.0

Instances

  • CBOEWEFDW2PUOQVCEZJ53YTC2DXXZOREIT76WSZO43OCBDLXBQO7DHAP

Interface

fn base(env: soroban_sdk::Env) -> Asset

Important:

Returns a list of registered assets as [Asset::Stellar] variants

fn assets(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn decimals(env: soroban_sdk::Env) -> u32

Adds an asset to the aggregation list

Arguments

  • ticker - symbol of the asset that is added
  • token_address - token contract's address on the Stellar ledger of the asset that is being added
  • max_dev_bps - max allowed deviation in basis points between 2 consecutive price retrievals
  • max_dev_consecutive_diff_secs - max time difference in seconds between 2 consecutive price retrievals that will account for deviation
fn add_asset(
    env: soroban_sdk::Env,
    ticker: soroban_sdk::Symbol,
    token_address: soroban_sdk::Address,
    max_dev_bps: u32,
    max_dev_consecutive_diff_secs: u64,
) -> Result<(), AOCError>
fn lastprice(env: soroban_sdk::Env, asset: Asset) -> Option

Returns the list of all aggregated oracles configurations

fn get_oracles(env: soroban_sdk::Env) -> soroban_sdk::Vec

Constructs the oracle contract

Arguments

  • admin - contract's administrator
  • base_asset - asset that will be the result of the base() endpoint call
  • decimals - number of decimals in the aggregated price
  • max_age - max allowed age(in seconds) of oracle's price that's being aggregated
  • oracles - list of information about oracles that are being aggregated
fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    base_asset: Asset,
    decimals: u32,
    max_age: u64,
    oracles: soroban_sdk::Vec,
)

Proposes a new oracle's admin

fn propose_new_admin(
    env: soroban_sdk::Env,
    proposed_admin: soroban_sdk::Address,
) -> Result<(), AOCError>
fn accept_proposed_admin(env: soroban_sdk::Env) -> Result<(), AOCError>

Imports

WebAssembly Text (WAT) ▶