Mortgage

FINANCIALDOCUMENTS

Contract purpose

Smart Contract that enforces a fixed-rate type of mortgage between two parties ( bank-client).

Contract parameters

mortgageID: unique identifier of mortgage contract

mortgageAmount : the total amount the client has to pay

monthlyRate : monthly rate to be paid

client : address of the client

deadline : maximum allowed time interval between two subsequent monthly pays (unix epoch time)

moneyTaken : the amount withdrawn by the bank so far

Exposed methods and variables

mortgagePaid : true when the whole amount is paid

lastPaid : time when the last monthly pay was made by the client

paidAmount : return how much the client has already paid

monthlyPay payable function called by the client for sending the monthly rate

checkClientMonthly called by the bank to check if the client paid

getBalance shows the current balance of the contract

changeClient allows the bank to change the address of the client in case the old client died etc.

parameter nametypedetails
_newClientethereum addressthe address of the new client

getMortgageMoney allows the bank to withdraw a sum of money from what the client has paid so far and if the whole sum was paid, the contract destructs itself.

parameter nametypedetails
howMuchintegerthe amount of money to be withdrawn
Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract