Build
Contract reference
Every call and event, in one place.
Check your version
The contracts still use the working name Gigapot (for example Gigapot and GigapotLens). This reference follows contract code e1056f7. The test network runs older code from 19 September (8a20efb). The launch contracts add fee bands, a Backer allowlist, prize minimums and the 25% jackpot; their calls will be listed here once the audited ABI is final. Use the ABI that matches the contracts you call.
A few terms
A round is one draw. A batch is every line from one purchase (batchId). A slice is a run of lines inside a batch that one wallet owns.
User calls#
| Call | Who | What it does |
|---|---|---|
Gigapot.buyRandom(uint32 count, address to, address[] referrers, uint256[] splits, bytes32 source) | Anyone | Buy random lines. Returns batchId. Works while the round is still being set up. |
Gigapot.buyChosen(bytes numbers, address to, address[] referrers, uint256[] splits, bytes32 source) | Anyone | Six bytes per line: five ascending numbers and a bonus. Reverts ConfigurationPending while bonusMax == 0. |
Gigapot.deposit(amount) / requestWithdraw(shares) / cancelPending() / withdraw() | Backer | Deposit, queue an exit, cancel a pending action, collect. Can revert PendingSettlement. |
TicketRights.rootSlice(roundId, batchId) | Anyone | Creates a batch’s root slice for its original owner. Safe to call twice. |
TicketRights.transfer / transferFor / split / splitFor | Holder or signature | Move or divide a slice, any time after purchase. |
TicketRights.redeemVoucher / voucherDigest | Anyone | Submit a holder-signed voucher; the named recipient gets the slice. |
TicketRights.claim / claimFor | Holder or signature | Prove a slice and credit its full prize; optionally withdraw. |
TicketRights.withdraw / withdrawFor | Holder or signature | Withdraw prize credit already recorded. |
FeeVault.claimReferrals() | Referrer | Collect referral commissions from purchases. |
Reads#
| Call | Who | What it does |
|---|---|---|
currentRound() / settlementRound() | View | The round on sale, and the round being processed. |
rounds(roundId) / pipelineState(roundId) | View | Round settings, phase, result, queue and proof progress. |
batchOf(roundId, batchId) / batchDetail(roundId, batchId) | View | Batch data. Chosen numbers also come from ChosenNumbers or calldata. |
ticketPrice(roundId) | View | The price for that round. Number ranges are normalMax and bonusMax. |
lpAccount(account) / sharesOf(account) / epoch(roundId) / depositCap() | View | Raw Backer state, share units, epoch accounting and pool room. |
GigapotLens.lpValue / lpPosition / liquiditySnapshot | View | Backer value, position and available money. |
TicketRights.slices / batchSlice; Lens.slice / rootSliceOf | View | Slice and root IDs. rootSlice itself is a write. |
unverifiedSettlements() | View | Trusted early reports still waiting for proofs. |
Operator calls#
| Call | Who | What it does |
|---|---|---|
advanceSales() | Anyone | Open the next sales round when due. Its prizes may still be pending. |
materializeQueue(roundId, maxBatches) | Anyone | Add recorded batches to the queue hash, a few at a time. |
proveQueue(arrayRoot, proof) / proveQueueFor(roundId, arrayRoot, proof) | Anyone | Prove the full queue after the deadline. |
requestNumbers() | Anyone | Request numbers for settlementRound after the deadline. Doesn’t need the queue proof first. |
settleRound(winners, duplicates, noReferral, proof) / verifySettlement(roundId, winners, duplicates, noReferral, proof) | Anyone | Verify winner counts and settle. noReferral is not a cut from winnings. |
reportSettlement(roundId, winners, duplicates, noReferral) | Settlement operator | Trusted early report. Proofs are still needed before claims. |
settleEmptyRound() / publishClaimTree(roundId, claimRoot, proof) | Anyone | Settle a round with no lines, or publish a proven claim root. |
forceNumbers(normals, bonus) | Owner | Fallback only after a randomness request provably died. |
setFrozen(true) / setFrozen(false) | Owner or guardian / owner | Either can pause; only the owner can unpause. Stops purchases and deposits only. |
exportCapital(amount) / returnCapital(amount) | Treasury roles | Export: treasurer only. Return: treasurer or treasury. |
EarnVault.repay(amount, maxLoss) | Operator or owner | Return money through the Earn Vault and update what it owes. |
When Backer calls revert
After launch, deposit and requestWithdraw need the sales and settlement heads to match, no unverifiedSettlements, and a SELLING or CLOSED phase. Otherwise they revert PendingSettlement. cancelPending has the same head checks. A pause doesn’t block withdrawal requests, but doesn’t skip these checks either.
Events#
| Topic | Events |
|---|---|
| Buying and setup | TicketsBought, ChosenNumbers, RoundOpened, SalesOpened, RoundConfigured |
| Queue and numbers | QueueMaterialized, QueueProved, NumbersRequested, NumbersDrawn |
| Results | TierResults, SettlementReported, SettlementVerified, SettlementMismatch, RoundSettled, ClaimTreeRoot |
| Line ownership | SliceCreated, SliceTransferred, SliceShrunk, SliceClaimed, VoucherRedeemed, NonceBurned |
| Money | PrizePaid, CapitalExported, CapitalReturned, Deposited, WithdrawQueued, PendingCancelled, Withdrawn, ReferralAccrued, ReferralPaid |