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 SafeERC20 for IERC20;
|
||||||
using SafeMath for uint256;
|
using SafeMath for uint256;
|
||||||
|
|
||||||
ILendingPoolAddressesProvider internal _addressesProvider;
|
ILendingPoolAddressesProvider public immutable override ADDRESSES_PROVIDER;
|
||||||
ILendingPool internal _lendingPool;
|
ILendingPool public immutable override LENDING_POOL;
|
||||||
|
|
||||||
constructor(ILendingPoolAddressesProvider provider) public {
|
constructor(ILendingPoolAddressesProvider provider) public {
|
||||||
_addressesProvider = provider;
|
ADDRESSES_PROVIDER = provider;
|
||||||
_lendingPool = ILendingPool(provider.getLendingPool());
|
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
|
bytes calldata params
|
||||||
) external returns (bool);
|
) 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]);
|
token.mint(premiums[i]);
|
||||||
|
|
||||||
IERC20(assets[i]).approve(_addressesProvider.getLendingPool(), amountToReturn);
|
IERC20(assets[i]).approve(address(LENDING_POOL), amountToReturn);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit ExecutedWithSuccess(assets, amounts, premiums);
|
emit ExecutedWithSuccess(assets, amounts, premiums);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user