diff --git a/contracts/mainnet/connectors/aave/v2/main.sol b/contracts/mainnet/connectors/aave/v2/main.sol index e0968eec..864e75a2 100644 --- a/contracts/mainnet/connectors/aave/v2/main.sol +++ b/contracts/mainnet/connectors/aave/v2/main.sol @@ -200,7 +200,7 @@ abstract contract AaveResolver is Events, Helpers { TokenInterface tokenContract = TokenInterface(_token); if (_amt == uint(-1)) { - uint _amtDSA = isEth ? onBehalfOf.balance : tokenContract.balanceOf(onBehalfOf); + uint _amtDSA = isEth ? address(this).balance : tokenContract.balanceOf(address(this)); uint _amtDebt = getOnBehalfOfPaybackBalance(_token, rateMode, onBehalfOf); _amt = _amtDSA <= _amtDebt ? _amtDSA : _amtDebt; }