NFT-Based Event Ticketing System This repository contains a smart contract and supporting details for an NFT-based event ticketing system. The project leverages non-tradable NFTs to create a secure, immutable, and transparent system for managing event tickets.

πŸ“ Project Overview This system implements the following key features:

Non-Tradable Tickets: Each ticket is minted as a unique NFT that cannot be transferred or traded, ensuring authenticity and preventing ticket scalping. Immutable Metadata: Each ticket is associated with metadata (e.g., event details) stored on IPFS. Minting Fee: Users pay a fixed fee (0.001 Ether) to mint tickets. Limited Supply: A maximum of 50 tickets are available for minting. Secure Withdrawals: The contract owner can withdraw funds collected from ticket sales. The deployed smart contract is available at: Contract Address: 0xcc953a40dfeb38d145710c43c1a9daec39dfa413

πŸš€ Setup Instructions Prerequisites Before you begin, ensure you have the following:

Ethereum Wallet: Install MetaMask. Node.js & npm: Install from Node.js official site. Ethereum Testnet Access: Use Sepolia or Goerli test networks. Steps to Deploy and Use the Smart Contract Clone the Repository: git clone https://github.com/yourusername/TicketNFT.git cd TicketNFT npm install 🌟 Features Non-Tradable NFTs: Tickets are linked to the buyer’s wallet and cannot be resold or transferred, ensuring secure and fair distribution.

Fixed Minting Fee: Users pay 0.001 Ether per ticket, making the system predictable and affordable.

Supply Limit: A maximum of 50 tickets ensures exclusivity.

Metadata Integration: Ticket details (e.g., event name, date, and seat number) are stored as metadata, uploaded to IPFS for decentralization.

Secure Withdrawals: Only the contract owner can withdraw funds from the contract.

πŸ› οΈ Tech Stack Blockchain Solidity: Programming language for smart contracts. Ethereum: Blockchain platform for deployment. OpenZeppelin: Libraries for ERC721 implementation. Frontend React.js: Framework for building the user interface. ethers.js: Library for blockchain interactions. Decentralized Storage IPFS/Pinata: For storing ticket metadata and ensuring decentralization. πŸ”§ Contract Functions Public Functions: mintTicket(string memory uri): Allows users to mint a ticket by paying 0.001 Ether. uri contains metadata stored on IPFS.

getCurrentTicketCount(): Returns the total number of tickets minted.

getLastBuyerInfo(): Returns the last buyer's address and the last minted token ID.

tokenURI(uint256 tokenId): Retrieves the metadata URI for the given token ID.

Owner-Only Functions: withdraw(): Allows the contract owner to withdraw funds from the contract balance.

getOwner(): Returns the owner's wallet address.

Non-Transferable Override: Internal _update Function: Prevents the transfer of tickets to ensure they remain non-tradable. πŸ’‘ Advantages of Non-Tradable NFTs Over QR Codes Security: NFTs are tied to a wallet address and cannot be duplicated, unlike QR codes which can be easily forged or shared.

Prevent Scalping: By making NFTs non-transferable, it ensures tickets cannot be resold at inflated prices.

Transparency: All transactions are recorded on the blockchain, ensuring traceability and preventing fraud.

Immutable Metadata: Event details stored in the NFT metadata are tamper-proof when hosted on decentralized storage (e.g., IPFS).

Reusable Identity: The same NFT-based system can be extended to include user privileges, loyalty programs, and access control.

πŸ“„ Example Usage Minting a Ticket Connect your wallet using MetaMask. Call the mintTicket function, passing the metadata URI as input. Pay 0.001 Ether as the minting fee. The minted ticket NFT will appear in your wallet. Withdrawing Funds The owner calls the withdraw function to transfer all collected funds to their wallet. Viewing Ticket Metadata Call the tokenURI function with a token ID to retrieve the metadata URL

Built With

Share this project:

Updates

Submission history