Revolutionary blockchain-based NFT event ticketing platform - Secure, transparent, and fraud-proof ticketing for the modern world
QuantumTicket is a decentralized event ticketing platform built on Ethereum that transforms event tickets into unique NFT tokens. The platform empowers event organizers to create, manage, and monetize events while providing attendees with true ownership of their tickets through blockchain technology.
- π« NFT-Based Tickets - Each ticket is a unique ERC-721 token
- π Anti-Scalping Protection - Transfer locks and purchase limits
- π° Organizer Revenue - Direct withdrawal of ticket sales
- π Scanner System - Authorized ticket validation at venues
- β° Time-Based Entry - Configurable entry open times
- πΈ Refund Mechanism - Organizer-controlled ticket refunds
- π Multi-Wallet Support - MetaMask, WalletConnect, and more
- Node.js
v18+ - npm or yarn
- MetaMask or compatible Web3 wallet
- Sepolia ETH for testing (get from faucet)
# Clone repository
git clone https://github.com/subhajitlucky/quantumTicket.git
cd quantumTicket
# Setup blockchain (Smart Contracts)
cd blockchain
npm install
# Create .env file with your configuration
cp .env.example .env
# Edit .env with your PRIVATE_KEY, SEPOLIA_RPC_URL, ETHERSCAN_API_KEY
# Setup frontend
cd ../frontend
npm install
# Create .env file for frontend
# Add VITE_WALLETCONNECT_PROJECT_ID and VITE_CONTRACT_ADDRESS
# Start development server
npm run devBlockchain (.env)
PRIVATE_KEY=your-private-key-here
SEPOLIA_RPC_URL=https://your-sepolia-provider.example
ETHERSCAN_API_KEY=your-etherscan-api-keyFrontend (.env)
VITE_WALLETCONNECT_PROJECT_ID=your-walletconnect-project-id
VITE_SEPOLIA_RPC_URL=https://your-sepolia-provider.example
VITE_CONTRACT_ADDRESS=0xYourSepoliaQuantumTicketAddressBuilt on Solidity 0.8.20 with OpenZeppelin security standards:
- ERC-721 NFT Standard - Full NFT implementation with URI storage
- Event Management - Create, deactivate, and manage events
- Ticket Purchase - Buy tickets with platform fee (0.0001 ETH)
- Anti-Scalping - Max 5 tickets per wallet per event
- Transfer Locks - Tickets cannot be transferred before event date
- Scanner Authorization - Event organizers can authorize scanners
- Entry Time Control - Configurable entry open times (default: 2 hours before event)
- Pull Payment Pattern - Organizers withdraw accumulated funds
- Refund System - Organizers can refund tickets (deducted from balance)
- Emergency Controls - Pause functionality for contract owner
Tech Stack:
- React 18 - Modern UI framework
- Vite - Fast build tool and dev server
- Wagmi v2 - React hooks for Ethereum
- RainbowKit - Beautiful wallet connection UI
- Ethers.js v5 - Ethereum library
- React Router - Client-side routing
Key Components:
HomePage- Landing page with featured eventsEvents- Browse and purchase ticketsMintTicket- Create new events (organizers)TicketList- View and manage owned ticketsOrganizerDashboard- Manage events, scanners, funds, refundsScannerTicketView- Validate tickets at venue entryConnectButton- Wallet connection UI
- Create events with customizable details (name, date, venue, price, max tickets)
- Set entry open time (when scanning/validation begins)
- Deactivate events to stop ticket sales
- View event statistics (tickets sold, revenue)
- Purchase Tickets - Buy tickets for active events
- NFT Ownership - Each ticket is a unique NFT token
- Purchase Limits - Maximum 5 tickets per wallet per event (anti-scalping)
- Transfer Restrictions - Tickets locked until after event date
- Ticket Validation - Mark tickets as used at venue entry
- Entry Time Control - Validation only allowed after entry open time
- Fund Withdrawal - Withdraw accumulated ticket sales
- Scanner Management - Add/remove authorized scanners per event
- Refund System - Refund tickets (burns NFT, returns payment)
- Event Analytics - View tickets sold and revenue per event
- Balance Management - Keep funds for refunds or withdraw
- Ticket Lookup - Enter token ID to view ticket details
- Validation - Mark tickets as used (only if authorized and entry time passed)
- Status Check - See if ticket is valid, used, or entry not yet open
- Authorization Check - Verify scanner status for event
- OpenZeppelin Standards - Battle-tested security patterns
- Reentrancy Protection - NonReentrant modifiers
- Access Control - Role-based permissions (owner, organizer, scanner)
- Transfer Locks - Prevent scalping before events
- Purchase Limits - Anti-scalping per-wallet limits
- Emergency Pause - Contract owner can pause operations
quantumTicket/
βββ blockchain/ # Smart contracts & deployment
β βββ contracts/
β β βββ QuantumTicket.sol # Main NFT contract (407 lines)
β βββ scripts/
β β βββ deploy.js # Deployment script
β β βββ mintTestTicket.js # Test ticket minting
β βββ test/ # Contract tests
β βββ hardhat.config.js # Hardhat configuration
β βββ package.json
β
βββ frontend/ # React application
βββ src/
β βββ components/ # React components
β β βββ HomePage.jsx
β β βββ Events.jsx
β β βββ MintTicket.jsx
β β βββ TicketList.jsx
β β βββ OrganizerDashboard.jsx
β β βββ ScannerTicketView.jsx
β β βββ ConnectButton.jsx
β β βββ WalletConnect.jsx
β βββ hooks/ # Custom React hooks
β β βββ useWallet.js
β β βββ useContract.js
β β βββ useEthersSigner.js
β βββ services/ # Business logic
β β βββ ticketIndexer.js # Client-side ticket indexing
β βββ contracts/ # Contract ABIs
β βββ wallet/ # Wallet configuration
β βββ styles/ # CSS styling
βββ public/
β βββ quantumticket-logo.svg # Favicon
βββ package.json
cd blockchain
npm testcd frontend
npm run lintcd frontend
npm run build- Deploy to Sepolia Testnet:
cd blockchain
npx hardhat run scripts/deploy.js --network sepolia- Update Frontend:
- Add deployed contract address to
frontend/.env - Set
VITE_CONTRACT_ADDRESS=0x...
- Add deployed contract address to
The frontend is configured for Vercel deployment with:
- SPA routing support (
_redirectsfile) - Environment variable configuration
- Production build optimization
- β
Private Keys - Never commit
.envfiles (already in.gitignore) - β Environment Variables - All secrets use environment variables
- β Contract Addresses - Public addresses are safe to commit
- β OpenZeppelin - Using audited security patterns
β οΈ Refund Security - Organizers must keep balance for refundsβ οΈ Scanner Authorization - Only authorized scanners can validate tickets
Contract: QuantumTicket.sol
- Standard: ERC-721 (NFT)
- Network: Ethereum Sepolia Testnet
- Platform Fee: 0.0001 ETH (fixed)
- Max Tickets per Wallet: 5 per event
- Transfer Lock: Until after event date
Key Functions:
createEvent()- Create new eventsbuyTicket()- Purchase ticketsuseTicket()- Validate/use ticketssetScanner()- Authorize scannerswithdrawOrganizerFunds()- Withdraw salesrefundTicket()- Refund ticketsdeactivateEvent()- Stop ticket sales
- Responsive Design - Works on mobile, tablet, and desktop
- Dark/Light Theme - Theme support (ready for implementation)
- Success/Error Messages - Clear user feedback
- Loading States - Spinner indicators during transactions
- Transaction Links - View transactions on Etherscan
- Ticket Display - Beautiful ticket cards with all details
- Event Grid - Browse events in responsive grid layout
- Hamburger Menu - Mobile-friendly navigation
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.