From b3d1b17adfdf3f2e8b87b7730aa99302facddbe1 Mon Sep 17 00:00:00 2001 From: q1q0 Date: Thu, 2 Mar 2023 03:00:21 -0500 Subject: [PATCH] upate repay functions --- contracts/mainnet/connectors/morpho-aave-v3/main.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/mainnet/connectors/morpho-aave-v3/main.sol b/contracts/mainnet/connectors/morpho-aave-v3/main.sol index 27d43f4c..f3ec1a8c 100644 --- a/contracts/mainnet/connectors/morpho-aave-v3/main.sol +++ b/contracts/mainnet/connectors/morpho-aave-v3/main.sol @@ -268,8 +268,8 @@ abstract contract MorphoAaveV3 is Helpers, Events { returns (string memory _eventName, bytes memory _eventParam) { uint256 _amt = getUint(_getId, _amount); - - MORPHO_AAVE_V3.borrow(_tokenAddress, _amt, address(this), _receiver, max_iteration); + address _token = _tokenAddress == ethAddr ? wethAddr : _tokenAddress; + MORPHO_AAVE_V3.borrow(_token, _amt, address(this), _receiver, max_iteration); convertWethToEth(_tokenAddress == ethAddr, TokenInterface(wethAddr), _amt); @@ -615,7 +615,7 @@ abstract contract MorphoAaveV3 is Helpers, Events { approve(_tokenContract, address(MORPHO_AAVE_V3), _amt); - MORPHO_AAVE_V3.repay(_tokenAddress, _amt, address(this)); + MORPHO_AAVE_V3.repay(address(_tokenContract), _amt, address(this)); setUint(_setId, _amt); @@ -665,7 +665,7 @@ abstract contract MorphoAaveV3 is Helpers, Events { approve(_tokenContract, address(MORPHO_AAVE_V3), _amt); - MORPHO_AAVE_V3.repay(_tokenAddress, _amt, _onBehalf); + MORPHO_AAVE_V3.repay(address(_tokenContract), _amt, _onBehalf); setUint(_setId, _amt);