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

Make sure to run each function in order from top to bottom. Please Click the links inside the module column for further information on the function's output. Also if the user is covered repaying will trigger a cancelation of their protection.

Module
Function

Step 1: Repay

function repay(bytes repayData, uint256 value, address onBehalf, string lenderName, uint256 loanId)

Parameters
Descriptions

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)

Parameters
Descriptions

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