Gardening Services

UTILITYESCROWFINANCIALTOOLS

Contract purpose

This Smart Contract provides a management system for a company that offers gardening and landscaping services to people who wish to beautify their gardens.

Exposed methods and variables

manager the manager of the company, given as parameter at contract creation

serviceList returns the details about a service when called with the particular serviceID

addService this function allows the company manager to add a new service to the list. The clients can request any of the services added to the contract

parameter nametypedetails
_idintegerthe unique identifier of the gardening service
_descriptionstringthe description of the provided services
_priceintegerthe price the people need to pay in order to use this service

newRequest by calling this payable function, a person can request one of the gardening services. The amount sent to the contract has to equal the price of the selected service. It emits the NewRequest event

parameter nametypedetails
_serviceIDintegerthe unique identifier of the gardening service

getRequestDetails returns the details (address of the client, serviceID) of a request sent to the contract

parameter nametypedetails
_requestIDintegerthe unique identifier of the request

changeServicePrice allows the manager to change the price of a service which was previously added

parameter nametypedetails
_serviceIDintegerthe unique identifier of the gardening service
_newPriceintegerthe new price of the service

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 new created request
Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract