Skip to content

A decentralized ticketing system built on the Internet Computer (IC) using Azle

License

Notifications You must be signed in to change notification settings

akmalhisyammm/ticketing-system-icp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ticketing System

This smart contract is a decentralized ticketing system built on the Internet Computer (IC) using Azle. The system allows organizer to create and sell tickets for their events in a secure, traceable, and transparent manner.

You can always refer to The Azle Book for more in-depth documentation.

Requirements

Installation

Clone this repository:

git clone https://github.com/akmalhisyammm/ticketing-system-icp.git
cd ticketing-system-icp

dfx is the tool you will use to interact with the IC locally and on mainnet. If you don't already have it installed:

npm run dfx_install

Next you will want to start a replica, which is a local instance of the IC that you can deploy your canisters to:

npm run replica_start

If you ever want to stop the replica:

npm run replica_stop

Now you can deploy your canister locally:

npm install
npm run canister_deploy_local

To call the methods on your canister:

npm run canister_call <METHOD_NAME>

Assuming you have created a cycles wallet and funded it with cycles, you can deploy to mainnet like this:

npm run canister_deploy_mainnet

Methods

  • createUser: This method is used to create a new user. There are two valid user roles, organizer for ticket seller and participant for ticket buyer. Please choose it wisely.
  • createEvent: This method is used to create a new event. Only users with the organizer role can use this method.
  • createTickets: This method is used to create new tickets. Only users with the organizer role can use this method.
  • getMe: This method is used to retrieve the current user.
  • getEvents: This method is used to retrieve all events.
  • getTicketsByEvent: This method is used to retrieve all tickets for an event.
  • getMyTickets: This method is used to retrieve all current user's tickets.
  • getMyTransactions: This method is used to retrieve all current user's transactions.
  • buyTicket: This method is used to buy a ticket. Only users with the participant role can use this method.
  • transferTicket: This method is used to transfer owned ticket to another participant. Only users with the participant role can use this method.

License

This smart contract is licensed under MIT License. Please see the LICENSE for more information.

About

A decentralized ticketing system built on the Internet Computer (IC) using Azle

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published