Contract c2b31378b56d3ae0c6fa94be3cce16f3a75e4c1d882fe17fd9aa689f27c51e72

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 26.1.0#175aa41306f383057a8cdfc84b68d931664fc34e
rsver 1.93.0

Instances

  • CAEG2RH2Q23EVTLUO6WQNHJ2UF35DT53KOZ4JO7RWGVYXO24YKOWQ5BS
  • CAQVY2RKCUD3YNSJG5FQKWHX7IZ3ZZPE3YZV2M5AGPL4ONMHNJKMRWTX
  • CCYCUQNKQOC222ZG4TZAAMGZHURTAUEUFOL5OFXFUZEHTZI2JVFJPNZ3

Interface

Returns the factory admin address.

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

Bumps instance TTL. Anyone can call this to keep the contract alive.

fn extend_ttl(env: soroban_sdk::Env)

Returns the full MarketConfig for a given market_id.

fn get_market(env: soroban_sdk::Env, market_id: u32) -> MarketConfig

Called once at deployment.

insurance_market_wasm_hash: the WASM hash returned by stellar contract upload for the insurance-market contract. Factory uses this to deploy fresh instances.

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    insurance_market_wasm_hash: soroban_sdk::BytesN<32>,
    anchor_stake_contract: soroban_sdk::Address,
)

Returns all market IDs that have been created.

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

Creates a new insurance market by deploying a fresh insurance-market contract instance and initializing it with the provided parameters.

Only the factory admin can call this. Returns the new market_id (increments monotonically from 0).

Deployment uses a deterministic salt based on market_id, so each market has a predictable contract address.

fn create_market(
    env: soroban_sdk::Env,
    label: soroban_sdk::String,
    collateral_token: soroban_sdk::Address,
    covered_asset: Asset,
    oracle_contract: soroban_sdk::Address,
    depeg_threshold: i128,
    breach_duration_seconds: u64,
    expiry_timestamp: u64,
    anchor_id: Option,
) -> u32

Allows admin to remove a market from the factory registry.

fn delete_market(env: soroban_sdk::Env, market_id: u32)

Allows admin to update the WASM hash (e.g., for contract upgrades). All subsequent markets will use the new WASM. Existing markets are unaffected.

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

Returns just the contract address for a given market_id.

fn get_market_contract(env: soroban_sdk::Env, market_id: u32) -> soroban_sdk::Address

Returns the anchor-stake contract address.

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

Imports

WebAssembly Text (WAT) ▶