From 0ea3c5613c07d2eba4bb092e0640999a64bf424e Mon Sep 17 00:00:00 2001 From: Thrilok kumar Date: Sat, 15 Oct 2022 22:30:42 +0530 Subject: [PATCH] refactor isETH condition --- contracts/mainnet/connectors/morpho-compound/main.sol | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/contracts/mainnet/connectors/morpho-compound/main.sol b/contracts/mainnet/connectors/morpho-compound/main.sol index 157eda5f..4a8d61f1 100644 --- a/contracts/mainnet/connectors/morpho-compound/main.sol +++ b/contracts/mainnet/connectors/morpho-compound/main.sol @@ -201,11 +201,9 @@ abstract contract MorphoCompound is Helpers, Events { { uint256 _amt = getUint(_getId, _amount); - bool _isETH = _tokenAddress == ethAddr; - MORPHO_COMPOUND.borrow(_poolTokenAddress, _amt, _maxGasForMatching); - if (_isETH) convertWethToEth(_isETH, TokenInterface(wethAddr), _amt); + convertWethToEth(_tokenAddress == ethAddr, TokenInterface(wethAddr), _amt); setUint(_setId, _amt); @@ -252,7 +250,7 @@ abstract contract MorphoCompound is Helpers, Events { MORPHO_COMPOUND.withdraw(_poolTokenAddress, _amt); - if (_isETH) convertWethToEth(_isETH, TokenInterface(wethAddr), _amt); + convertWethToEth(_isETH, TokenInterface(wethAddr), _amt); setUint(_setId, _amt);