Event tickets on the Ethereum blockchain
A project by Robert Scholz and Pierre Le Fevre, built in the context of the KTH DD2485 Programmable Society course.
This smart protocol is intended to simulate a ticketing system for an event such as the upcoming European Championship 2024 in football e.g. An owner can deploy a contract and create tickets for an event and checkin customers to an event. Customers can buy them for themselves or other people. A ticket owner can also return a ticket.
This ticket sale project is based on Ethereum and build with Solidity. The EventTicket.sol file can be deployed in remix, but there is also the possibility to use MetaMask with the website https://ticketmaestro.fun which intends to simulate a ticket purchasing website.
The smart contract ticket system allows to create events where a limitation of people should occur and/or the attendants should pay an entrance fee. The contract allows to deploy multiple events and multiple sections for each event.
Each event has one or more sections which can be seen as categories. Each section has a name, a fixed number of tickets available and a ticket price (in wei). Additionally there is a parameter which shows the number of tickets sold which is 0 at the beginning. Only the owner can create section and a section can only be created while the sale is not open.
Tickets are digital assets that are written into the blockchain. Each ticket has a sectionID it belongs to (the sectionID is created numerically while 0 is the oldest one created), the address of the assigned owner and a bool value that shows whether the ticket has been returned (blocked) or already used. A ticket can be returned, but only through the owner, during sale and only if it has not been returned or used. A ticket status can also be retrieved.
The tickets can be bought for themself or for other people. Requirements for a purchase are sufficient funds, an open sale, available number of tickets and a non-reached personal ticket limit. The mint happens during the purchase.
The tickets are personalised and can only be used by the owner and once the owner has checked in a person or a ticket owner has returned its ticket, the tickets cannot be used or returned anymore.
Testing of the contract can happen using the automated tool HardHat (file EventTicket_test.js). There are 42 tests covering 100% of the statements in various ways.
View the checklist.
Current address: 0x98C052036B69129E6007b50136b3DaA6E9A8c7a4