Ticketing System

Contract purpose

Smart contract for ticketing system

Exposed methods

owner: the system manager

getCustomerCount returns the number of customers

setTicketPrice allows the contract owner to set or change the ticket price value in wei

parameter nametypedetails
newPriceintegerticket new value in wei

getTicketPrice returns the price of the ticket

isCustomer checks whether the current customer is registered or not

parameter nametypedetails
customerAddressethereum addressaddress of the current customer

addCustomer allows the purchase of the ticket by adding a record on the blockchain

parameter nametypedetails
customerAddressethereum addresscustomer account address
customerNamestringcustomer name which will be displayed on ticket
citystringthe city for which the ticket is valid
ticketClassintegerticket Class such as Ist or 2nd Class.
durationintegerduration in number of days

getCustomer allows the customer or the owner to check the details of the purchasing

parameter nametypedetails
customerAddressethereum addresscustomer account address

checkValidity allows the customer or the owner to check the validity of the ticket

parameter nametypedetails
customerAddressethereum addresscustomer account address

transferFromContract allows the contract owner to transfer ether from contract account to EOA.

parameter nametypedetails
receiverethereum addressaddress of the receiver account
amountintegerthe amount to be transferred
Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract