From 7227717a7a292353fd364fcf17123ee7a0f39429 Mon Sep 17 00:00:00 2001 From: eboado Date: Fri, 30 Oct 2020 12:06:02 +0100 Subject: [PATCH] - Removed modes from validateFlashLoan. Not needed as executeBorrow() will fail. --- contracts/lendingpool/LendingPool.sol | 2 +- contracts/libraries/logic/ValidationLogic.sol | 19 ++----------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index 471d986c..7e29b92d 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -520,7 +520,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage FlashLoanLocalVars memory vars; - ValidationLogic.validateFlashloan(assets, amounts, modes); + ValidationLogic.validateFlashloan(assets, amounts); address[] memory aTokenAddresses = new address[](assets.length); uint256[] memory premiums = new uint256[](assets.length); diff --git a/contracts/libraries/logic/ValidationLogic.sol b/contracts/libraries/logic/ValidationLogic.sol index cc771f8b..b677f34e 100644 --- a/contracts/libraries/logic/ValidationLogic.sol +++ b/contracts/libraries/logic/ValidationLogic.sol @@ -331,26 +331,11 @@ library ValidationLogic { /** * @dev validates a flashloan action - * @param modes the flashloan modes (0 = classic flashloan, 1 = open a stable rate loan, 2 = open a variable rate loan) * @param assets the assets being flashborrowed * @param amounts the amounts for each asset being borrowed **/ - function validateFlashloan( - address[] calldata assets, - uint256[] calldata amounts, - uint256[] calldata modes - ) external pure { - require( - assets.length == amounts.length && assets.length == modes.length, - Errors.INCONSISTENT_FLASHLOAN_PARAMS - ); - - for (uint256 i = 0; i < modes.length; i++) { - require( - modes[i] <= uint256(ReserveLogic.InterestRateMode.VARIABLE), - Errors.INVALID_FLASHLOAN_MODE - ); - } + function validateFlashloan(address[] memory assets, uint256[] memory amounts) internal pure { + require(assets.length == amounts.length, Errors.INCONSISTENT_FLASHLOAN_PARAMS); } /**