This is a decentralized ticket marketplace smart contract for managing NFT (Non-Fungible Token) tickets using the ERC721 standard. The smart contract allows the creation of occasions (events) with specific details such as the name, cost of each ticket, maximum tickets available, date, time, and location. Users can then buy tickets for these occasions, and each ticket is represented as a unique NFT. Deployed to the Sepolia testnet.
![Screenshot 2023-07-17 at 04 53 40](https://private-user-images.githubusercontent.com/106417552/253844676-a7d3cc2c-2b59-4f10-8689-23d269f9f15a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ0NzIxMzksIm5iZiI6MTcyNDQ3MTgzOSwicGF0aCI6Ii8xMDY0MTc1NTIvMjUzODQ0Njc2LWE3ZDNjYzJjLTJiNTktNGYxMC04Njg5LTIzZDI2OWY5ZjE1YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODI0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyNFQwMzU3MTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jMjI5NWE1ZTY2MjQzZWI4MjVjMzU1NWYxZTJmY2IwODdiNTE4MDZhMjhlYTY5YTcyNjU4NDYxN2ZjMDVhZmNmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.L8ccF8nt_QMw6qDNtehI2Vg8ef4-NUuivKu4j9UAkwE)
Introducing the Decentralized Ticket Marketplace, a smart contract built on the Ethereum blockchain using the ERC721 standard to manage NFT (Non-Fungible Token) tickets. This innovative marketplace provides a secure and transparent platform for handling ticket transactions for various occasions and events. Through the smart contract, users can easily create occasions, specifying essential details such as occasion name, ticket cost, maximum ticket availability, date, time, and location. These occasions are stored on the blockchain, ensuring immutability and accessibility for all participants.
Once an occasion is listed, users can seamlessly purchase tickets for their desired events. Each ticket represents a unique NFT, providing a digital representation of the purchased ticket. By leveraging the power of NFTs, users gain ownership over their event tickets, enabling easy transferability, verification, and secure storage. With this decentralized ticket marketplace, event organizers can reach a broader audience, while attendees enjoy a frictionless ticketing experience, free from intermediaries and counterfeit concerns. Embrace the future of ticketing with the NFT-powered Decentralized Ticket Marketplace.
Key Features:
- Creation of occasions with detailed event information.
- Purchase of unique NFT tickets for listed occasions.
- Secure ownership and transferability of event tickets through NFTs.
- Elimination of counterfeit ticketing and intermediary involvement.
- Transparent and immutable storage of occasion data on the Ethereum blockchain.
- git
- You'll know you did it right if you can run
git --version
and you see a response likegit version x.x.x
- You'll know you did it right if you can run
- hardhat
- You'll know you did it right if you can run
npx hardhat --version
and you see a response like2.12.7
- You'll know you did it right if you can run
git clone https://github.com/ThomasHeim11/TicketToken.git
npm install
If you can't or don't want to run and install locally, you can work with this repo in Gitpod. If you do this, you can skip the clone this repo
part.
npx hardhat node
This will default to your local node. You need to have it running in another terminal in order for it to deploy.
npx hardhat run --network hardhat scripts/deploy.js
In this repo we cover unit testing
npx hardhat test
- Setup environment variables
You'll want to set your SEPOLIA_RPC_URL
and PRIVATE_KEY
as environment variables. You can add them to a .env
file, similar to what you see in .env.example
.
PRIVATE_KEY
: The private key of your account (like from metamask). NOTE: FOR DEVELOPMENT, PLEASE USE A KEY THAT DOESN'T HAVE ANY REAL FUNDS ASSOCIATED WITH IT.- You can learn how to export it here.
SEPOLIA_RPC_URL
: This is url of the goerli testnet node you're working with. You can get setup with one for free from Alchemy
Optionally, add your ETHERSCAN_API_KEY
if you want to verify your contract on Etherscan.
- Get testnet ETH
Head over to faucets.chain.link and get some tesnet ETH. You should see the ETH show up in your metamask.
- Deploy
npx hardhat run scripts/deploy.js --network sepolia
If you appreciated this, feel free to follow !