Contract c3ce2291fa8f98d4fa717431fd1ff690b93b7058d76d65af8b8070d2d0cd6443

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdk_spec_shaking 2
rssdkver 26.1.0#175aa41306f383057a8cdfc84b68d931664fc34e
rsver 1.95.0

Interface

Replaces the contract Wasm with the code at new_wasm_hash, keeping the contract address and all storage intact.

fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
fn get_owner(env: soroban_sdk::Env) -> Option

Registers admin as the OZ Ownable owner, the initial signers set, the N-of-M threshold, and the SEP-40 resolution. Staleness windows start at their defaults; tune them via the owner setters.

Errors

  • InvalidThreshold - threshold == 0, threshold > signers.len(), or signers contains a duplicate address.
fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    signers: soroban_sdk::Vec,
    threshold: u32,
    resolution: u32,
) -> Result<(), soroban_sdk::Error>
fn accept_ownership(env: soroban_sdk::Env)
fn renounce_ownership(env: soroban_sdk::Env)
fn transfer_ownership(
    env: soroban_sdk::Env,
    new_owner: soroban_sdk::Address,
    live_until_ledger: u32,
)

Errors

  • FeedAlreadyMapped
fn add_feed(
    env: soroban_sdk::Env,
    feed_id: soroban_sdk::String,
    asset: ReflectorAsset,
) -> Result<(), soroban_sdk::Error>

Errors

  • SignerAlreadyRegistered
fn add_signer(
    env: soroban_sdk::Env,
    signer: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Clears aggregate, history, per-signer submissions, known-feed index. Does not touch FeedMapping/asset index (remove_feed).

Errors

  • FeedNotKnown
fn purge_feed(
    env: soroban_sdk::Env,
    feed_id: soroban_sdk::String,
) -> Result<(), soroban_sdk::Error>

Drops mapping + asset index only; submissions need purge_feed.

Errors

  • FeedNotMapped
fn remove_feed(
    env: soroban_sdk::Env,
    asset: ReflectorAsset,
) -> Result<(), soroban_sdk::Error>

Side effects: drops signer's submissions; recomputes each touched feed.

Errors

  • SignerNotRegistered
  • CannotRemoveBelowThreshold
fn remove_signer(
    env: soroban_sdk::Env,
    signer: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Side effects: recomputes every known feed under the new threshold.

Errors

  • InvalidThreshold - zero or above signer count
fn set_threshold(
    env: soroban_sdk::Env,
    threshold: u32,
) -> Result<(), soroban_sdk::Error>
fn set_resolution(
    env: soroban_sdk::Env,
    resolution: u32,
) -> Result<(), soroban_sdk::Error>

Cache-TTL ceiling; must stay >= MaxSubmissionAgeSeconds. No recompute.

Errors

  • InvalidSubmissionAge
fn set_max_stale_seconds(
    env: soroban_sdk::Env,
    seconds: u64,
) -> Result<(), soroban_sdk::Error>

Inclusion window for median + observation time. Keep <= consumer max_stale. Side effects: recomputes all feeds.

Errors

  • InvalidSubmissionAge - below floor or above MaxStaleSeconds
fn set_max_submission_age_seconds(
    env: soroban_sdk::Env,
    seconds: u64,
) -> Result<(), soroban_sdk::Error>
fn base(env: soroban_sdk::Env) -> ReflectorAsset

Closest observation at or before timestamp (package time, not write time).

fn price(
    env: soroban_sdk::Env,
    asset: ReflectorAsset,
    timestamp: u64,
) -> Option
fn assets(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn prices(
    env: soroban_sdk::Env,
    asset: ReflectorAsset,
    records: u32,
) -> Option>
fn decimals(env: soroban_sdk::Env) -> u32

None when unmapped/missing/stale (SEP-40 soft-fail).

fn lastprice(
    env: soroban_sdk::Env,
    asset: ReflectorAsset,
) -> Option
fn resolution(env: soroban_sdk::Env) -> u32

All-or-nothing bulk; first missing/stale fails the whole call.

fn read_price_data(
    env: soroban_sdk::Env,
    feed_ids: soroban_sdk::Vec,
) -> Result, soroban_sdk::Error>

Newest-first history cap for SEP-40 price/prices.

Errors

  • NoDataForFeed
fn read_price_history(
    env: soroban_sdk::Env,
    feed_id: soroban_sdk::String,
    limit: u32,
) -> Result, soroban_sdk::Error>

Errors

  • NoDataForFeed
  • StaleData - exceeds MaxStaleSeconds
fn read_price_data_for_feed(
    env: soroban_sdk::Env,
    feed_id: soroban_sdk::String,
) -> Result

Records signer's latest observation for feed_id and recomputes the cached aggregate for that feed.

Errors

  • NotAuthorizedSigner - signer is not a registered signer.
  • InvalidPrice - price <= 0.
  • PriceOutOfRange - price > MAX_SUBMITTED_PRICE.
  • FutureTimestamp - package_timestamp is more than MAX_FUTURE_SKEW_SECONDS ahead of the ledger clock.
  • StaleSubmission - package_timestamp is already older than the MaxSubmissionAgeSeconds inclusion window.
fn submit_price(
    env: soroban_sdk::Env,
    signer: soroban_sdk::Address,
    feed_id: soroban_sdk::String,
    price: i128,
    package_timestamp: u64,
) -> Result<(), soroban_sdk::Error>

Records signer's latest observations for multiple feeds in one call, sharing a single package_timestamp and one auth check. All inputs are validated upfront; no partial application on failure.

Errors

  • NotAuthorizedSigner - signer is not a registered signer.
  • LengthMismatch - feed_ids.len() != prices.len().
  • InvalidPrice - any prices[i] <= 0.
  • PriceOutOfRange - any prices[i] > MAX_SUBMITTED_PRICE.
  • FutureTimestamp - the shared package_timestamp is more than MAX_FUTURE_SKEW_SECONDS ahead of the ledger clock.
  • StaleSubmission - the shared package_timestamp is already older than the MaxSubmissionAgeSeconds inclusion window.
fn submit_prices(
    env: soroban_sdk::Env,
    signer: soroban_sdk::Address,
    feed_ids: soroban_sdk::Vec,
    prices: soroban_sdk::Vec,
    package_timestamp: u64,
) -> Result<(), soroban_sdk::Error>

Imports

WebAssembly Text (WAT) ▶