Contract 290bb68d1cf2544451c5b552999b1359705aa2dde97a12fd5c05a9985617a4f0

← Back to Index 📥 Download WASM

Meta

cliver 23.4.1#a152ec2488c25136808ad28277c24b3a0765ffd4
rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.92.0

Instances

  • CDHHEZGWT7KAK6AIESV2VZVUB6ET7ZFKCTZ2442UTUML4GO6OJLG6ICC

Interface

fn pause(env: soroban_sdk::Env, paused: bool) -> Result<(), DikeError>
fn upgrade(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), DikeError>
fn set_admin(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
) -> Result<(), DikeError>
fn is_creator(env: soroban_sdk::Env, creator: soroban_sdk::Address) -> bool
fn set_creator(
    env: soroban_sdk::Env,
    creator: soroban_sdk::Address,
    approved: bool,
) -> Result<(), DikeError>
fn set_modules(
    env: soroban_sdk::Env,
    registry: soroban_sdk::Address,
    tokens: soroban_sdk::Address,
    vault: soroban_sdk::Address,
    amm: soroban_sdk::Address,
    fee_manager: soroban_sdk::Address,
) -> Result<(), DikeError>
fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    governance: soroban_sdk::Address,
    min_liquidity: i128,
    min_expiry_duration: u64,
)

Counter-divergence guarantee: NextMarketId is bumped LAST, after both registry.register_market and amm.create_pool succeed. Any failure in those cross-contract calls propagates as a trap, causing Soroban to revert the entire transaction write-set. Registry, AMM, and factory counters therefore can never diverge across a committed transaction — either all three increment together, or none of them do.

fn create_market(
    env: soroban_sdk::Env,
    config: MarketConfig,
    initial_liquidity: i128,
    opening_price_bps: u32,
) -> Result

Returns the next market-id the factory will assign. Used in tests to verify the counter is unchanged after a failed create_market call.

fn next_market_id(env: soroban_sdk::Env) -> u64
fn set_collateral(
    env: soroban_sdk::Env,
    collateral: soroban_sdk::Address,
    supported: bool,
) -> Result<(), DikeError>

Recovery path for a misconfigured governance pointer set at construction (used by require_governance/require_timelock — must be the actual dike-governance contract address, not an EOA). Admin-gated, matching set_admin's rotation model.

fn set_governance(
    env: soroban_sdk::Env,
    governance: soroban_sdk::Address,
) -> Result<(), DikeError>
fn set_creator_by_timelock(
    env: soroban_sdk::Env,
    creator: soroban_sdk::Address,
    approved: bool,
) -> Result<(), DikeError>

Imports

WebAssembly Text (WAT) ▶