Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch lend function #786

Merged
merged 3 commits into from
May 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/employment-based-loan/contracts/EmploymentLoan.sol
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ contract EmploymentLoan is SuperAppBase {
require(employerFlowRate >= getPaymentFlowRate());

if (collateralAmount > 0) {
require(collateralToken.balanceOf(address(this)) == uint256(collateralAmount));
require(collateralToken.balanceOf(address(this)) >= uint256(collateralAmount));
}
//lender must approve contract before running next line
borrowToken.transferFrom(msg.sender, address(this), uint256(borrowAmount));
borrowToken.transferFrom(msg.sender, borrower, uint256(borrowAmount));
//want to make sure that tokens are sent successfully first before setting lender to msg.sender
int96 netFlowRate = cfa.getNetFlow(borrowToken, address(this));
(, int96 outFlowRate, , ) = cfa.getFlow(borrowToken, address(this), borrower);
Expand Down