Last active
March 22, 2020 07:44
-
-
Save EtDu/c28287ce1d72b89d2385837d2a584882 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function withdrawFunds() public onlyLandlord { | |
require(leaseBalanceWei > 0, "Lease balance must be greater than 0"); | |
uint transferAmount = leaseBalanceWei; | |
leaseBalanceWei = 0; | |
landlordAddress.transfer(transferAmount); | |
emit fundsWithdrawn( | |
transferAmount, | |
leaseBalanceWei | |
); | |
} | |
function getLease(address tenant) public view returns ( | |
uint8, | |
uint8, | |
uint16, | |
uint16, | |
uint32, | |
uint64, | |
uint64, | |
bool, | |
bool) { | |
Lease memory lease = tenantLease[tenant]; | |
return ( | |
lease.numberOfMonths, | |
lease.monthsPaid, | |
lease.monthlyAmountUsd, | |
lease.leaseDepositUsd, | |
lease.leasePaymentWindowSeconds, | |
lease.leasePaymentWindowEnd, | |
lease.depositPaymentWindowEnd, | |
lease.leaseDepositPaid, | |
lease.leaseFullyPaid | |
); | |
} | |
function getRate() public view returns (uint) { | |
return ETHUSD; | |
} | |
function getContractBalance() public view returns (uint) { | |
return uint(address(this).balance); | |
} | |
function() external payable {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment