Contract 867c9e08ebd87af9668974f10edc6b4647933c1d8c3a63cb063b5c9437ab3ecc

← Back to Index 📥 Download WASM

Meta

rssdkver 21.7.7#5da789c50b18a4c2be53394138212fed56f0dfc4
rsver 1.88.0

Interface

Initialize the contract with admin and fee sponsor SECURITY FIX: Prevents double initialization

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

Add an authorized interface (admin only)

fn add_authorized_interface(
    env: soroban_sdk::Env,
    interface_address: soroban_sdk::Address,
)

Remove an authorized interface (admin only)

fn remove_authorized_interface(
    env: soroban_sdk::Env,
    interface_address: soroban_sdk::Address,
)

Update IPCM data (fee sponsored for authorized interfaces) SECURITY FIX: Proper authorization check

fn update(
    env: soroban_sdk::Env,
    ipcm_key: soroban_sdk::String,
    cid: soroban_sdk::String,
    interface_address: soroban_sdk::Address,
)

Get the latest IPCM entry

fn get(env: soroban_sdk::Env, ipcm_key: soroban_sdk::String) -> Option

Get IPCM history

fn get_history(
    env: soroban_sdk::Env,
    ipcm_key: soroban_sdk::String,
) -> Option>

Get authorized interfaces

fn get_authorized_interfaces(
    env: soroban_sdk::Env,
) -> soroban_sdk::Vec

Get fee sponsor address

fn get_fee_sponsor(env: soroban_sdk::Env) -> soroban_sdk::Address

Update fee sponsor (admin only)

fn update_fee_sponsor(env: soroban_sdk::Env, new_sponsor: soroban_sdk::Address)

Set history cap (admin only)

fn set_history_cap(env: soroban_sdk::Env, cap: u32)

Transfer admin ownership (current admin only)

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

Get current admin address

fn get_admin(env: soroban_sdk::Env) -> soroban_sdk::Address

Emit an update event without storing data on-chain

This is useful for:

  • High-frequency timeline updates
  • Off-chain indexing via event listeners
  • Cost optimization (CPU-only, no storage fees)

Arguments

  • updated_by - Address authorizing this event emission
  • ipcm_key - The DFID (DeFarm ID)
  • cid - The IPFS CID to associate with this DFID
fn emit_update_event(
    env: soroban_sdk::Env,
    updated_by: soroban_sdk::Address,
    ipcm_key: soroban_sdk::String,
    cid: soroban_sdk::String,
)

Upgrade the contract with new WASM code (admin only)

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

Imports

WebAssembly Text (WAT) ▶