Protection

Protection Blueprint

ProtectionBlueprint.sol groups all actions related to adding and updating a loan's protection.

Functions

AddProtectionToLoan

This function adds protection to a loan, sets the ProtectionUpdate struct, and transfers the opening fee to a vault.

function addProtectionToLoan(
    bytes calldata protectionInfo_,
    bytes calldata protectionUpdateData,
    address user_,
    uint256 loanId_,
    uint256 openingFee_,
    address token_,
    string memory pointer_
)

Process:


SetProtectionUpdateLoanData

This is an internal function that sets the ProtectionUpdate struct and transfers opening fee to a vault

function setProtectionUpdateData(
    bytes calldata protectionUpdateData_,
    address user_,
    uint256 uniqueId_,
    uint256 openingFee_,
    address token_,
    string memory pointer_
)

Process:


TransferToVault

This is an internal function that transfers opening fee to a vault

function transferToVault(uint256 value_, address token_, address user_, string memory pointer_) private {

Process:

  • Validates the value.

  • Forwards the call to TransferToken action

  • Returns execution result

Last updated