Vehicle Inspections Record

DOCUMENTSFINANCIALTOOLSUTILITY

Contract purpose

This Smart Contract keeps a record of the vehicle inspections made by an auto service

Contract Parameters

_inspection price given as parameter at contract creation, this is the price for a vehicle inspection

Exposed methods and variables

serviceManager the ethereum address of car service, given as parameter at contract creation

requests returns the details of an inspection request made by a driver when called with the specific requestID

inspections returns the details of an inspection when called with the specific inspectionID

sendRequest allows drivers to send a request to have their vehicle inspected. It emits the NewRequest event

parameter nametypedetails
_carBrandstringthe brand of the car the driver wants to have inspected
_carLicenceNrstringthe licence number of the car

confirmRequest the car service manager has to confirm the request before an inspection can take place, it emits the RequestConfirmed event

parameter nametypedetails
_requestIDintegerthe unique identifier of the request

payInspection using this payable function, the driver has to pay for the inspection once the manager confirms it, after this he can go to the car service to have the vehicle inspected. It emits the InspectionPaid event

parameter nametypedetails
_requestIDintegerthe unique identifier of the request

inspectCar called by the service manager to register the inspections he makes

parameter nametypedetails
_requestIDintegerthe unique identifier of the request
_inspectionDateintegerthe date of the inspection (unix time)
_reportHashstringthe hash of the report made about the vehicle state, the report is kept on an external service, but it cannot be modified once its hash is put on the blockchain

changeInspectionPrice using this function, the manager can change the price of the inspections

parameter nametypedetails
_newPriceintegerthe new price of the inspection

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

parameter nametypedetails
amountintegerthe sum the manager wants to transfer

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

Events

NewRequest

parameter nametypedetails
RequestIDintegerthe id of the request sent

RequestConfirmed

parameter nametypedetails
RequestIDintegerthe id of the confirmed request

InspectionPaid

parameter nametypedetails
RequestIDintegerthe id of the request

InspectionDone

parameter nametypedetails
RequestIDintegerthe id of the request
InspectionIDintegerthe id of the inspection
Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract