Claim

Claim Actions

Transactional Functions

CreateClaim Contract

CreateClaim.sol contract is used to create a new claim associated with a protected loan. claim information(Link to interface)

function createClaim(bytes memory claimData, address user, uint256 loanId, uint256 promisedAmount, address collateralToken)

Process:

  • Validate user address and loan ID.

  • Decodes the claim data to extract the claim token and amount.

  • Validates the claim amount and token.

  • Fetches the protection update data related to the loan and decodes it.

  • Creates a new claim instance and encodes it.

  • Stores the claim data in concrete storage.


UpdateClaim Contract

UpdateClaim.sol contract is used to update existing claims data. claim update information(Link to interface)

function updateClaim(address user, uint256 loanId, uint256 amount)

Process:

  • Validate user address and loan ID.

  • Fetches and decodes the existing claim.

  • Calculates the new claim balance using CompoundInterestCalculator.

  • Updates the claim repaid status based on the amount.

Last updated