Utilities Payments Record

Contract purpose

Keep a record of all your utilities ( electricity, heat etc) payments.

Contract parameters

owner : the address of the owner

Exposed methods and variables

addUtility : called by the owner to add a new utility and returns the utility index

parameter nametypedetails
_utilityTypestringutility type (electricity, heat, water etc)
_paymentAddrethereum addressthe address where the owner needs to pay this utility

payUtility : used to record the utility payment. The owner sends the money and they will be transferred to the address specified when the function addUtility was called and the function returns the timestamp of the transaction

parameter nametypedetails
_indexintegerindex of the utility to be paid

changeUtilityAddr : allows the owner to change the address where the money from utility payment will be sent

parameter nametypedetails
_newAddrethereum addressthe new address
_indexintegerindex of the utility to be paid

getUtilityPayment : return the amount the owner paid for a certain utility at a certain time

parameter nametypedetails
_paymentDateintegerthe payment timestamp (unix epoch time)
_indexintegerindex of the utility to be paid
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract