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:
Validates user address and unique ID.
Forwards the call to
AddProtectionToLoan
actionExecutes the internal function
setProtectionUpdateLoanData
Returns execution result
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:
Validates user address and unique ID.
Forwards the call to
SetProtectionUpdate
actionExecutes the internal function transferToVault
Returns execution result
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