Contract f0eacac9bfcefad90ce25259dd2f9a605fe857bdf3159f7116e5774f19958916

← Back to Index 📥 Download WASM

Meta

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

Instances

  • CACR4LYJREWSE57GQOHT3T5BL765XWLFREOMX6X4K7XRA5BRO3BDUAZK

Interface

Constructs the adapter contract.

Arguments

  • admin - contract's administrator (can add feeds and update resolution)
  • base_asset - asset that will be the result of the base() endpoint call
  • decimals - number of decimals in the output price
  • resolution - staleness threshold in seconds; prices older than this are rejected
  • feeds - token address → RedStone price feed contract address mapping
fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    base_asset: Asset,
    decimals: u32,
    resolution: u32,
    feeds: soroban_sdk::Map,
)

Adds a price feed for a token. Admin-gated. Panics if a feed for this token already exists.

fn add_feed(
    env: soroban_sdk::Env,
    token_address: soroban_sdk::Address,
    price_feed: soroban_sdk::Address,
)

Updates the staleness threshold. Admin-gated.

fn set_resolution(env: soroban_sdk::Env, resolution: u32)

Nominates new_admin as the next administrator. Admin-gated. The transfer is not effective until new_admin calls accept_admin.

fn propose_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)

Completes the admin transfer initiated by propose_admin. Must be called by the address that was proposed.

fn accept_admin(env: soroban_sdk::Env)
fn base(env: soroban_sdk::Env) -> Asset
fn assets(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn decimals(env: soroban_sdk::Env) -> u32
fn resolution(env: soroban_sdk::Env) -> u32
fn price(env: soroban_sdk::Env, asset: Asset, timestamp: u64) -> Option
fn prices(
    env: soroban_sdk::Env,
    asset: Asset,
    records: u32,
) -> Option>
fn lastprice(env: soroban_sdk::Env, asset: Asset) -> Option

Imports

WebAssembly Text (WAT) ▶