From e718e7c04494722c437f69cfd437522321d0f7cf Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Wed, 16 Mar 2022 20:04:34 +0400 Subject: [PATCH] Fix on polygon --- .../connectors/aave/v2-to-v3-import/helpers.sol | 4 ++-- .../connectors/aave/v2-to-v3-import/helpers.sol | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/contracts/avalanche/connectors/aave/v2-to-v3-import/helpers.sol b/contracts/avalanche/connectors/aave/v2-to-v3-import/helpers.sol index a47a8131..bfb27716 100644 --- a/contracts/avalanche/connectors/aave/v2-to-v3-import/helpers.sol +++ b/contracts/avalanche/connectors/aave/v2-to-v3-import/helpers.sol @@ -104,11 +104,11 @@ contract _AaveHelper is Helper { data.stableBorrowAmtsWithFee = new uint256[]( inputData.borrowTokens.length ); - data.data.totalBorrowAmtsWithFee = new uint256[]( + data.totalBorrowAmtsWithFee = new uint256[]( inputData.borrowTokens.length ); - data.totalBorrowAmts = new uint256[](inputData.borrowTokens.length); + for (uint256 i = 0; i < inputData.borrowTokens.length; i++) { for (uint256 j = i; j < inputData.borrowTokens.length; j++) { if (j != i) { diff --git a/contracts/polygon/connectors/aave/v2-to-v3-import/helpers.sol b/contracts/polygon/connectors/aave/v2-to-v3-import/helpers.sol index 5da70943..4924c5a8 100644 --- a/contracts/polygon/connectors/aave/v2-to-v3-import/helpers.sol +++ b/contracts/polygon/connectors/aave/v2-to-v3-import/helpers.sol @@ -91,13 +91,22 @@ contract _AaveHelper is Helper { ImportData memory data ) internal returns (ImportData memory) { if (inputData.borrowTokens.length > 0) { - data._borrowTokens = new address[](inputData.borrowTokens.length); + data._borrowTokens = new address[](inputData.borrowTokens.length); data.variableBorrowAmts = new uint256[]( inputData.borrowTokens.length ); data.stableBorrowAmts = new uint256[]( inputData.borrowTokens.length ); + data.variableBorrowAmtsWithFee = new uint256[]( + inputData.borrowTokens.length + ); + data.stableBorrowAmtsWithFee = new uint256[]( + inputData.borrowTokens.length + ); + data.totalBorrowAmtsWithFee = new uint256[]( + inputData.borrowTokens.length + ); data.totalBorrowAmts = new uint256[](inputData.borrowTokens.length); for (uint256 i = 0; i < inputData.borrowTokens.length; i++) { for (uint256 j = i; j < inputData.borrowTokens.length; j++) {