Contract 486eace687feaf5c54dce048e0992744c75f85881b44839d408332ab3ee7142b

← Back to Index 📥 Download WASM

Meta

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

Instances

  • CBSPVOYRS6Y4KLVQ2DOLAI3MBMYSMAQ5TURYMH77GAXY2N7F6YTJVIPK

Interface

Winner / loser settlement for a single slot. The recorded bidder claims their fill units at the uniform clearing price; unspent collateral is refunded. Losers (fill == 0) simply get their full collateral back. The opening is never disclosed — the proof already bound the fill to the commitment.

fn claim(env: soroban_sdk::Env, id: u32, slot: u32)

Close bidding once the deadline has passed. After this, only settle can run.

fn close(env: soroban_sdk::Env, id: u32)
fn count(env: soroban_sdk::Env) -> u32
fn get_vk(env: soroban_sdk::Env) -> Vk

Settle the auction. Anyone may submit the off-chain-computed clearing_price, per-slot fills, total_cleared and a Groth16 proof. The contract rebuilds the circuit's public-signal vector from its own committed state and verifies the proof natively; only a genuinely correct clearing can pass.

fn settle(
    env: soroban_sdk::Env,
    id: u32,
    clearing_price: u64,
    fills: soroban_sdk::Vec,
    total_cleared: u64,
    proof: Proof,
)

Submit a sealed bid (Poseidon commitment) and escrow collateral of the quote token. Returns the bid's slot index, which fixes its marginal tie-break priority.

fn commit_bid(
    env: soroban_sdk::Env,
    id: u32,
    bidder: soroban_sdk::Address,
    commitment: soroban_sdk::BytesN<32>,
    collateral: i128,
) -> u32

One-time setup: store the admin and the fixed circuit verifying key.

fn initialize(env: soroban_sdk::Env, admin: soroban_sdk::Address, vk: Vk)
fn get_auction(env: soroban_sdk::Env, id: u32) -> Auction

Open a new auction. The seller escrows supply units of asset into the contract.

fn create_auction(
    env: soroban_sdk::Env,
    seller: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    quote: soroban_sdk::Address,
    supply: u64,
    reserve: u64,
    commit_deadline: u64,
) -> u32

Stateless, permissionless on-chain audit of a clearing proof against the contract's configured verifying key. Returns whether the proof is valid for the given public signals. This is a public good (anyone can verify a clearing natively) and the most direct demonstration of ZK verification on Stellar.

fn verify_clearing(
    env: soroban_sdk::Env,
    proof: Proof,
    public: soroban_sdk::Vec>,
) -> bool

Imports

WebAssembly Text (WAT) ▶