Merge branch 'master' into 178-add-uniswap-adapters

This commit is contained in:
andyk 2020-11-30 15:11:35 +04:00
commit b4a0841577
3 changed files with 7 additions and 17 deletions

View File

@ -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 {}
}

View File

@ -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);
}

View File

@ -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);