Fix wrong address bug

This commit is contained in:
Mubaris NK 2021-02-11 21:44:56 +05:30
parent 3b08bc2651
commit 5318c8ea5b
No known key found for this signature in database
GPG Key ID: 9AC09AD0F8D68561

View File

@ -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);