mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
- Added initialization of _lendingPool to FlashLoanReceiverBase and getters.
This commit is contained in:
parent
578f3171bf
commit
ae94f8ba49
|
@ -3,18 +3,29 @@ pragma solidity 0.6.12;
|
||||||
|
|
||||||
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
|
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
|
||||||
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';
|
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';
|
||||||
|
import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol';
|
||||||
import {IFlashLoanReceiver} from '../interfaces/IFlashLoanReceiver.sol';
|
import {IFlashLoanReceiver} from '../interfaces/IFlashLoanReceiver.sol';
|
||||||
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
|
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
|
||||||
import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol';
|
import {ILendingPool} from '../../interfaces/ILendingPool.sol';
|
||||||
|
|
||||||
abstract contract FlashLoanReceiverBase is IFlashLoanReceiver {
|
abstract contract FlashLoanReceiverBase is IFlashLoanReceiver {
|
||||||
using SafeERC20 for IERC20;
|
using SafeERC20 for IERC20;
|
||||||
using SafeMath for uint256;
|
using SafeMath for uint256;
|
||||||
|
|
||||||
ILendingPoolAddressesProvider internal _addressesProvider;
|
ILendingPoolAddressesProvider internal _addressesProvider;
|
||||||
|
ILendingPool internal _lendingPool;
|
||||||
|
|
||||||
constructor(ILendingPoolAddressesProvider provider) public {
|
constructor(ILendingPoolAddressesProvider provider) public {
|
||||||
_addressesProvider = provider;
|
_addressesProvider = provider;
|
||||||
|
_lendingPool = ILendingPool(provider.getLendingPool());
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAddressesProvider() external view override returns (ILendingPoolAddressesProvider) {
|
||||||
|
return _addressesProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getLendingPool() external view override returns (ILendingPool) {
|
||||||
|
return _lendingPool;
|
||||||
}
|
}
|
||||||
|
|
||||||
receive() external payable {}
|
receive() external payable {}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
// SPDX-License-Identifier: agpl-3.0
|
// SPDX-License-Identifier: agpl-3.0
|
||||||
pragma solidity 0.6.12;
|
pragma solidity 0.6.12;
|
||||||
|
|
||||||
|
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
|
||||||
|
import {ILendingPool} from '../../interfaces/ILendingPool.sol';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title IFlashLoanReceiver interface
|
* @title IFlashLoanReceiver interface
|
||||||
* @notice Interface for the Aave fee IFlashLoanReceiver.
|
* @notice Interface for the Aave fee IFlashLoanReceiver.
|
||||||
|
@ -15,4 +18,8 @@ interface IFlashLoanReceiver {
|
||||||
address initiator,
|
address initiator,
|
||||||
bytes calldata params
|
bytes calldata params
|
||||||
) external returns (bool);
|
) external returns (bool);
|
||||||
|
|
||||||
|
function getAddressesProvider() external view returns (ILendingPoolAddressesProvider);
|
||||||
|
|
||||||
|
function getLendingPool() external view returns (ILendingPool);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user