Contract d395935626aa610a7be28dd24f47112488222962672f9077892c75ff205b99a0

← Back to Index πŸ“₯ Download WASM

Meta

rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.97.1

Instances

  • CASUQ7V2YJPQAPV6NECX73YY76YKKZAVAC6ZYA2R23EH67KIU63NO3UK

Interface

fn fees(env: soroban_sdk::Env) -> i128
fn init(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    verifier: soroban_sdk::Address,
    collateral: soroban_sdk::Address,
    reserve_col: i128,
    reserve_yes: i128,
    reserve_no: i128,
)
fn ping(env: soroban_sdk::Env) -> u32
fn reseed(
    env: soroban_sdk::Env,
    reserve_col: i128,
    reserve_yes: i128,
    reserve_no: i128,
)

payloads carries exactly one encrypted note payload, for the single commitment this call inserts.

fn shield(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    proof: VProof,
    public_inputs: soroban_sdk::Vec>,
    screening_ref: soroban_sdk::BytesN<32>,
    payloads: soroban_sdk::Vec,
)
fn resolve(env: soroban_sdk::Env, final_price: i128)
fn add_deny(env: soroban_sdk::Env, screening_ref: soroban_sdk::BytesN<32>)

Withdraw (unshield) collateral to recipient by spending two input notes.

Recipient binding (Plan 3 item β€” closed)

The circuit binds a recipient field element; this transfers to the recipient Address arg only after cryptographically enforcing that it equals encode_recipient(&env, &recipient) from the proof's recipient_field (checked above, before verify_proof). Without this a malicious relayer β€” which is mandatory on this path β€” could redirect withdrawals to an address of its choosing. See circuits/CARRY_FORWARD.md (Plan 3, item 3) for the original gap writeup. payloads carries exactly one encrypted note payload, for the change commitment. The withdrawn value leaves the pool transparently and has no note to recover.

fn unshield(
    env: soroban_sdk::Env,
    relayer: soroban_sdk::Address,
    proof: VProof,
    public_inputs: soroban_sdk::Vec>,
    recipient: soroban_sdk::Address,
    screening_ref: soroban_sdk::BytesN<32>,
    payloads: soroban_sdk::Vec,
)

Private BUY: spend COL notes β†’ mint a 1:1 complete set β†’ swap the minted opposite side on the YES↔NO AMM β†’ receive (mintAmount + swapOut) of the target outcome. The 1:1 mint avoids the pure-swap "dust" of a thin pool. Proof verified against CID_MINT_SWAP (mint_swap.circom).

payloads carries two encrypted note payloads β€” [0] for the output note, [1] for the COL change β€” in the same order the commitments are inserted into the tree.

fn mint_swap(
    env: soroban_sdk::Env,
    relayer: soroban_sdk::Address,
    proof: VProof,
    public_inputs: soroban_sdk::Vec>,
    payloads: soroban_sdk::Vec,
)
fn get_config(env: soroban_sdk::Env) -> Config
fn reserve_of(env: soroban_sdk::Env, asset: u32) -> i128

Private SELL: swap part of the position to the other side, merge the matched pair 1:1 β†’ COL (minus fee). Proof verified against CID_SWAP_MERGE (swap_merge.circom).

payloads carries two encrypted note payloads β€” [0] for the COL output note, [1] for the leftover outcome change β€” in insertion order.

fn swap_merge(
    env: soroban_sdk::Env,
    relayer: soroban_sdk::Address,
    proof: VProof,
    public_inputs: soroban_sdk::Vec>,
    payloads: soroban_sdk::Vec,
)
fn remove_deny(env: soroban_sdk::Env, screening_ref: soroban_sdk::BytesN<32>)

Settle a batch of trades as ONE aggregate reserve delta, so per-trade size and direction are not derivable from chain data.

v2 (2026-08-30) closes the last per-trade channel: the v1 circuits published inputTotal/fee per intent and outAsset per leg, and those publics ride in THIS call's argument vectors β€” so every leg's size and direction sat in the transaction envelope even though the event and the reserves hid them. The v2 vectors carry commitments, nullifiers, the root and the price alone; the fee arrives once as the aggregate's proven batchFee ([10]).

THREE PROOFS PER BATCH-PLUS-TWO-PER-LEG, and each is load-bearing:

intent (per leg) β€” the notes exist, are unspent, and are bound to a hidden trade. Intents never reach the chain, so without this the contract would be trusting the batcher that the inputs are real. leg (per leg) β€” the output note matches the batch's clearing price. aggregate (once) β€” the published net flow really is the sum of the committed amounts. The contract CANNOT deriv

fn batch_settle(
    env: soroban_sdk::Env,
    relayer: soroban_sdk::Address,
    legs: soroban_sdk::Vec,
    agg_proof: VProof,
    agg_inputs: soroban_sdk::Vec>,
    clearing_price: i128,
    payloads: soroban_sdk::Vec,
) -> u32
fn private_swap(
    env: soroban_sdk::Env,
    relayer: soroban_sdk::Address,
    proof: VProof,
    public_inputs: soroban_sdk::Vec>,
)
fn is_known_root(env: soroban_sdk::Env, root: soroban_sdk::BytesN<32>) -> bool
fn withdraw_fees(env: soroban_sdk::Env, to: soroban_sdk::Address)

Imports

WebAssembly Text (WAT) β–Ά