
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_name | type | details |
---|---|---|
_id | uint | the unique id of the motorcycle |
_model | string | the model |
addClientToVehicle : allows a rental to be registered
parameter_name | type | details |
---|---|---|
_mId | uint | the motorcycle id |
_address | address | client's ethereum address |
_clientId | uint | client's unique id |
_name | string | name of the client |
returnMotorcycle : allows the manager to make a vehicle available again
parameter_name | type | details |
---|---|---|
_id | uint | motorcycle's unique id |
clientInformation : returns all info on a client specified by their address
parameter_name | type | details |
---|---|---|
_address | address | client's ethereum address |
vehicleInformation : returns all info on a vehicle speicfied by its id
parameter_name | type | details |
---|---|---|
_id | uint | motorcycle's unique id |
isMotorcycleAvailable : checks the availability of a vehicle (true if available, false otherwise)
parameter_name | type | details |
---|---|---|
_id | uint | motorcycle's unique id |