mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
- Removed modes from validateFlashLoan. Not needed as executeBorrow() will fail.
This commit is contained in:
parent
af6b370f0e
commit
7227717a7a
|
@ -520,7 +520,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
||||||
|
|
||||||
FlashLoanLocalVars memory vars;
|
FlashLoanLocalVars memory vars;
|
||||||
|
|
||||||
ValidationLogic.validateFlashloan(assets, amounts, modes);
|
ValidationLogic.validateFlashloan(assets, amounts);
|
||||||
|
|
||||||
address[] memory aTokenAddresses = new address[](assets.length);
|
address[] memory aTokenAddresses = new address[](assets.length);
|
||||||
uint256[] memory premiums = new uint256[](assets.length);
|
uint256[] memory premiums = new uint256[](assets.length);
|
||||||
|
|
|
@ -331,26 +331,11 @@ library ValidationLogic {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev validates a flashloan action
|
* @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 assets the assets being flashborrowed
|
||||||
* @param amounts the amounts for each asset being borrowed
|
* @param amounts the amounts for each asset being borrowed
|
||||||
**/
|
**/
|
||||||
function validateFlashloan(
|
function validateFlashloan(address[] memory assets, uint256[] memory amounts) internal pure {
|
||||||
address[] calldata assets,
|
require(assets.length == amounts.length, Errors.INCONSISTENT_FLASHLOAN_PARAMS);
|
||||||
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
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user