diff --git a/contracts/polygon/connectors/aave/v3-import/helpers.sol b/contracts/polygon/connectors/aave/v3-import/helpers.sol index aa436556..c581b8cf 100644 --- a/contracts/polygon/connectors/aave/v3-import/helpers.sol +++ b/contracts/polygon/connectors/aave/v3-import/helpers.sol @@ -260,7 +260,7 @@ contract AaveHelpers is Helper { address userAccount ) internal { for (uint256 i = 0; i < _length; i++) { - if (amts[i] > 0 && colEnable[i]) { + if (amts[i] > 0) { uint256 _amt = amts[i]; require( atokenContracts[i].transferFrom( @@ -272,7 +272,7 @@ contract AaveHelpers is Helper { ); if (!getIsColl(tokens[i], address(this))) { - aave.setUserUseReserveAsCollateral(tokens[i], true); + aave.setUserUseReserveAsCollateral(tokens[i], colEnable[i]); } } } diff --git a/contracts/polygon/connectors/aave/v3-import/main.sol b/contracts/polygon/connectors/aave/v3-import/main.sol index 3a5394f8..a6e1836b 100644 --- a/contracts/polygon/connectors/aave/v3-import/main.sol +++ b/contracts/polygon/connectors/aave/v3-import/main.sol @@ -102,6 +102,7 @@ contract AaveV3ImportResolver is AaveHelpers { ); require(inputData.supplyTokens.length > 0, "0-length-not-allowed"); + require(enableCollateral.length == inputData.supplyTokens.length, "lengths-not-same"); ImportData memory data; @@ -205,5 +206,5 @@ contract AaveV3ImportResolver is AaveHelpers { } contract ConnectV2AaveV3ImportPolygon is AaveV3ImportResolver { - string public constant name = "Aave-v3-import-v1"; + string public constant name = "Aave-v3-import-v1.1"; }