updated transaferATokensWithCollateral

This commit is contained in:
Richa-iitr 2022-06-02 11:51:54 +05:30
parent d4a67f816f
commit 22aa323ff5
2 changed files with 17 additions and 5 deletions

View File

@ -355,7 +355,7 @@ contract AaveHelpers is Helper {
0, 0,
0 0
); );
_tokens[_cntr] = _token; _tokens[_cntr] = tokens[i];
_cntr++; _cntr++;
} }
} }

View File

@ -21,6 +21,11 @@ contract AaveV3ImportResolver is AaveHelpers {
AccountInterface(address(this)).isAuth(userAccount), AccountInterface(address(this)).isAuth(userAccount),
"user-account-not-auth" "user-account-not-auth"
); );
} else {
require(
AccountInterface(userAccount).isAuth(address(this)),
"user-account-not-auth"
);
} }
require(inputData.supplyTokens.length > 0, "0-length-not-allowed"); require(inputData.supplyTokens.length > 0, "0-length-not-allowed");
@ -98,10 +103,17 @@ contract AaveV3ImportResolver is AaveHelpers {
ImportInputData memory inputData, ImportInputData memory inputData,
bool[] memory enableCollateral bool[] memory enableCollateral
) internal returns (string memory _eventName, bytes memory _eventParam) { ) internal returns (string memory _eventName, bytes memory _eventParam) {
require( if (instaList.accountID(userAccount) == 0) {
AccountInterface(address(this)).isAuth(userAccount), require(
"user-account-not-auth" AccountInterface(address(this)).isAuth(userAccount),
); "user-account-not-auth"
);
} else {
require(
AccountInterface(userAccount).isAuth(address(this)),
"user-account-not-auth"
);
}
require(inputData.supplyTokens.length > 0, "0-length-not-allowed"); require(inputData.supplyTokens.length > 0, "0-length-not-allowed");
require( require(