Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IERC3156FlashBorrower

Interface of the ERC-3156 FlashBorrower, as defined in https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].

Functions

onFlashLoan

Receive a flash loan.

function onFlashLoan(address initiator, address token, uint256 amount, uint256 fee, bytes calldata data)
    external
    returns (bytes32);

Parameters

NameTypeDescription
initiatoraddressThe initiator of the loan.
tokenaddressThe loan currency.
amountuint256The amount of tokens lent.
feeuint256The additional amount of tokens to repay.
databytesArbitrary data structure, intended to contain user-defined parameters.

Returns

NameTypeDescription
<none>bytes32The keccak256 hash of "ERC3156FlashBorrower.onFlashLoan"