Pubcrawl Tour

Contract purpose

This Smart Contract enables people to purchase Pubcrawl tour tickets from an entity who offers this kind of service.

Exposed methods and variables

guide the ethereum address of the tour guide, given as parameter at contract creation

tours returns the details of a tour when called with the tourID

addTour allows the guide to add a new tour for which people can register and buy tickets, It emits the NewTour event that gives the tourID by which the tour can be further identified

parameter nametypedetails
_tourDateintegerthe date of the tour (unix time)
_ticketPriceintegerthe price of the tour for one person
_maxCapacityintegerthe maximum number of people alllowed on the tour
_meetingPlacestringthe location from where the tour begins
_tourDetailsstringthe list of bars and clubs that the tour includes

buyTickets allows a tourist to buy one or more tickets for a specific tour and emits the NewPurchase event. The amount of Wei sent to the contract has to be equal to the price of the tickets (number of tickets * price of ticket)

parameter nametypedetails
_tourIDintegerthe unique identifier of the tour
_nrOfTicketsintegerthe number of tickets the tourist wants to buy
_emailstringthe email of the buyer

closeTourPurchasing by calling this function, the tour guide can close the purchasing of tickets for a certain tour

parameter nametypedetails
_tourIDintegerthe unique identifier of the tour

getCustomerDetails returns the details of a buyer when called by the tour guide

parameter nametypedetails
_customerethereum addressthe address of the buyer

transferMoney allows the guide to transfer money from the contract's balance to his own account

parameter nametypedetails
amountintegerthe sum the guide wants to transfer

getBalance returns the balance of the contract when called by the guide



parameter nametypedetails
customerAddressethereum addressthe address of the new buyer


parameter nametypedetails
TourIDintegerthe ID of the new added tour
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract