Skip to main content

ICoolerComposites

Git Source

Functions

addCollateralAndBorrow

Allow user to add collateral and borrow from Cooler V2

User must provide authorization signature before using function

function addCollateralAndBorrow(
IMonoCooler.Authorization memory authorization,
IMonoCooler.Signature calldata signature,
uint128 collateralAmount,
uint128 borrowAmount,
IDLGTEv1.DelegationRequest[] calldata delegationRequests
) external;

Parameters

NameTypeDescription
authorizationIMonoCooler.AuthorizationAuthorization info. Set the account field to the zero address to indicate that authorization has already been provided through IMonoCooler.setAuthorization().
signatureIMonoCooler.SignatureOff-chain auth signature. Ignored if authorization_.account is the zero address.
collateralAmountuint128Amount of gOHM collateral to deposit
borrowAmountuint128Amount of USDS to borrow
delegationRequestsIDLGTEv1.DelegationRequest[]Resulting collateral delegation

repayAndRemoveCollateral

Allow user to add collateral and borrow from Cooler V2

User must provide authorization signature before using function

function repayAndRemoveCollateral(
IMonoCooler.Authorization memory authorization,
IMonoCooler.Signature calldata signature,
uint128 repayAmount,
uint128 collateralAmount,
IDLGTEv1.DelegationRequest[] calldata delegationRequests
) external;

Parameters

NameTypeDescription
authorizationIMonoCooler.AuthorizationAuthorization info. Set the account field to the zero address to indicate that authorization has already been provided through IMonoCooler.setAuthorization().
signatureIMonoCooler.SignatureOff-chain auth signature. Ignored if authorization_.account is the zero address.
repayAmountuint128Amount of USDS to repay
collateralAmountuint128Amount of gOHM collateral to withdraw
delegationRequestsIDLGTEv1.DelegationRequest[]Resulting collateral delegation

COOLER

Get the Cooler contract address

function COOLER() external view returns (IMonoCooler);

collateralToken

Get the collateral token contract address

function collateralToken() external view returns (IERC20);

debtToken

Get the debt token contract address

function debtToken() external view returns (IERC20);

Events

TokenRefunded

event TokenRefunded(address indexed token, address indexed caller, uint256 amount);