Contract da57adcedceb01f4d74fb11297ba5fcb49622ac3a1478bde2219beebe06c21c3

← Back to Index 📥 Download WASM

Meta

rssdkver 20.5.0#9e2c3022b4355b224a7a814e13ba51761eeb14bb
rsver 1.81.0

Instances

  • CCQR6Y6ICYSPBHEH35OSQGP5JCB7KLHG47WZHGCTWAUWQFZDXJJDCLRL

Interface

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 base(env: soroban_sdk::Env) -> Asset
fn decimals(env: soroban_sdk::Env) -> u32
fn assets(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn lastprice(env: soroban_sdk::Env, asset: Asset) -> Option

Initialize the contract with the admin and the oracle configurations

Arguments

  • admin - The address of the admin
  • usdc - The address of the USDC token
  • usdc_oracle - The address of the USDC oracle
  • default_oracle - The address of the oracle for all non-USDC assets

Errors

  • AlreadyInitialized - The contract has already been initialized
fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    usdc: soroban_sdk::Address,
    usdc_oracle: soroban_sdk::Address,
    cpct_oracle: soroban_sdk::Address,
)

(Admin only) Block an asset

Arguments

  • asset - The asset to block

Errors

  • AssetNotFound - The asset is not found
fn block(env: soroban_sdk::Env, asset: Asset)

(Admin only) Unblock an asset

Arguments

  • asset - The asset to unblock

Errors

  • AssetNotFound - The asset is not found
fn unblock(env: soroban_sdk::Env, asset: Asset)

(Admin only) Set the admin address

Arguments

  • admin - The new admin address
fn set_admin(env: soroban_sdk::Env, admin: soroban_sdk::Address)

Imports

WebAssembly Text (WAT) ▶