Liveness safety valve: if Drand round R is never produced (network stall) and the grace window after the reveal deadline has passed without the round opening, anyone can void it and all escrow is refunded.
fn void(env: soroban_sdk::Env, round_id: u64) -> Result<(), soroban_sdk::Error>
Deterministically compute the winner after the reveal deadline. If no valid bid was revealed, the round is voided and all escrow becomes refundable.
fn clear(
env: soroban_sdk::Env,
round_id: u64,
) -> Result
Submit (or overwrite, before the deadline) a sealed bid and lock escrow.
commitment H binds the bid; checked at reveal.ciphertext C is the timelock seal; guarantees forced reveal.escrow is a public USDC budget and an upper bound on the sealed bid;
locked now so the winner can always pay.auditor_blob is the bidder identity encrypted to the auditor key.fn commit(
env: soroban_sdk::Env,
round_id: u64,
bidder: soroban_sdk::Address,
commitment: soroban_sdk::BytesN<32>,
ciphertext: soroban_sdk::Bytes,
escrow: i128,
auditor_blob: soroban_sdk::Bytes,
) -> Result<(), soroban_sdk::Error>
Reveal a bid. Permissionless: once R's signature is public, anyone can
decrypt any ciphertext and submit the reveal — so no bidder can abort.
The contract checks sha256(be16(value) ‖ nonce) == H.
fn reveal(
env: soroban_sdk::Env,
round_id: u64,
bidder: soroban_sdk::Address,
value: i128,
nonce: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>
Settle a cleared round. The winner pays their bid from escrow to the operator; the winner's surplus and every loser's escrow are refunded. Cannot fail for lack of funds — everything was escrowed at commit.
fn settle(env: soroban_sdk::Env, round_id: u64) -> Result<(), soroban_sdk::Error>
fn void_v2(env: soroban_sdk::Env, round_id: u64) -> Result<(), soroban_sdk::Error>
Finalize a receipt-only round, or deterministically clear an auction.
fn clear_v2(
env: soroban_sdk::Env,
round_id: u64,
) -> Result
Observer view: the sealed ciphertext + auditor blob while still in
Temporary storage. Returns None once the seal TTL has expired (by design
after the reveal window). Persistent bid state remains for settlement.
fn get_seal(
env: soroban_sdk::Env,
round_id: u64,
bidder: soroban_sdk::Address,
) -> Option
Commit a full structured payload hash. Auction rounds require escrow; receipt-only rounds reject escrow and never touch the token contract.
fn commit_v2(
env: soroban_sdk::Env,
round_id: u64,
bidder: soroban_sdk::Address,
commitment: soroban_sdk::BytesN<32>,
ciphertext: soroban_sdk::Bytes,
escrow: i128,
auditor_blob: soroban_sdk::Bytes,
) -> Result<(), soroban_sdk::Error>
fn get_round(env: soroban_sdk::Env, round_id: u64) -> Result
Reveal the complete canonical envelope. The contract hashes every byte, then interprets only the versioned amount field required for clearing.
fn reveal_v2(
env: soroban_sdk::Env,
round_id: u64,
bidder: soroban_sdk::Address,
envelope: soroban_sdk::Bytes,
) -> Result<(), soroban_sdk::Error>
fn settle_v2(env: soroban_sdk::Env, round_id: u64) -> Result<(), soroban_sdk::Error>
fn get_config(env: soroban_sdk::Env) -> Result
Keeper view: the deterministic, ordered bidder index for a round. The keeper reads this to learn exactly which seals must be opened and revealed — the reveal set is on-chain state, so no event scraping or indexer is required and nothing can be missed.
fn get_bidders(
env: soroban_sdk::Env,
round_id: u64,
) -> Result, soroban_sdk::Error>
fn get_seal_v2(
env: soroban_sdk::Env,
round_id: u64,
bidder: soroban_sdk::Address,
) -> Option
Open the reveal window by proving Drand round R has been produced.
The supplied signature is verified on-chain via BLS12-381. This is the
only way to move a round into Revealing; there is no operator override.
fn open_reveal(
env: soroban_sdk::Env,
round_id: u64,
drand_signature: soroban_sdk::BytesN<96>,
) -> Result<(), soroban_sdk::Error>
Open a new sealed round. Permissionless: anyone can be an operator, and the operator gets no special read power — that is the point.
fn create_round(
env: soroban_sdk::Env,
operator: soroban_sdk::Address,
item_ref: soroban_sdk::BytesN<32>,
reveal_round: u64,
clearing_rule: ClearingRule,
commit_deadline: u64,
reveal_deadline: u64,
auditor_pubkey: soroban_sdk::Bytes,
) -> Result
fn get_round_v2(
env: soroban_sdk::Env,
round_id: u64,
) -> Result
fn get_bid_state(
env: soroban_sdk::Env,
round_id: u64,
bidder: soroban_sdk::Address,
) -> Result
One-time deploy configuration. All Drand parameters are supplied by the deployer from values validated against a live quicknet round.
fn __constructor(
env: soroban_sdk::Env,
drand_pubkey: soroban_sdk::BytesN<192>,
g2_neg_generator: soroban_sdk::BytesN<192>,
dst: soroban_sdk::Bytes,
drand_genesis: u64,
drand_period: u64,
usdc: soroban_sdk::Address,
)
fn get_bidders_v2(
env: soroban_sdk::Env,
round_id: u64,
) -> Result, soroban_sdk::Error>
fn open_reveal_v2(
env: soroban_sdk::Env,
round_id: u64,
drand_signature: soroban_sdk::BytesN<96>,
) -> Result<(), soroban_sdk::Error>
Create a versioned structured-submission round. V2 state uses separate storage keys, so deployed v1 rounds and methods remain readable.
fn create_round_v2(
env: soroban_sdk::Env,
operator: soroban_sdk::Address,
item_ref: soroban_sdk::BytesN<32>,
schema_ref: soroban_sdk::BytesN<32>,
settlement: SettlementConfig,
reveal_round: u64,
clearing_rule: ClearingRule,
commit_deadline: u64,
reveal_deadline: u64,
auditor_pubkey: soroban_sdk::Bytes,
max_participants: u32,
) -> Result
Paginated bidder index for a round. Returns a page of bidders starting
at cursor (zero-based), with continuation metadata.
limit must be 1–100. next_cursor in the response is 0 when there
are no more pages.
fn get_bidders_page(
env: soroban_sdk::Env,
round_id: u64,
cursor: u32,
limit: u32,
) -> Result
fn get_submission_v2(
env: soroban_sdk::Env,
round_id: u64,
bidder: soroban_sdk::Address,
) -> Result
fn get_round_policy_v2(env: soroban_sdk::Env, round_id: u64) -> Option
Create a partner round with a contract-enforced fixed auction escrow and optional participant allowlist. Existing Core v2 rounds remain valid.
fn create_partner_round_v2(
env: soroban_sdk::Env,
operator: soroban_sdk::Address,
item_ref: soroban_sdk::BytesN<32>,
schema_ref: soroban_sdk::BytesN<32>,
policy: RoundPolicyV2,
reveal_round: u64,
clearing_rule: ClearingRule,
commit_deadline: u64,
reveal_deadline: u64,
auditor_pubkey: soroban_sdk::Bytes,
max_participants: u32,
) -> Result