Contract 7e149fb9d5840941688e6c8131dd9e9c06839a9ac703086df72e2eedf6611f3c

← Back to Index 📥 Download WASM

Meta

rssdkver 26.0.1#f52b6aad85f18c5e312ff3f60e57cb613274e6bb
rsver 1.93.0

Instances

  • CAOTNMFUXGRGA6QACDFVPJ4TFDDFNASWEMBCHPSVBJ3ZQSRWW5XF52H2

Interface

fn is_paused(env: soroban_sdk::Env) -> bool
fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    order_book: soroban_sdk::Address,
    escrow_vault: soroban_sdk::Address,
    settlement: soroban_sdk::Address,
    zk_verifier: soroban_sdk::Address,
    relayer_1: soroban_sdk::Address,
    relayer_2: soroban_sdk::Address,
    relayer_3: soroban_sdk::Address,
)

Admin-only emergency switch. Pausing blocks new match submissions only.

fn set_paused(env: soroban_sdk::Env, admin: soroban_sdk::Address, paused: bool)

Validate and settle a matched order pair — trustlessly.

Instead of trusting the relayer's revealed prices, the relayer supplies a Groth16 match_proof. The MatchProof circuit proves, in zero knowledge, that both commitments open to real orders, the clearing price lies within both limit prices, the fill is within both committed quantities, and usdc_amount = floor(xlm_amount * clearing_price / 1e6).

Public signals (verified against the on-chain MatchVk): [buyer_commitment, seller_commitment, clearing_price, xlm_amount, usdc_amount] This contract binds those signals to the orders it settles, so a valid proof cannot be replayed against different orders or amounts.

v1: requires relayer_1 auth (chooses WHICH crossing pairs to match). v2: upgrade to 2-of-3 threshold multisig.

fn submit_match(
    env: soroban_sdk::Env,
    buyer_commitment: soroban_sdk::BytesN<32>,
    seller_commitment: soroban_sdk::BytesN<32>,
    xlm_amount: i128,
    usdc_amount: i128,
    match_proof: Groth16Proof,
    match_public_signals: soroban_sdk::Vec>,
)
fn get_match_count(env: soroban_sdk::Env) -> u64

Imports

WebAssembly Text (WAT) ▶