From 8be787aa88bcc9a1a7b8457be5091839ca201c23 Mon Sep 17 00:00:00 2001 From: Richa-iitr Date: Thu, 5 May 2022 23:30:21 +0530 Subject: [PATCH] updated logic, name string --- contracts/polygon/connectors/aave/v3-import/helpers.sol | 4 ++-- contracts/polygon/connectors/aave/v3-import/main.sol | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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"; }