Skip to main content

ICoolerFactory

Git Source

Functions

generateCooler

Generate a new cooler.

function generateCooler(IERC20 collateral_, IERC20 debt_) external returns (address cooler);

Parameters

NameTypeDescription
collateral_IERC20The collateral token.
debt_IERC20The debt token.

Returns

NameTypeDescription
cooleraddressThe address of the new cooler.

getCoolerFor

Get the cooler for a given user \<\> collateral \<\> debt combination.

function getCoolerFor(address user_, address collateral_, address debt_) external view returns (address cooler);

Parameters

NameTypeDescription
user_addressThe user address.
collateral_addressThe collateral token.
debt_addressThe debt token.

Returns

NameTypeDescription
cooleraddressThe address of the cooler.

created

Check if a cooler was created by the factory.

function created(address cooler_) external view returns (bool);

Parameters

NameTypeDescription
cooler_addressThe cooler address.

Returns

NameTypeDescription
<none>boolbool Whether the cooler was created by the factory.

Events

RequestLoan

A global event when a new loan request is created.

event RequestLoan(address indexed cooler, address collateral, address debt, uint256 reqID);

RescindRequest

A global event when a loan request is rescinded.

event RescindRequest(address indexed cooler, uint256 reqID);

ClearRequest

A global event when a loan request is fulfilled.

event ClearRequest(address indexed cooler, uint256 reqID, uint256 loanID);

RepayLoan

A global event when a loan is repaid.

event RepayLoan(address indexed cooler, uint256 loanID, uint256 amount);

ExtendLoan

A global event when a loan is extended.

event ExtendLoan(address indexed cooler, uint256 loanID, uint8 times);

DefaultLoan

A global event when the collateral of defaulted loan is claimed.

event DefaultLoan(address indexed cooler, uint256 loanID, uint256 amount);

Errors

NotFromFactory

error NotFromFactory();

DecimalsNot18

error DecimalsNot18();