Repay
The repay flow enables users to repay the debt that they have borrowed. The following sections will explain what you need to do to repay successfully.
Transactional Function Sequence
repayLender
updateLoan
Note if repay is called on a users whos position is protected this will activate a cancelation of their protection. Also note to call this function we must approve the user blueprint address.
Step 1: Repay
function repay(bytes repayData, uint256 value, address onBehalf, string lenderName, uint256 loanId)
repayData
The repay data for the lender -
bytes memory _repayBytesData = abi.encode(_lenderProviderAddress, _loanToken, _rateMode, _loanAmount, _userAddress);
value
Ether value
onBehalf
The users Eth address
lenderName
The name of the lender
loanId
The users loanId
Step 2: Update Loan Info
function updateLoan(bytes loanInfo, address user, uint256 loanId, UpdateField)
loanInfo
The new loan amount for the user
user
The users eth address
loanId
The users loan Id
UpdateField
This will by default be set to 1
End of repay
Last updated