Contract 87c0a7386ce794a340215af660401f53d8590a50c246f15179b1ac34632afe7c

← Back to Index 📥 Download WASM

Meta

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

Instances

  • CDA3XS2HETVCW5GSRN3FH4X3YJ45IA6DNVSZTEOYDFGOCXQK4ZJG22JM

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,
)

Maps asset → feed_id for SEP-40 reads and ensures the feed is on the submit allowlist. At most one asset may own a given feed id.

Errors

  • FeedAlreadyMapped - asset already mapped, or feed id already owned
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 allowlist entry, and reverse ownership. Does not touch a residual asset mapping if called after remove_feed already dropped it; when a mapping still exists, the owner should call remove_feed instead so indexes stay consistent. Prefer remove_feed for full teardown.

Errors

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

Drops SEP-40 mapping and wipes all price state for the mapped feed (aggregate, history, submissions, allowlist entry).

Errors

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

Owner allowlist for a RedStone-style feed_id without SEP-40 mapping. Submissions to unregistered feed ids are rejected.

Errors

  • FeedAlreadyRegistered
fn register_feed(
    env: soroban_sdk::Env,
    feed_id: soroban_sdk::String,
) -> 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>

Max package-time lag behind the freshest absolute-fresh peer that may still enter the median cluster. Capped by MaxSubmissionAgeSeconds. Side effects: recomputes all feeds.

Errors

  • InvalidRelativeSkew - above MaxSubmissionAgeSeconds
fn set_max_relative_skew_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>

Cache TTL for read_price_data_for_feed / history gates.

fn max_stale_seconds(env: soroban_sdk::Env) -> u64

Newest-first history cap for SEP-40 price/prices. Fails closed when the live aggregate is missing or past MaxStaleSeconds, so history cannot outlive the spot feed.

Errors

  • NoDataForFeed
  • StaleData
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

Effective relative cluster skew (capped by the absolute inclusion window).

fn max_relative_skew_seconds(env: soroban_sdk::Env) -> u64

Absolute inclusion window used by aggregation and submit gates.

fn max_submission_age_seconds(env: soroban_sdk::Env) -> u64

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

Errors

  • NotAuthorizedSigner - signer is not a registered signer.
  • FeedNotKnown - feed_id was never registered by the owner.
  • 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, or older than this signer's previously stored observation for the feed.
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().
  • FeedNotKnown - any feed_ids[i] was never registered.
  • 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, or older than this signer's stored observation for any of the feeds.
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) ▶