CoolerCallback
Allows for debt issuers to execute logic when a loan is repaid, rolled, or defaulted.
The three callback functions must be implemented if isCoolerCallback()
is set to true.
State Variables
factory
CoolerFactory public immutable factory;
Functions
constructor
constructor(address coolerFactory_);
isCoolerCallback
Informs to Cooler that this contract can handle its callbacks.
function isCoolerCallback() external pure returns (bool);
onRepay
Callback function that handles repayments.
function onRepay(uint256 loanID_, uint256 principlePaid_, uint256 interestPaid_) external;
onDefault
Callback function that handles defaults.
function onDefault(uint256 loanID_, uint256 principle, uint256 interest, uint256 collateral) external;
_onRepay
Callback function that handles repayments. Override for custom logic.
function _onRepay(uint256 loanID_, uint256 principlePaid_, uint256 interestPaid_) internal virtual;
_onDefault
Callback function that handles defaults.
function _onDefault(uint256 loanID_, uint256 principle_, uint256 interestDue_, uint256 collateral) internal virtual;
Errors
OnlyFromFactory
error OnlyFromFactory();