For the complete documentation index, see llms.txt. This page is also available as Markdown.

Protocol Reference

ABIs are served live, CORS-open, at https://llms.megapot.io/abi/<Name>.json and .txt. Fetch them at build or runtime. Do not copy ABIs into your repo, they go stale. Use the contract addresses in the table below (verified on-chain on Base, chain 8453).

Everything Megapot does runs through one contract: Jackpot. The other contracts are either tokens it mints, the pool it draws from, or thin helpers that route a purchase into it. This page is the short version: addresses, the call signatures that matter, and the core concepts. For full method-by-method detail, fetch the ABI.


Addresses (Base, chain 8453)


Purchase signatures

The five purchase routes all carry a trailing bytes32 _source telemetry tag, plus the two claim calls:

Confirm exact parameter types against the live ABI at llms.megapot.io/abi before you encode a call.

Before any purchase, approve USDC to the contract that receives payment (the contract you are calling). The full money-vs-telemetry split is covered in Referrals & attribution.


Key concepts

Ticket struct

normals is 5 unique numbers; ordering is not required to be sorted. Read ballMax and bonusballMax from Jackpot.getDrawingState() for the current drawing (do not hardcode 30), the ranges are per-drawing.

DrawingState at a glance

Jackpot.getDrawingState(_drawingId) returns the full state of a drawing. The fields you will reach for most:

Field
Meaning

prizePool

Total prize available for the drawing

ticketPrice

Cost per ticket, USDC (6 decimals)

referralFee

Fraction of ticket price paid to referrers (1e18 precision)

referralWinShare

Fraction of winnings shared with referrers (1e18 precision)

globalTicketsBought

Total tickets sold this drawing

drawingTime

Unix timestamp when the drawing executes

ballMax

Max normal-ball number for this drawing

bonusballMax

Max bonusball for this drawing

jackpotLock

true while a drawing is in progress

Read the live referral rates from referralFee and referralWinShare rather than assuming a fixed percentage.

Prize tiers

Matches map to one of 12 tiers, 0 through 11, by the formula matchedNormals * 2 + (bonusballMatch ? 1 : 0). Tier 0 is no match; tier 11 (all 5 normals + bonusball) is the jackpot.

Tier
Normals matched
Bonusball

0

0

No

1

0

Yes

2

1

No

3

1

Yes

...

...

...

10

5

No

11

5

Yes (jackpot)

Architecture


Which contract do I call?

Jackpot (0x3bAe643002069dBCbcd62B1A4eb4C4A397d042a2) is the main entry point. If you integrate only one contract, integrate this one. The rest are thin helpers that route into Jackpot, each for a specific job:

Contract
Use it when you need to

Jackpot

Buy up to 10 custom-number tickets, claim winnings, claim referral fees, or deposit/withdraw as an LP

JackpotRandomTicketBuyer

Buy quick-pick tickets, with numbers chosen on-chain

BatchPurchaseFacilitator

Buy more than 10 tickets in a single drawing

JackpotAutoSubscription

Buy tickets automatically across multiple drawings

TicketAutoCompoundVault

Claim winnings and re-buy in one transaction


Security & audits

The Megapot protocol has been independently audited and operates autonomously: anyone can build on it without permission.

Auditor
Date
Report

Zellic

Oct 2025

Code4rena

Nov 2025

Independent Auditors

Dec 2025

ABIs and contract artifacts are published at github.com/coordinationlabs/megapot-v2-public.

Found a vulnerability? Email security@megapot.io. Our Security policy covers scope, what to include, our PGP key, and safe harbor.


Next: Back to Build · Referrals & attribution

Last updated