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

This commit is contained in:
Thrilok kumar 2022-05-02 21:54:25 +05:30 committed by GitHub
parent fb9abb2042
commit 503c541d66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -199,11 +199,11 @@ abstract contract AaveResolver is Events, Helpers {
TokenInterface tokenContract = TokenInterface(_token);
if (_amt == uint(-1)) {
uint _amtDSA = isEth ? onBehalfOf.balance : tokenContract.balanceOf(onBehalfOf);
uint _amtDebt = getOnBehalfOfPaybackBalance(_token, rateMode, onBehalfOf);
_amt = _amtDSA <= _amtDebt ? _amtDSA : _amtDebt;
}
if (_amt == uint(-1)) {
uint _amtDSA = isEth ? onBehalfOf.balance : tokenContract.balanceOf(onBehalfOf);
uint _amtDebt = getOnBehalfOfPaybackBalance(_token, rateMode, onBehalfOf);
_amt = _amtDSA <= _amtDebt ? _amtDSA : _amtDebt;
}
if (isEth) convertEthToWeth(isEth, tokenContract, _amt);