Protection Covered and Uncovered
Step 1: setProtectionData
function setProtectionData(byte protectionInfo, bytes protectionUpdateData, bytes protectionFinanicalTerms, address user, uint256 loanId, uint256 openingFee, address token)
protectionInfo
The data from the protection struct -
Bytes memory protectionInfo = abi.encode
(openingFee
(This is in USD 8 decimals),cancellationFee,ltvProtect)
protectionUpdateData
The data from the protection update struct -
Bytes memory protectionUpdateData = abi.decode( endDate, totalCreditOffered)
protectionFinanicalTerms
The data from the protection financial terms struct please check the here inside the protection and financial terms.
user
The users eth address
loanId
The users loan Id
openingFee
The opening fee attached to the protection(This is in wei)
token
The Collateral Token Address
Step 2: Update Loan Info
function updateLoan(bytes loanInfo, address user, uint256 loanId, UpdateField)
loanInfo
Loan status is set to 1 - Covered
user
The users eth address
loanId
The users loan Id
UpdateField
This will be set to 2 to call to update the loan status
End of Protection
Last updated