mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
- Modified FlashLoanReceiverBase
This commit is contained in:
parent
e25594ca7d
commit
9d1c021945
|
@ -12,21 +12,11 @@ abstract contract FlashLoanReceiverBase is IFlashLoanReceiver {
|
|||
using SafeERC20 for IERC20;
|
||||
using SafeMath for uint256;
|
||||
|
||||
ILendingPoolAddressesProvider internal _addressesProvider;
|
||||
ILendingPool internal _lendingPool;
|
||||
ILendingPoolAddressesProvider public immutable override ADDRESSES_PROVIDER;
|
||||
ILendingPool public immutable override LENDING_POOL;
|
||||
|
||||
constructor(ILendingPoolAddressesProvider provider) public {
|
||||
_addressesProvider = provider;
|
||||
_lendingPool = ILendingPool(provider.getLendingPool());
|
||||
ADDRESSES_PROVIDER = provider;
|
||||
LENDING_POOL = ILendingPool(provider.getLendingPool());
|
||||
}
|
||||
|
||||
function getAddressesProvider() external view override returns (ILendingPoolAddressesProvider) {
|
||||
return _addressesProvider;
|
||||
}
|
||||
|
||||
function getLendingPool() external view override returns (ILendingPool) {
|
||||
return _lendingPool;
|
||||
}
|
||||
|
||||
receive() external payable {}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ interface IFlashLoanReceiver {
|
|||
bytes calldata params
|
||||
) external returns (bool);
|
||||
|
||||
function getAddressesProvider() external view returns (ILendingPoolAddressesProvider);
|
||||
function ADDRESSES_PROVIDER() external view returns (ILendingPoolAddressesProvider);
|
||||
|
||||
function getLendingPool() external view returns (ILendingPool);
|
||||
function LENDING_POOL() external view returns (ILendingPool);
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ contract MockFlashLoanReceiver is FlashLoanReceiverBase {
|
|||
|
||||
token.mint(premiums[i]);
|
||||
|
||||
IERC20(assets[i]).approve(_addressesProvider.getLendingPool(), amountToReturn);
|
||||
IERC20(assets[i]).approve(address(LENDING_POOL), amountToReturn);
|
||||
}
|
||||
|
||||
emit ExecutedWithSuccess(assets, amounts, premiums);
|
||||
|
|
Loading…
Reference in New Issue
Block a user