OfficeSpaceRenting

UTILITYTOOLSFINANCIALDOCUMENTS

Contract purpose

This smart contract manages renting office space. A building owner can add to the contract all the space units from different locations that he can rent out.

Exposed methods and variables

owner address of the buildings owner

list returns the details about a building consisting in more units

addSpace called by the owner to add a new office space location to the list and returns the office space ID by which the units from that particular location will be further identified

parameter nametypedetails
_locationstringlocation of the office units
_unitsintegerthe number of units the owner has at this location
_unitAreaintegerthe area of a unit
_unitPriceintegerthe price of a unit

rentOfficeSpace payable function called by a person who want to rent office space and emits SpaceRented event

parameter nametypedetails
idintegerbuilding id
nrOfUnitsintegerthe number of units the person wants to rent

removeClient allows the owner to remove a client and make the units he previously rented available again

parameter nametypedetails
idintegerbuilding id
_clientethereum addressthe address of the client who is to be removed

payRent allows a client to pay the monthly rent and updates the date of the last payment made. It emits RentPaid event

parameter nametypedetails
idintegerbuilding id

check client allows the owner to query the list and check the details about a client

parameter nametypedetails
idintegerbuilding id
addrethereum addressthe address of the client who is to be removed

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

Events

SpaceRented

parameter nametypedetails
spaceIDintegerunique identifier of the office space building
nrOfUnitsintegerthe number of units the client rented
clientethereum addressthe address of the client who rented the space

RentPaid

parameter nametypedetails
spaceIDintegerunique identifier of the office space building
clientethereum addressthe address of the client who rented the space
rentintegerthe amount the client pays for the space
Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract