- Removed modes from validateFlashLoan. Not needed as executeBorrow() will fail.

This commit is contained in:
eboado 2020-10-30 12:06:02 +01:00
parent af6b370f0e
commit 7227717a7a
2 changed files with 3 additions and 18 deletions

View File

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

View File

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