IERC3156FlashBorrower.sol 913 B

1234567891011121314151617181920212223242526272829
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts v4.4.0 (interfaces/IERC3156FlashBorrower.sol)
  3. pragma solidity ^0.8.0;
  4. /**
  5. * @dev Interface of the ERC3156 FlashBorrower, as defined in
  6. * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].
  7. *
  8. * _Available since v4.1._
  9. */
  10. interface IERC3156FlashBorrower {
  11. /**
  12. * @dev Receive a flash loan.
  13. * @param initiator The initiator of the loan.
  14. * @param token The loan currency.
  15. * @param amount The amount of tokens lent.
  16. * @param fee The additional amount of tokens to repay.
  17. * @param data Arbitrary data structure, intended to contain user-defined parameters.
  18. * @return The keccak256 hash of "ERC3156FlashBorrower.onFlashLoan"
  19. */
  20. function onFlashLoan(
  21. address initiator,
  22. address token,
  23. uint256 amount,
  24. uint256 fee,
  25. bytes calldata data
  26. ) external returns (bytes32);
  27. }