mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Update contracts/mainnet/connectors/aave/v2/main.sol
This commit is contained in:
parent
fb9abb2042
commit
503c541d66
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user