Car Wash

Contract purpose

This Smart Contract manages a car wash system. There are more washing programs available for the client to choose. These programs are introduced to the contract by the system manager.

Exposed methods and variables

manager the ethereum address of system manager, given as parameter at contract creation

programs returns the details about a particular program (id, name, price) when called with the program id

addProgram function called by the manager when he wants to add a new program to the list

parameter nametypedetails
_idintegerunique identifier of the program
_namestringthe name of the program
_priceintegerthe sum a client need to pay for this program

washCar called by a client who wishes to have his car washed using a specific washing program.The client needs to send to the contract the exact price of the selected program. It emits the WahCar event

parameter nametypedetails
_numberstringthe licence number of the car
programIDintegerunique identifier of the washing program

getCarDetails returns the details about a particular car washed here (the licence number, program id, date, price paid)

parameter nametypedetails
ownerethereum addressthe address of the car owner

changeProgramPrice allows the manager change the price of a particular washing program

parameter nametypedetails
pIDintegerthe program ID
newPriceintegerthe new price of the program

transferMoney allows the owner 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



parameter nametypedetails
Numberstringthe licence number of the car
Ownerethereum addressthe address of the car owner
ProgramIDintegerthe id of the washing program to be used
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract