Skip to main content

ShieldedPool

Every user action. Holds the commitment tree, nullifier set, and verifiers.
There is no public redeem. It existed once and published a recipient and an amount, which would retroactively reveal every position. It was removed, and the deployment invariants assert its selector is absent from deployed bytecode.
withdrawData used to pack a full marketId, which let a winner’s withdrawal publicly name the market they won. It now packs a single unbetExit bit — never-bet exit vs. settled payout — and nothing else about the note.

Vault

Holds the outcome (Unresolved, Yes, No, or Void) and the market’s immutable clock — bettingCloseTime and resolutionStartTime, fixed at creation, so nobody can move a deadline after seeing how a market is going. voidMarket is permissionless after a deadline and sets the outcome to Void, which is what lets everyone redeem their stake 1:1 regardless of side. It does not custody collateral for the shielded flow: ShieldedPool holds all collateral itself, in one shared pool across every market, checked against a running global bound (total withdrawn can never exceed total deposited) rather than a per-market invariant.
Vault.split/merge/redeem still exist as plain, non-ZK functions and remain technically callable directly — but the shielded flow never calls them.

ElGamalAccumulator

Holds the running encrypted total per market and side. Stores ciphertext only and cannot decrypt. Also maintains betCount, which the publisher reads to pace itself.

EncryptedParimutuelPool

publishFinalTotals accepts decrypted totals with a Chaum-Pedersen proof that the decryption is honest with respect to the published committee key. This is the only source a payout ever reads. publishAttestedRatio records mid-market odds and is unverified by construction — no payout reads it.

PythResolver

Implements IOracleResolver. Resolves a market from a signed price at a committed timestamp. Anyone may call; the caller decides nothing. See Resolution.

Denominations

A pure library. Allows powers of ten up to 10^9, computed rather than stored. Enforced at the two points where a size becomes public: deposit, and the public leg of withdraw.