mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
fixed native token bug aave v2
This commit is contained in:
parent
4daba04266
commit
231b8fe34a
|
@ -266,9 +266,11 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
AaveInterface aave = AaveInterface(aaveProvider.getLendingPool());
|
||||
|
||||
for (uint256 i = 0; i < _length; i++) {
|
||||
address token = tokens[i];
|
||||
if (getCollateralBalance(token) > 0 && !getIsColl(token)) {
|
||||
aave.setUserUseReserveAsCollateral(token, true);
|
||||
bool isAvax = tokens[i] == avaxAddr;
|
||||
address _token = isAvax ? wavaxAddr : tokens[i];
|
||||
|
||||
if (getCollateralBalance(_token) > 0 && !getIsColl(_token)) {
|
||||
aave.setUserUseReserveAsCollateral(_token, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -276,7 +278,6 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
_eventParam = abi.encode(tokens);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @dev Swap borrow rate mode
|
||||
* @notice Swaps user borrow rate mode between variable and stable
|
||||
|
|
|
@ -231,9 +231,11 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
AaveInterface aave = AaveInterface(aaveProvider.getLendingPool());
|
||||
|
||||
for (uint i = 0; i < _length; i++) {
|
||||
address token = tokens[i];
|
||||
if (getCollateralBalance(token) > 0 && !getIsColl(token)) {
|
||||
aave.setUserUseReserveAsCollateral(token, true);
|
||||
bool isEth = tokens[i] == ethAddr;
|
||||
address _token = isEth ? wethAddr : tokens[i];
|
||||
|
||||
if (getCollateralBalance(_token) > 0 && !getIsColl(_token)) {
|
||||
aave.setUserUseReserveAsCollateral(_token, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -266,9 +266,11 @@ abstract contract AaveResolver is Events, Helpers {
|
|||
AaveInterface aave = AaveInterface(aaveProvider.getLendingPool());
|
||||
|
||||
for (uint256 i = 0; i < _length; i++) {
|
||||
address token = tokens[i];
|
||||
if (getCollateralBalance(token) > 0 && !getIsColl(token)) {
|
||||
aave.setUserUseReserveAsCollateral(token, true);
|
||||
bool isMatic = tokens[i] == maticAddr;
|
||||
address _token = isMatic ? wmaticAddr : tokens[i];
|
||||
|
||||
if (getCollateralBalance(_token) > 0 && !getIsColl(_token)) {
|
||||
aave.setUserUseReserveAsCollateral(_token, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user