Skip to content

Instantly share code, notes, and snippets.

@EtDu EtDu/leaseGenerator.sol
Last active Mar 22, 2020

Embed
What would you like to do?
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
You can’t perform that action at this time.