Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function reclaimLeaseDeposit() public {
Lease storage lease = tenantLease[msg.sender];
require(lease.leaseFullyPaid, "Lease must be fully paid to take back lease deposit");
require(lease.leaseDepositUsd > 0, "Lease deposit has already been removed");
tenantAddress = msg.sender;
workingState = State.reclaimingLeaseDeposit;
fetchUsdRate();
}
function _reclaimLeaseDeposit() internal {
workingState = State.idle;
Lease storage lease = tenantLease[tenantAddress];
uint leaseDeposit = lease.leaseDepositUsd;
lease.leaseDepositUsd = 0;
tenantAddress.transfer(leaseDeposit.div(ETHUSD).mul(1e18));
emit leaseDepositReclaimed(
tenantAddress,
leaseDeposit
);
}
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.