Skip to content

subhajitlucky/quantumTicket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ QuantumTicket ⚑

The Future of Event Ticketing

Revolutionary blockchain-based NFT event ticketing platform - Secure, transparent, and fraud-proof ticketing for the modern world

Project Progress Smart Contract Frontend License

πŸš€ Project Overview

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.

Key Highlights

  • 🎫 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

⚑ Quick Start

πŸ“‹ Prerequisites

  • Node.js v18+
  • npm or yarn
  • MetaMask or compatible Web3 wallet
  • Sepolia ETH for testing (get from faucet)

πŸ› οΈ Installation

# 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 dev

πŸ”§ Environment Variables

Blockchain (.env)

PRIVATE_KEY=your-private-key-here
SEPOLIA_RPC_URL=https://your-sepolia-provider.example
ETHERSCAN_API_KEY=your-etherscan-api-key

Frontend (.env)

VITE_WALLETCONNECT_PROJECT_ID=your-walletconnect-project-id
VITE_SEPOLIA_RPC_URL=https://your-sepolia-provider.example
VITE_CONTRACT_ADDRESS=0xYourSepoliaQuantumTicketAddress

πŸ—οΈ Architecture

Smart Contract: QuantumTicket.sol

Built 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

Frontend Architecture

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 events
  • Events - Browse and purchase tickets
  • MintTicket - Create new events (organizers)
  • TicketList - View and manage owned tickets
  • OrganizerDashboard - Manage events, scanners, funds, refunds
  • ScannerTicketView - Validate tickets at venue entry
  • ConnectButton - Wallet connection UI

🎯 Core Features

βœ… Event Management

  • 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)

βœ… Ticket System

  • 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

βœ… Organizer Features

  • 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

βœ… Scanner Features

  • 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

βœ… Security Features

  • 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

πŸ“ Project Structure

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

πŸ§ͺ Testing

Smart Contract Tests

cd blockchain
npm test

Frontend Linting

cd frontend
npm run lint

Build Production

cd frontend
npm run build

πŸš€ Deployment

Smart Contract Deployment

  1. Deploy to Sepolia Testnet:
cd blockchain
npx hardhat run scripts/deploy.js --network sepolia
  1. Update Frontend:
    • Add deployed contract address to frontend/.env
    • Set VITE_CONTRACT_ADDRESS=0x...

Frontend Deployment

The frontend is configured for Vercel deployment with:

  • SPA routing support (_redirects file)
  • Environment variable configuration
  • Production build optimization

πŸ” Security Considerations

  • βœ… Private Keys - Never commit .env files (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

πŸ“Š Smart Contract Details

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 events
  • buyTicket() - Purchase tickets
  • useTicket() - Validate/use tickets
  • setScanner() - Authorize scanners
  • withdrawOrganizerFunds() - Withdraw sales
  • refundTicket() - Refund tickets
  • deactivateEvent() - Stop ticket sales

🎨 UI/UX Features

  • 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

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❀️ by Subhajit

πŸš€ Building the future of event ticketing, one block at a time

GitHub

About

quantumTicket is a decentralized application (dApp) that allows event organizers to mint and sell NFT tickets for their events.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors