
Contract purpose
This Smart Contract keeps track of a person's expenditures and records the status of the person's funds.
Contract parameters
_totalBudget: the total funds the person has
Exposed methods and variables
manager the ethereum address of the contractor creator( the person for whom the expenditures are recorded) , given as parameter at contract creation
addExpenditure function called by the manager when he wants to add a new expenditure to the list and returns the inndex by which this expenditure can be further identified in the contract
parameter name | type | details |
---|---|---|
_description | string | details about how the money was spent |
_sum | integer | the amount spent |
_date | integer | date when the expenditure took place (unix epoch time) |
moneyReceived this function is called by the manager when he received money and wants to update the total funds available
parameter name | type | details |
---|---|---|
sum | integer | the amount to be added |
getExpenditureDetails returns the details about a particular expenditure stored inside the contract
parameter name | type | details |
---|---|---|
index | integer | the unique index of the expenditure |
getMoneyLeft returns the amount of money still available after all the current expenditures