Find Travel Buddy

DOCUMENTSUTILITY

Contract purpose

Smart Contract that can be used for a decentralized application that connects solo travellers. Someone who wants to go on a trip and needs a travel buddy, will send to the contract the details of his trip, allowing fellow travellers to join trip.

Exposed methods and variables

creator the ethereum address of contract creator, given as parameter at contract creation

trips returns the details of the added trips

addTrip allows a traveller to create a trip on the contract, for other to join. It emits the NewTrip event that will contain the trip ID, this will be used to further identify this trip on the contract

parameter nametypedetails
_tripDatesstringthe dates when the trip will take place
_startLocationstringthe location from where the trip will start
_itinerarystringthe itinerary of the trip
_budgetintegeran estimate about the budget needed

joinTrip by calling this function, anyone can join a trip and notify the trip creator by emitting the NewTravelBuddy event

parameter nametypedetails
_tripIDintegerthe unique identifier of the trip

changeTripDates allows the trip creator to change the dates of his trip and it emits the TripDatesChanged event

parameter nametypedetails
_tripIDintegerthe unique identifier of the trip
_newDatesstringthe new dates of the trip

changeTripStartLocation allows the trip creator to change the start location of his trip and it emits the TripStartLocationChanged event

parameter nametypedetails
_tripIDintegerthe unique identifier of the trip
_newLocationstringthe new start location of the trip

changeTripItinerary allows the trip creator to change the itinerary of his trip and it emits the TripItineraryChanged event

parameter nametypedetails
_tripIDintegerthe unique identifier of the trip
_newItinerarystringthe new itinerary of the trip

changeTripBudget allows the trip creator to change the budget of his trip and it emits the TripBudgetChanged event

parameter nametypedetails
_tripIDintegerthe unique identifier of the trip
_newBudgetintegerthe new budget of the trip

Events

NewTrip

parameter nametypedetails
TripIDintegerthe unique identifier of the newly added trip

NewTravelBuddy

parameter nametypedetails
Buddyethereum addressthe address of the traveller who joined the trip
TripIDintegerthe unique identifier of the newly added trip

TripDatesChanged

parameter nametypedetails
TripIDintegerthe unique identifier of the newly added trip

TripStartLocationChanged

parameter nametypedetails
TripIDintegerthe unique identifier of the newly added trip

TripItineraryChanged

parameter nametypedetails
TripIDintegerthe unique identifier of the newly added trip

TripBudgetChanged

parameter nametypedetails
Winnerethereum addressthe address of the winner
Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract