minor changes

This commit is contained in:
Richa-iitr 2022-05-29 12:22:57 +05:30
parent f58788da51
commit bf92590b8f
3 changed files with 18 additions and 16 deletions

View File

@ -34,6 +34,6 @@ interface AccountInterface {
} }
interface ListInterface { interface ListInterface {
function accountID(address) public returns (uint64); function accountID(address) external returns (uint64);
} }

View File

@ -250,6 +250,9 @@ contract AaveHelpers is Helper {
), ),
"allowance?" "allowance?"
); );
if (!getIsColl(tokens[i], address(this))) {
aave.setUserUseReserveAsCollateral(tokens[i], true);
}
} }
} }
} else { } else {
@ -272,15 +275,14 @@ contract AaveHelpers is Helper {
0, 0,
0 0
); );
if (!getIsColl(_token, address(this))) {
aave.setUserUseReserveAsCollateral(_token, true);
}
} }
} }
AccountInterface(address(this)).cast(_targets, _data, address(0)); AccountInterface(address(this)).cast(_targets, _data, address(0));
} }
if (!getIsColl(tokens[i], address(this))) {
aave.setUserUseReserveAsCollateral(tokens[i], true);
}
} }
function _TransferAtokensWithCollateral( function _TransferAtokensWithCollateral(

View File

@ -12,11 +12,15 @@ import "./helpers.sol";
import "./events.sol"; import "./events.sol";
contract AaveV3ImportResolver is AaveHelpers { contract AaveV3ImportResolver is AaveHelpers {
function _importAave( function _importAave(address userAccount, ImportInputData memory inputData)
address userAccount, internal
ImportInputData memory inputData returns (string memory _eventName, bytes memory _eventParam)
) internal returns (string memory _eventName, bytes memory _eventParam) { {
if (!ListInterface(0x839c2D3aDe63DF5b0b8F3E57D5e145057Ab41556).accountID(userAccount)) if (
ListInterface(0x839c2D3aDe63DF5b0b8F3E57D5e145057Ab41556).accountID(
userAccount
) == 0
) {
require( require(
AccountInterface(address(this)).isAuth(userAccount), AccountInterface(address(this)).isAuth(userAccount),
"user-account-not-auth" "user-account-not-auth"
@ -54,8 +58,7 @@ contract AaveV3ImportResolver is AaveHelpers {
data.aTokens, data.aTokens,
data.supplyAmts, data.supplyAmts,
data._supplyTokens, data._supplyTokens,
userAccount, userAccount
isDsa
); );
// borrow assets after migrating position // borrow assets after migrating position
@ -187,10 +190,7 @@ contract AaveV3ImportResolver is AaveHelpers {
* @param userAccount The address of the EOA from which aave position will be imported or address of the DSA to which the DSA positions will be merged * @param userAccount The address of the EOA from which aave position will be imported or address of the DSA to which the DSA positions will be merged
* @param inputData The struct containing all the neccessary input data * @param inputData The struct containing all the neccessary input data
*/ */
function importAave( function importAave(address userAccount, ImportInputData memory inputData)
address userAccount,
ImportInputData memory inputData
)
external external
payable payable
returns (string memory _eventName, bytes memory _eventParam) returns (string memory _eventName, bytes memory _eventParam)