Update contracts/mainnet/connectors/aave/v2/main.sol

Co-authored-by: Thrilok kumar <thrilok2000@gmail.com>
This commit is contained in:
Shriya Tyagi 2022-05-02 20:59:29 +04:00 committed by GitHub
parent 503c541d66
commit d8ce48fbe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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