IFlashLoanReceiver

When performing a flash loan, the contract receiving the funds must conform to the following solidity interface (also available on Github):

// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;

import { ILendingPoolAddressesProvider } from './ILendingPoolAddressesProvider.sol';
import { ILendingPool } from './ILendingPool.sol';

/**
 * @title IFlashLoanReceiver interface
 * @notice Interface for the Phantazm fee IFlashLoanReceiver.
 * @dev implement this interface to develop a flashloan-compatible flashLoanReceiver contract
 **/
interface IFlashLoanReceiver {
  function executeOperation(
    address[] calldata assets,
    uint256[] calldata amounts,
    uint256[] calldata premiums,
    address initiator,
    bytes calldata params
  ) external returns (bool);

  function ADDRESSES_PROVIDER() external view returns (ILendingPoolAddressesProvider);

  function LENDING_POOL() external view returns (ILendingPool);
}

FlashLoanReceiverBase

An example of an abstract contract that can be used as a base in production is below

The interface for ILendingPoolAddressesProvider can be found here.

Last updated