minor modification

This commit is contained in:
Richa-iitr 2022-05-31 16:32:53 +05:30
parent 39f37cdabe
commit 394211a36f
2 changed files with 19 additions and 6 deletions

View File

@ -199,6 +199,9 @@ contract AaveHelpers is Helper {
uint256 rateMode,
address user
) private {
if (instaList.accountID(user) != 0) {
user = address(this);
}
aave.repay(token, amt, rateMode, user);
}
@ -263,10 +266,11 @@ contract AaveHelpers is Helper {
);
for (uint256 i = 0; i < _length; i++) {
uint256 _amt = amts[i];
address _token = tokens[i];
_targets[i] = "BASIC-A";
if (amts[i] > 0) {
uint256 _amt = amts[i];
address _token = tokens[i];
_targets[i] = "BASIC-A";
_data[i] = abi.encodeWithSelector(
basicWithdraw,
_token,
@ -275,7 +279,7 @@ contract AaveHelpers is Helper {
0,
0
);
if (!getIsColl(_token, address(this))) {
if (!getIsColl(_token, userAccount)) {
aave.setUserUseReserveAsCollateral(_token, true);
}
}

View File

@ -32,8 +32,17 @@ contract AaveV3ImportResolver is AaveHelpers {
AaveInterface aave = AaveInterface(aaveProvider.getPool());
data = getBorrowAmounts(userAccount, aave, inputData, data);
data = getSupplyAmounts(userAccount, inputData, data);
if (
ListInterface(0x839c2D3aDe63DF5b0b8F3E57D5e145057Ab41556).accountID(
userAccount
) == 0
) {
data = getBorrowAmounts(userAccount, aave, inputData, data);
data = getSupplyAmounts(userAccount, inputData, data);
} else {
data = getBorrowAmounts(address(this), aave, inputData, data);
data = getSupplyAmounts(address(this), inputData, data);
}
// payback borrowed amount;
_PaybackStable(