Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GoodnessFx/GatePass/llms.txt
Use this file to discover all available pages before exploring further.
GatePass implements event tickets as ERC721 NFTs on the Polygon network, providing true ownership, transferability, and blockchain-based verification.
Overview
GatePass tickets are minted as ERC721 NFTs using theEventTicket.sol smart contract. Each ticket is a unique, verifiable digital asset that can be owned, transferred, and used for event access.
Key Features
True Ownership
Tickets are stored in user wallets as NFTs, giving attendees complete control over their tickets
Transferability
Event organizers can enable or disable ticket transfers based on event requirements
On-Chain Verification
All ticket data is verifiable on the blockchain, preventing counterfeits
Metadata Storage
Ticket metadata includes event details, seat information, and visual assets
Smart Contract Architecture
TheEventTicket.sol contract implements ERC721 with additional features for event ticketing:
Ticket Lifecycle
1. Deployment
Event tickets are deployed through theEventTicketFactory contract using minimal proxy clones for gas efficiency:
EventTicketFactory.sol
2. Minting
Users can mint tickets during the sale period:- Public Mint: Anyone can purchase up to
maxTicketsPerWallettickets - Allowlist Mint: Whitelisted addresses can mint during private sales
- Organizer Mint: Event organizers can mint complimentary tickets
3. Transfer
Tickets follow standard ERC721 transfer mechanics:4. Check-In
Tickets are marked as used during check-in and automatically mint a Proof of Attendance NFT:Token Metadata
Each ticket NFT includes metadata stored on IPFS or centralized storage:Database Integration
Ticket data is also stored in the database for efficient querying:schema.prisma
Security Features
Reentrancy Protection
Reentrancy Protection
All minting and financial functions use OpenZeppelin’s
nonReentrant modifier to prevent reentrancy attacks.Sale Period Enforcement
Sale Period Enforcement
The
onlySaleActive modifier ensures tickets can only be minted during the configured sale period.Supply Limits
Supply Limits
Hard cap on total supply prevents over-minting. Per-wallet limits prevent hoarding.
Pausable Contract
Pausable Contract
Event organizers can pause ticket sales in case of emergencies using the
pause() function.Allowlist Minting
Event organizers can configure allowlists using Merkle trees for private sales:Revenue Management
Event organizers can withdraw ticket sales revenue after the event:Querying Tickets
Check ticket availability and validity:Best Practices
Set Appropriate Supply
Configure
totalSupply based on venue capacity and expected demandConfigure Sale Periods
Set
saleStart and saleEnd to control when tickets can be purchasedEnable Transfer Controls
Use
pause() to prevent transfers if tickets should be non-transferableSet Per-Wallet Limits
Configure
maxTicketsPerWallet to prevent scalping and ensure fair distributionNext Steps
Learn About Ticket Verification
Discover how tickets are verified at event entrances using QR codes and blockchain data