Moving Company

UTILITYTOOLS

Contract purpose

This Smart Contract can act as back-end for a dApp that allows moving companies to offer their services to people who need a moving truck or other kinds of help while moving.

Exposed methods and variables

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

services returns the details of a listed moving service when called with its particular service type

addService allows the manager to add a new service to the list. People can search thought these and find the one which is more suitable for their needs. It emits the serviceAdded event

parameter nametypedetails
_serviceTypeintegerthe identifier of the service type (unique)
_minKmintegerthe minimum number of kilometers the moving truck has to make during the moving process to fit in this service type
_maxKmintegerthe maximum number of kilometers the moving truck is allowed to make during the moving process to fit in this service type
_priceintegerthe price of this service (in wei)

selectMovingService this paaybale function is used by people who need a moving service. THe amount of wei sent to the contract has to be equal to the price of the service. It emits the newMoving event

parameter nametypedetails
_serviceTypeintegerthe service type the person needs
_houseAddressstringthe address of the house from where the person is moving out
_destinationAddressstringthe address to where the things are moved
_movingDateintegerthe date of the moving

getMovingDetails returns the details of a moving

parameter nametypedetails
_movingIDintegerunique identifier of the booking made for the moving 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

serviceAdded

parameter nametypedetails
Typeintegerthe ID of the added service type

newMoving

parameter nametypedetails
MovingIDintegerthe ID of the new moving booking
Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract