Motorcycle Rental

UTILITY

Contract purpose

This contract can be used for managing the activity of a motorcycle rental place.

Exposed variables and methods

owner : the address of the creator of the contract Motorcycle : holds all the info of a vehicle(unique id, model and availability(true/false)) Client : holds all the info of a client(unique id and name)

motorcycles : maps each motorcycle to its id motorcyclesIds : a list of all motorcycle ids

clients : maps each client to their address clientAccounts : a list of all client addresses

rentals : maps each client address to a vehicle (represents a rental)

addMotorcycle : allows the manager to add a new vehicle (available by default)

parameter_nametypedetails
_iduintthe unique id of the motorcycle
_modelstringthe model

addClientToVehicle : allows a rental to be registered

parameter_nametypedetails
_mIduintthe motorcycle id
_addressaddressclient's ethereum address
_clientIduintclient's unique id
_namestringname of the client

returnMotorcycle : allows the manager to make a vehicle available again

parameter_nametypedetails
_iduintmotorcycle's unique id

clientInformation : returns all info on a client specified by their address

parameter_nametypedetails
_addressaddressclient's ethereum address

vehicleInformation : returns all info on a vehicle speicfied by its id

parameter_nametypedetails
_iduintmotorcycle's unique id

isMotorcycleAvailable : checks the availability of a vehicle (true if available, false otherwise)

parameter_nametypedetails
_iduintmotorcycle's unique id
Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract