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