From 44fc1e812fdd3a70d9d0e3c5b85f56821937315d Mon Sep 17 00:00:00 2001 From: Shriya Tyagi <47134275+shriyatyagii@users.noreply.github.com> Date: Fri, 26 Aug 2022 15:12:08 +0530 Subject: [PATCH] Update contracts/mainnet/connectors/euler/euler-import/helpers.sol Co-authored-by: 0xPradyuman <63545809+pradyuman-verma@users.noreply.github.com> --- .../mainnet/connectors/euler/euler-import/helpers.sol | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/contracts/mainnet/connectors/euler/euler-import/helpers.sol b/contracts/mainnet/connectors/euler/euler-import/helpers.sol index 2d9fc3a2..accb531d 100644 --- a/contracts/mainnet/connectors/euler/euler-import/helpers.sol +++ b/contracts/mainnet/connectors/euler/euler-import/helpers.sol @@ -64,18 +64,16 @@ contract EulerHelpers is Basic { data.supplyAmts = new uint256[](inputData._supplyTokens.length); data.supplyTokens = new address[](inputData._supplyTokens.length); data.eTokens = new EulerTokenInterface[](inputData._supplyTokens.length); - - for (uint256 i = 0; i < inputData._supplyTokens.length; i++) { - for (uint256 j = i; j < inputData._supplyTokens.length; j++) { - if (j != i) { + uint256 length_ = inputData._supplyTokens.length; + for (uint256 i = 0; i < length_; i++) { + for (uint256 j = i + 1; j < length_; j++) { require( inputData._supplyTokens[i] != inputData._supplyTokens[j], "token-repeated" ); - } } } - for (uint256 i = 0; i < inputData._supplyTokens.length; i++) { + for (uint256 i = 0; i < length_; i++) { address _token = inputData._supplyTokens[i] == ethAddr ? wethAddr : inputData._supplyTokens[i];