From a5840aa3fe5e0ef4b389958c735ac28ceaf637da Mon Sep 17 00:00:00 2001 From: q1q0 Date: Wed, 1 Mar 2023 10:13:15 -0500 Subject: [PATCH] update borrow 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 5323ea81..9ee44225 100644 --- a/contracts/mainnet/connectors/morpho-aave-v3/main.sol +++ b/contracts/mainnet/connectors/morpho-aave-v3/main.sol @@ -346,8 +346,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, _maxIteration); + address _token = _tokenAddress == ethAddr ? wethAddr : _tokenAddress; + MORPHO_AAVE_V3.borrow(_token, _amt, address(this), _receiver, _maxIteration); convertWethToEth(_tokenAddress == ethAddr, TokenInterface(wethAddr), _amt); @@ -386,8 +386,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, _onBehalf, _receiver, _maxIteration); + address _token = _tokenAddress == ethAddr ? wethAddr : _tokenAddress; + MORPHO_AAVE_V3.borrow(_token, _amt, _onBehalf, _receiver, _maxIteration); convertWethToEth(_tokenAddress == ethAddr, TokenInterface(wethAddr), _amt);