LuckDrop

A free recurring prize draw with tradable tickets, on Base. Read-only tools for the live draw, entries, results, tickets for sale on the market, and prizes.

Hosted MCP Server

npx add-mcp 'https://luckdrop.app/mcp'

Installs into Claude Code, Codex, Cursor and more

Documentation

LuckDrop

A free recurring prize draw with tradable tickets, on Base. Entry costs no ticket price; the entrant sends their own transaction and pays its gas. Five rounds: the first four each draw either the word "LUCK" or "DROP"; the fifth draws a number between 1 and 9,999. Match your ticket's slots to stay in. Tickets are NFTs and can be traded while the draw is running.

LuckDrop is running on Base (chain id 8453).

Automated participation

Automated entry is EXPLICITLY ALLOWED. From the Terms (section 4): "Automated entry is allowed. You may enter using a script, a bot, or an AI agent, and you pay the gas for your own entry like everyone else." The unit of the rule is the PERSON -- one entry per person per draw -- and the smart contract enforces it per WALLET, rejecting a second claim from the same wallet.

There is no CAPTCHA and no bot gate. Market trading is likewise open: the contract's buy function has no caller gate.

How to enter

Send claimTicketSelf() (selector 0x03e9f73e, no arguments) from the wallet that should receive the ticket, to the Draw contract below, on chain id 8453. The contract mints to msg.sender, so the sending wallet is the parameter.

CHECK BEFORE YOU SEND. GET https://luckdrop.app/api/agent/preflight?address=0xYourWallet returns, read from the chain rather than from our database, whether that wallet can enter right now and why not if it cannot. Its reason values mirror the contract's own revert strings: OK, ALREADY_CLAIMED, NOT_IN_CLAIM_PHASE, DRAW_FULL, PAUSED. Sending without checking risks a revert that costs you gas and gains you nothing.

YOU NEED A WALLET AND GAS BEFORE YOU CAN ENTER. Any Ethereum account works; for an agent a freshly generated private key is enough (Foundry: cast wallet new; viem: generatePrivateKey() then privateKeyToAccount(key)). Save the key to a file that only its owner can open (chmod 600) and keep it out of logs -- it controls the wallet and anything it wins. You also need an RPC to estimate gas; a public endpoint for this chain is https://mainnet.base.org. Gas is paid in ETH on Base. Any way of getting ETH into the wallet on Base works, for example a withdrawal from an exchange, a bridge from another chain, or a swap. Base's funding guide covers some routes: https://docs.base.org/get-started/get-funds The full walkthrough is in the interface contract below.

When things happen

Every draw runs the timetable the operator has set. A change applies from the next draw, so the live draw's own week.drawInterval on /api/draw/current is authoritative for it. Currently:

  • Entries are open for 74160 s (20 hours 36 minutes), counted from the draw's startedAt.
  • The reveal follows: entries close and every ticket's five slots are filled in on-chain by a Pyth Entropy callback. It usually takes a few minutes.
  • Round 1 runs as soon as the reveal lands, usually within a few minutes of entries closing. Rounds 2 to 5 follow 24660 s (6 hours 51 minutes) apart.
  • The whole draw takes about 172800 s (48 hours). Draws open on a fixed timetable: each one opens one draw length after the previous one opened, so the next draw may open some time after this one completes. On /api/draw/current, nextDrawAt gives the planned opening time of the next draw, in every phase. nextDrawCountdown is the seconds until then, nextLuckPrizeAmount is that draw's LUCK prize, and week.claimsCloseAt is when entries close for the current draw. This timetable holds -- but ONLY while autoCycleEnabled is true and autoCycleHalted is false on /api/draw/current. Otherwise no next draw is scheduled, and none should be assumed.

To see where the current draw is, read /api/draw/current: week.status is the phase, week.startedAt is when it opened, and week.countdown is the seconds until the NEXT EVENT FOR THAT PHASE -- entries closing (claiming), round 1 (revealing) or the next round (drawing). It is 0 once the draw is complete.

Polling. Nothing here changes faster than once a round, except the market. Once a minute is plenty for /api/draw/current, /api/draw/history and /api/draw/{week}/results; poll /api/market/listings no faster than every few seconds while you are actively trading. A 429 carries Retry-After in seconds -- wait that long before trying again.

Contracts (chain id 8453, Base)

  • Draw 0x27C5F5F4B1D8bbb894fA1A28995D47902F703e7D: entry (claimTicketSelf), week state, entrant cap
  • Ticket 0xe3f87ad0161D26ed01c1a7e4f74b058F77a077DC: the ticket NFT; hasClaimed(weekId, wallet) and getWeekTicketCount(weekId)
  • LUCK prize 0x27418416d03c8267ce14f8fA51714d0dbb401492: weekWinner(weekId), unclaimedPrize(weekId) and claimPrize(weekId) for LUCK prizes
  • USDC prize 0x531386013E6003F9b8A12E6285e9321CF35a1Fd4: the same three functions for USDC prizes
  • Market 0x52E01cB4c09C67A8638e6a672F5D7Ce739a6c822: list and buy live tickets while a draw is running. A completed sale pays a fee read from feeBasisPoints() on that contract, part of it into the draw's prize pool -- that share is prizeShareBasisPoints() on the same contract. Read BOTH values; do not assume a rate or a split, they are setters.
  • LUCK coin 0x48505aCF93fA0A6aE2bd90d5073510836F9fF7E4: the ERC-20 contract used for market settlement and prizes
  • Welcome-gift grants 0x5C1Ed38f1C071bE32a3A78d321EEc5E2b7b0B493: function claim(address to, uint256 amount, uint256 deadline, bytes calldata signature) external; (selector 0x2ada8a32) redeems a welcome-grant voucher, and claimed(address) says whether a wallet has already collected one

How the winner is decided

The first four rounds each draw either the word "LUCK" or "DROP"; the fifth draws a number between 1 and 9,999. A ticket is out at the first round it fails to match. The last one standing wins: the ticket that survives the most rounds, even if every ticket is out before round five. If several go out in the same round, the winner is the one whose five slots are closest overall to those drawn, measured as the total difference across all five positions -- in practice the final number decides it. If two are exactly equal on both measures, the earlier entry wins. Matching all five is 1 in 159,984, so nearly every draw is decided by survival rather than by an outright match.

ticketsAlive: 0 does not mean the draw has no winner: the remaining rounds are still drawn, and the winner is settled after round five. A ticket with status eliminated can still win, so read winnerTokenId once the draw is complete rather than assuming.

When a draw is cancelled

A draw is cancelled when entries close with fewer tickets than the minimum (minParticipation on the Draw contract, also published as chain.minParticipation in /api/draw/current), or when an operator cancels a draw that is stuck, which can happen mid-draw. A cancelled draw runs no further rounds and has no winner. Its tickets are kept as NFTs but take no further part. There is no ticket price to refund, and gas already spent is not returned. The next draw opens as usual.

To recognise one: the draw's status is cancelled, and /api/draw/{n}/results lists only the rounds that ran before the cancel (none, when entries closed short); the on-chain state is CANCELLED; /api/draw/current sets lastDrawCancelled: true when the most recent draw was cancelled; /api/draw/history lists completed draws only; and a ticket's metadata Status reads Draw cancelled.

Collecting a prize

Prizes are PULL payments: winning records the prize, and the winner must call claimPrize(weekId) themselves. You have 180 days from the award (PRIZE_CLAIM_WINDOW on the prize contract), after which an admin MAY return an unclaimed prize to a future draw's pool -- so collect promptly. weekId is the CONTRACT week id, not the display week number -- the two are different numbers. Every draw endpoint below returns both as contractWeekId and weekNumber; use contractWeekId.

CHECK weekWinner(weekId) EQUALS YOUR WALLET BEFORE YOU TRUST A BALANCE. A claim from any other wallet reverts with "Not winner" and costs you the gas. That is the same check claimPrize itself enforces.

Getting LUCK (the welcome grant -- called the "welcome gift" on the site)

Entry is free, but the market settles in LUCK coins. One way to get LUCK is the one-time welcome grant of 500 LUCK, and it is open to agents on exactly the same terms as people. There is no CAPTCHA on it.

You must ALREADY HAVE CLAIMED A TICKET on-chain to be eligible -- the grant follows entry, it does not fund it. Enter first, then claim the grant.

The endpoint is session-authenticated, and the session is obtained by signing in with your wallet (Sign-In With Ethereum, ERC-4361). Four HTTP calls, no API key, no account:

  1. POST https://luckdrop.app/api/auth/siwe/nonce Body: {} (or no body). Do NOT send a wallet address or chain id: the request is refused with a 400 if you do. Returns: {"nonce": "..."} -- single use, valid for 15 minutes.
  2. Build an ERC-4361 message with domain luckdrop.app, your wallet address, that nonce, and chainId 8453. The wallet and chain are read from this message, and the domain, nonce and chain id are all checked server-side; any one of them wrong is rejected.
  3. Sign the message with the wallet. EOA signatures, ERC-1271 contract signatures (deployed smart accounts, e.g. Safe), ERC-6492 wrapped signatures (an undeployed counterfactual account, e.g. a fresh Coinbase Smart Wallet) and ERC-8010 pre-delegated signatures (an EIP-7702 delegated EOA) are ALL accepted.
  4. POST https://luckdrop.app/api/auth/siwe/verify Body: {"message": "...", "signature": "0x..."} -- exactly these two fields. Returns 200 with {"success": true, ...} and a Set-Cookie session cookie. KEEP THE COOKIE and send it on subsequent requests -- a cookie jar is the session. The token in the body is not a bearer credential; there is no bearer auth here.

Then, with that cookie:

  • GET https://luckdrop.app/api/rewards/eligibility -- is a grant coming, and if not, why not. Read-only; it cannot mint or consume anything. It reads our database, which picks up a new entry within about a minute -- if you entered moments ago and see no_ticket_yet, POST https://luckdrop.app/api/tickets/sync with the same cookie and check again.
  • POST https://luckdrop.app/api/rewards/claim -- issues it as a SIGNED VOUCHER that you redeem on-chain, and you pay the gas. Returns 200 with a status of voucher (plus amount in LUCK wei, the signed voucher of to, amount, deadline, signature, and a ready-to-send tx of to, data, chainId), already_granted, in_progress, no_ticket_yet (you have not entered a draw yet -- enter, then come back), unavailable_now (the chain would refuse the claim this minute, so try later), cap_reached or budget_reached. A 429 with rate_limited means no grants are being issued today: retry tomorrow.

SEND THE tx AND PAY ITS GAS; nothing is minted until it lands. Any sender works -- the LUCK goes to voucher.to whoever pays -- so a relayer or a bundler can send it for you. POST /api/rewards/claim answers already_granted once the claim is on-chain, and voucher again until then. A voucher is claimable for 24 hours; ask again after that for a fresh one of the same amount. Asking again is always safe: a wallet can never collect two grants. To build the call yourself, see claim on the grants contract above.

Sign in once and keep the session; it lasts a week.

API

  • Agent registration: our ERC-8004 registration file — what we are, where to reach us, and our on-chain registry record once one exists.
  • MCP connector: a Model Context Protocol server. Add this URL as a connector and you get the draw, the entry preflight, results, market listings and claimable prizes as named tools, instead of driving the endpoints below by hand. The prize check is the one tool with no HTTP equivalent; everything else maps to an endpoint below. No authentication.
  • Agent Plugins package: installs the MCP connector above and a skill describing how to use it, in one step. Agent Plugins 1.0.0; the server config is at /plugin/mcp.json and the skill at /plugin/skills/luckdrop/SKILL.md.
  • Interface contract: the whole agent-facing contract in one Markdown page — the entry call, its four revert strings, the events to watch, and the one-entry-per-person rule. Start here if you are entering rather than reading.
  • OpenAPI 3.1: the endpoints below as a machine-readable schema, with the response shapes spelled out.
  • Current draw: live draw state, prize, entrant count, countdown. Publishes both weekNumber and contractWeekId. The week block is sourced from our database; the chain block beside it is read from the contracts, and chain.inSync says whether the two agree about which week this is and how far along it is. Trust chain when they disagree, and note chain is null (not false) when the chain could not be read. Do NOT compare chain.state to week.status yourself: the two advance at different moments, so a string comparison reports a healthy draw as broken. Use inSync.
  • Entry preflight: can this wallet enter, and the exact transaction to send. Sourced from the CHAIN. Requires an address query parameter.
  • Draw history: the last 10 completed draws, with both ids.
  • Draw results: one draw's rounds and winner. The path segment is the DISPLAY week number by default. If you are following contractWeekId, add ?id=contract -- the same number means different draws in the two id spaces, and without it you get a valid-looking 200 describing the wrong draw. The response echoes idSpace and both ids. Each round also carries vrf_request_id (the Pyth Entropy sequence number behind that round's randomness, as a string -- it is a uint64) and tx_hash with tx_url (the transaction that settled the drawn number), so a round can be checked against the chain rather than taken on trust. Null means we did not record it, not that it did not happen.
  • Market listings: live listings, and whether the trading window is open.
  • Ticket: one ticket's ERC-721 metadata by token id -- its status and, once revealed, its five round slots. The Ticket contract's getTicketNumbers(tokenId) and isAlive(tokenId) carry the same facts.

No authentication is needed for any of the above.

Pages

  • How it works: the rules, in plain English
  • Terms: the full rules, including the automated-entry clause
  • Privacy: what data is collected
  • LUCK coin: the coin used for prizes and market settlement
  • Sponsors: sponsoring a draw

Optional

  • The home and draw pages server-render the live draw, so their HTML is readable without executing JavaScript. The API endpoints above are still the better source: they are structured, and they carry the chain state.
  • The market, profile and login pages render client-side and their HTML carries navigation only. Fetch the API endpoints rather than scraping them.
  • Randomness comes from Pyth Entropy and is recorded on-chain; every result is independently verifiable.