Contract 3d69970c585285e627babdc2ab69e087e4542bd9ecc07a277b28bcea56912571

← Back to Index 📥 Download WASM

Meta

rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.94.0

Instances

  • CAK4MBJFEU3YUFUU72S7HCSRFBPJQFO62PBFEQYXY3KSXBN3EECOPVCD
  • CDJAO2M4YAJ32HPISRNG5CJ2UZ4H3E7CE2I4DI7AXMHFVQHVVMWBMFEW

Interface

Get all registered tokens as a Vec.

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

Initialize the adapter. Admin only.

fn initialize(env: soroban_sdk::Env, admin: soroban_sdk::Address)

Replace the entire token list. Admin only. Clears existing list and sets new tokens. Skips duplicates silently.

fn set_tokens(env: soroban_sdk::Env, tokens: soroban_sdk::Vec)

Get all position values for an account's direct token holdings.

Phase 1 — Oracle-driven discovery: Calls oracle_registry.get_feeds_paginated(0, MAX_TRACKED_FEEDS) and iterates over the returned feed list. Disabled feeds and non-Stellar assets are skipped. ALL cross-contract calls use try_invoke_contract — any error causes that token to be silently skipped rather than panicking the entire call (B-3 fix).

Phase 2 — Manual list union: Also iterates the manually-registered tok_cnt/(tok, i) tokens. Tokens already discovered in Phase 1 are deduplicated by address. Same try_invoke / skip-on-error logic applies.

enabled_position_ids — HIGH-03 fix: used to filter which manual-list token indices are included. Each token registered at adapter index i corresponds to position_id Symbol INDEX_STRS[i]. If the list is empty all manual tokens are returned (backward-compatible).

Panics

Panics only if arithmetic overflows in process_token_position (checked_mul failure).

fn get_all_pos(
    env: soroban_sdk::Env,
    account: soroban_sdk::Address,
    oracle_registry: soroban_sdk::Address,
    accounting_token: soroban_sdk::Address,
    enabled_position_ids: soroban_sdk::Vec,
) -> soroban_sdk::Vec

Accept a pending admin proposal (step 2 of two-step transfer).

Must be called by the pending_admin address. Overwrites the current admin with pending_admin and clears the pending slot.

fn accept_admin(env: soroban_sdk::Env)

Remove a token from the tracked list. Admin only. Does NOT preserve order — swaps last token into the removed slot.

fn remove_token(env: soroban_sdk::Env, token: soroban_sdk::Address)

Propose a new admin (step 1 of two-step transfer). Admin only. (MEDIUM-01)

Writes the pend_admin storage key but does NOT overwrite the current admin. The new admin must call accept_admin() to complete the transfer. This prevents permanent lock-out from a typo or misrouted address.

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

Register a token to track. Admin only.

fn register_token(env: soroban_sdk::Env, token: soroban_sdk::Address)

Get number of registered tokens.

fn get_token_count(env: soroban_sdk::Env) -> u32

Return adapter info.

fn get_adapter_info(
    env: soroban_sdk::Env,
) -> (soroban_sdk::Symbol, soroban_sdk::Symbol, u32)

Get token at a specific index.

fn get_token_at_index(
    env: soroban_sdk::Env,
    index: u32,
) -> Option

Register multiple tokens at once. Admin only. Skips duplicates silently.

fn register_tokens_batch(
    env: soroban_sdk::Env,
    tokens: soroban_sdk::Vec,
)

Imports

WebAssembly Text (WAT) ▶