Skip to main content

IERC3156FlashLender

Git Source

Functions​

maxFlashLoan​

The amount of currency available to be lent.

function maxFlashLoan(address token) external view returns (uint256);

Parameters

NameTypeDescription
tokenaddressThe loan currency.

Returns

NameTypeDescription
<none>uint256The amount of token that can be borrowed.

flashFee​

The fee to be charged for a given loan.

function flashFee(address token, uint256 amount) external view returns (uint256);

Parameters

NameTypeDescription
tokenaddressThe loan currency.
amountuint256The amount of tokens lent.

Returns

NameTypeDescription
<none>uint256The amount of token to be charged for the loan, on top of the returned principal.

flashLoan​

Initiate a flash loan.

function flashLoan(IERC3156FlashBorrower receiver, address token, uint256 amount, bytes calldata data)
external
returns (bool);

Parameters

NameTypeDescription
receiverIERC3156FlashBorrowerThe receiver of the tokens in the loan, and the receiver of the callback.
tokenaddressThe loan currency.
amountuint256The amount of tokens lent.
databytesArbitrary data structure, intended to contain user-defined parameters.