Event Ticket Marketplace on a Local EVM Chain with Escrow, Reorg-Safe Indexing and Signed Check-In

Build event tickets as ERC-721 tokens that can change hands only through a capped resale market, with escrowed sales, pull-payment refunds and settlement, and roles on separate accounts; prove the contract with Foundry unit, fuzz and invariant tests; and build a reorganisation-safe indexer, an honest web application and an EIP-712 check-in gate around it, all on a local EVM chain.

Blockchain Developer. Advanced.

What you will build and explain

  • Design a contract's state, roles and money flows so no role can take funds it is not owed and every party can always withdraw what it is owed: escrow, credits, pull payments, a pause that never traps money.
  • Write and test Solidity with Foundry unit, fuzz and invariant tests, defend it against reentrancy (including through ERC-721 receiver hooks), and deploy it with a script that holds no private key.
  • Explain confirmations, finality and reorganisations, and build an indexer that detects reorganisations by parent hash, rolls back in one transaction and never presents orphaned events as fact.
  • Integrate a browser application with a contract through viem and an allowlisted JSON-RPC proxy, showing submitted, included, final, failed and unknown transactions honestly.
  • Verify EIP-712 check-in signatures against final on-chain ownership, admit each ticket once and record admissions on chain in batches.
  • Threat-model the system, read its metrics and tested alert rules, and discuss its design and limits in an interview.

Before you begin

  • Programming in at least one language and reading TypeScript or JavaScript; HTTP and JSON APIs; basic SQL with keys and transactions; the idea that a private key signs and a public key verifies; docker compose up, logs, exec and run; reading short shell scripts.
  • A workstation with Docker 26+ and Compose 2.24+, about 2 CPU cores, 3 GB of memory for Docker, 5 GB of free disk and a browser. Solidity, Foundry, the EVM, viem, indexing and contract security are taught; no wallet, cloud account or real funds are used.

Who this is for

For developers who program, use HTTP, SQL and Docker, and know that a private key signs, and want to build and prove a smart-contract marketplace with escrow, a reorganisation-safe indexer and signed check-in.

Curriculum

Learning topics (13)
  1. Follow a ticket from purchase to the door

    Lanternhall's tickets live on a chain; everything else in this picture exists to make that chain usable by people at a box office and at a door. This page follows the system as one story: why it is split this way, who may do what, where the money sits, how a purchase becomes final, how the copy of the chain survives a reorganisation, how a fan gets through the door, and what an operator watches. The lessons go deeper into each technology; this page is meant to make sense on i

  2. Prepare the workstation and the ideas you will need

    This project assumes you can program, call an HTTP API and run containers. It does not assume you have written a smart contract or used a blockchain. This page lists what you should be able to do before you start, introduces the few cryptographic ideas every later lesson leans on, and shows how to check that your workstation can run the lab.

  3. Blocks, transactions, receipts and logs on a local chain

    When Alice buys two tickets, what actually changes, who agrees that it changed, and how does a program outside the chain find out? This lesson answers those three questions with the lab's own chain, so that the contract, the indexer and the web page in later lessons have something solid to stand on.

  4. State, functions and a ticket that cannot wander

    A contract is a program whose state lives on the chain and whose functions anyone can call, and its code cannot be changed after deployment. That makes two questions central: what does it store, and what can each function do to that state? This lesson reads TicketMarket through those questions. It covers the Solidity you need, the ERC-721 ticket standard, and the one override that stops tickets from moving outside the marketplace.

  5. Roles and an emergency stop that never traps money

    Who is allowed to create a show, cancel it, stop sales or admit people? On a chain there is no login page and no administrator who can fix a mistake later: the answer has to be written into the contract before it is deployed. This lesson shows how TicketMarket divides authority into roles held by separate accounts, and how its emergency stop is designed so that using it never locks anyone's money in.

  6. Escrow, pull payments and reentrancy

    A contract that holds other people's money has one job above all others: at every moment it must be able to pay everyone exactly what it owes them, and nobody else. This lesson follows the money through TicketMarket, explains the most famous way contracts have lost money (reentrancy), and shows the three defences the contract layers against it.

  7. Prove the contract with unit, fuzz and invariant tests

    Once a contract is deployed its code cannot be patched, and every bug is public. Testing therefore carries more weight than in most software: the tests are the last place a mistake is cheap. This lesson uses Foundry to show three kinds of evidence (unit tests for specific behaviour, fuzz tests for whole ranges of inputs, and invariant tests for properties that must survive any sequence of calls), plus the checks and the deploy script around them.

  8. Read, simulate, send and decode from TypeScript

    The contract only understands bytes: a 4-byte function selector followed by ABI-encoded arguments, and it answers with encoded return values, logs and revert data. Every program in this project (indexer, API, gate, tix and the web page) needs to turn TypeScript calls into those bytes and the bytes back into meaning. This lesson explains the ABI that makes that possible and how the project uses viem to read, simulate, send and decode.

  9. Index the chain and survive reorganisations

    The web page needs to answer "which tickets does Alice hold?" in milliseconds. The contract cannot answer it at all: its mappings cannot be iterated. So every chain application ends up keeping a copy of the chain's history in an ordinary database: an indexer. The hard part is not copying. It is that the newest part of what you copied can be taken back. This lesson explains confirmations, finality and reorganisations, then walks through an indexer that never presents a discard

  10. Show honest transaction status and expose the chain safely

    A chain application's user interface has a harder job than most: it must say "done" only when something is done, and on a chain that takes time and can be undone. It also needs a way to reach the chain that does not hand the browser control of the node. This lesson covers both: the transaction lifecycle the page shows, and the API's JSON-RPC proxy with its allowlist.

  11. Admit each ticket once with EIP-712 and final ownership

    At the door, the venue must decide in a second whether the person in front of it holds a ticket, and must never admit two people on one ticket. A QR code that just says "ticket 6" can be screenshotted and shared; a code signed by the ticket's holder, valid for a minute and checked against the chain, cannot be usefully copied. This lesson explains typed signatures (EIP-712), how the gate verifies them against final ownership, and how admissions reach the chain.

  12. Measure what matters and test the alert rules

    What should wake an operator at night for a ticketing system on a chain? Not CPU usage. The answers are specific to this kind of system: the copy of the chain falling behind, the chain rewriting history, a reorganisation deeper than the system's idea of final, the contract's money not adding up, sales left paused, admissions not reaching the chain. This lesson shows how the three services measure those things, how Prometheus turns them into alerts, and how the alert rules are

  13. Know what an attacker can still do and what changes before real money

    Every earlier lesson defended against something. This one puts the defences side by side: who might attack this system, what each could try, what stops them, and what still does not. It also lists what must change before anything like this holds real money. A threat model is the document an interviewer or auditor will ask for first.

Practical build steps (10)
  1. Prepare the workstation

    Starting point: a copy of the project source and a workstation you may administer. Finishing point: Docker answers, has enough CPU, memory and disk for the lab, and the four loopback ports the lab will publish are free or noted for replacement.

  2. Create the lab inputs

    Starting point: the workstation checks passed. Finishing point: a lab.settings file Compose reads in this terminal, a tix shortcut defined, and a configuration that validates; no container exists yet.

  3. Check and build

    Starting point: settings exported in this terminal; internet access for downloads. Finishing point: every static check passes and the lab's two images exist.

  4. Start the lab

    Starting point: both images exist and no lab containers are running. Finishing point: a local chain mining one block per second, TicketMarket deployed with its four roles on four accounts, and PostgreSQL, the indexer, the gate, the API and Prometheus healthy.

  5. Sell tickets and watch finality

    Starting point: the lab is running with no shows. Finishing point: show 1 on sale, Alice holding two final tickets, the show's escrow holding exactly their price, and three refusals explained by their custom errors.

  6. Resell, refuse transfers, cancel and refund

    Starting point: show 1 exists and Alice holds tickets 1 and 2. Finishing point: ticket 1 resold to Bob at the cap with the royalty credited, a direct transfer refused, show 2 cancelled, each ticket refunded once to its current holder, and Dave's credit withdrawn exactly once.

  7. Force a reorganisation

    Starting point: the lab is running with show 1 on sale. Finishing point: a purchase seen as pending and then removed by a three-block reorganisation, never reported final; the rollback recorded in the database and the indexer's log; and the ChainReorganized alert firing.

  8. Check in at the gate

    Starting point: the lab is running. Finishing point: a show with its doors open, one valid admission and one exact replay refused, a forged code, a stranger's code, an expired code and a not-yet-final purchase refused with their reasons, the admitted tickets marked used on chain, and resale refused now that the doors are open.

  9. Use the web application and operate the lab

    Starting point: the lab is running with the shows from the earlier milestones. Finishing point: a purchase made and followed to final in the browser, the emergency stop used and lifted with its alert, show 3 settled after its dispute window with the organiser paid once, and the solvency gap confirmed at zero in Prometheus.

  10. Remove the lab

    Starting point: any state, including a half-finished or failed step. Finishing point: no container, network or volume with the lab's project label remains; the images are kept and listed.

Access

Learning Access: INR 199 plus 18% GST. Source Pack: INR 399 plus 18% GST. 90 days of online access. No auto-renewal.

Cloud costs and boundaries

Runs entirely on your own workstation with Docker against a local development chain: no cloud account, public network, wallet or real funds are used. The container images use about 2 GB of disk. Workstation, network and Docker licensing terms remain your responsibility.

Licence and completion

Vectametric Project Source Licence (2026-09-27): personal learning, modification/deployment and attributed portfolio/interview demonstrations are permitted. Lawfully obtained copies remain usable after online access expires. Do not redistribute original source or the Source Pack; commercial/client production use requires separate permission. Third-party terms remain separate. See included LICENSE.txt and the Project Source Licence section of the site Terms.

Questions about projects

Do I need a cloud account?

You can read the project material without deploying it. Running a cloud build requires the accounts, permissions and tools listed in that project's prerequisites. Deployment runs in your environment, not in a hosted Vectametric lab.

Can I read the code with Learning Access?

Yes. Learning Access includes the online source-file browser and explanations. The Source Pack adds the downloadable reference repository where available. The project's licence governs use of the source.

Are cloud charges included?

No. Cloud and CI usage are separate. Read the project's cost notice, set a budget and stop deadline, and follow its destruction and leftover-resource checks.

Does the project include troubleshooting and interview preparation?

The project curriculum lists the available scenarios and interview topics. These focus on understanding the architecture and explaining decisions; they are not a promise of particular interview questions or a job.

How long can I use the project?

The project page and checkout show the online access period for your selected plan. Access does not auto-renew. Downloaded source remains subject to its licence; future releases are not automatically included.

Review the Terms and No-Refund Policy before confirming access. All sales are final; Vectametric does not offer refunds.

This website is operated by VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED, operating as Vectametric.

Corporate Identity Number (CIN): U85499KA2026OPC229822. GSTIN: 29AAMCV8281D1ZS. Registered office: RS NO/38/2A/1 BASTAND, ROAD MAHANTESH NAGAR, Ramdurg, Ramdurg, Belgaum- 591123, Karnataka.

Queries and grievances: Prajval Honnungar, Grievance Officer and Data Protection Contact.

Telephone: +91 94800 09310. Support: support@vectametric.com. Grievances: support@vectametric.com.

Copyright 2026 VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED. All rights reserved.

Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy