From 5318c8ea5b9ba57e5fc85a40dd0c1f1a5c0a35d2 Mon Sep 17 00:00:00 2001 From: Mubaris NK Date: Thu, 11 Feb 2021 21:44:56 +0530 Subject: [PATCH] Fix wrong address bug --- contracts/connectors/refinance.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/connectors/refinance.sol b/contracts/connectors/refinance.sol index e0b144c..000c3ac 100644 --- a/contracts/connectors/refinance.sol +++ b/contracts/connectors/refinance.sol @@ -514,7 +514,7 @@ contract CompoundHelpers is Helpers { address _token = address(token) == getWethAddr() ? getEthAddr() : address(token); if (amt == uint(-1)) { - amt = getMaxBorrow(target, address(token), ctoken, rateMode); + amt = getMaxBorrow(target, _token, ctoken, rateMode); } (uint feeAmt, uint _amt) = calculateFee(amt, fee, true); @@ -635,7 +635,7 @@ contract AaveV1Helpers is CompoundHelpers { address _token = address(token) == getWethAddr() ? getEthAddr() : address(token); if (amt == uint(-1)) { - amt = getMaxBorrow(target, address(token), ctoken, paybackRateMode); + amt = getMaxBorrow(target, _token, ctoken, paybackRateMode); } (uint feeAmt, uint _amt) = calculateFee(amt, fee, true);