Build
Start building
Pick a way in, then build the whole journey from buy to claim.
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.
Choose a way in#
- Direct
- Read the round on Stable, then call
buyRandomorbuyChosen. - Multichain
- Route through
RelayGatewaywith a reviewed Relay or LiFi call. - Sponsored
- Your app pays for lines as a reward, and records the user and campaign source.
The journey#
- Read the round.
currentRoundis on sale;settlementRoundis being processed. IfbonusMaxis zero, show Quick Pick only. - Buy a batch.
buyRandomtakes a count.buyChosentakes six bytes per line. - Save the IDs. Keep the round ID and batch ID. Index
TicketsBoughtand TicketRights events. - Claim. After a verified result and a
ClaimTreeRoot, prove the slice and claim the full prize.
Build and test#
Shell
git submodule update --init --recursive
forge fmt --check
forge build --sizes
forge testThe core links three libraries: TierPricing, EpochAccounting and RoundPipeline. Record all three addresses for verification.
Your first read#
TypeScript
// Use the ABI and address for the same deployment.
const roundId = await read("currentRound");
const processingId = await read("settlementRound");
const round = await read("rounds", [roundId]);
const pipeline = await read("pipelineState", [processingId]);
const quickPickOnly = round.bonusMax === 0;Then read ticketPrice(roundId) and the deadline. For Backer views, use GigapotLens. Next: the Integration guide.