IERC 3156 Flash Lender Upgradeable

Interface of the ERC3156 FlashLender, as defined in https://eips.ethereum.org/EIPS/eip-3156[ERC-3156]. Available since v4.1.

Methods

flashFee

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

The fee to be charged for a given loan.

Parameters

NameTypeDescription

token

address

The loan currency.

amount

uint256

The amount of tokens lent.

Returns

NameTypeDescription

_0

uint256

The amount of token to be charged for the loan, on top of the returned principal.

flashLoan

function flashLoan(contract IERC3156FlashBorrowerUpgradeable receiver, address token, uint256 amount, bytes data) external nonpayable returns (bool)

Initiate a flash loan.

Parameters

NameTypeDescription

receiver

contract IERC3156FlashBorrowerUpgradeable

The receiver of the tokens in the loan, and the receiver of the callback.

token

address

The loan currency.

amount

uint256

The amount of tokens lent.

data

bytes

Arbitrary data structure, intended to contain user-defined parameters.

Returns

NameTypeDescription

_0

bool

undefined

maxFlashLoan

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

The amount of currency available to be lended.

Parameters

NameTypeDescription

token

address

The loan currency.

Returns

NameTypeDescription

_0

uint256

The amount of token that can be borrowed.

Last updated