From 4aea9dd273720ba451e36fe1d224fd49b1424d0a Mon Sep 17 00:00:00 2001 From: Samyak Jain <34437877+KaymasJain@users.noreply.github.com> Date: Fri, 16 Apr 2021 17:45:21 +0530 Subject: [PATCH] added instalist verification --- contracts/receivers/aave-v2-receiver/interfaces.sol | 4 ++++ contracts/receivers/aave-v2-receiver/main.sol | 3 ++- contracts/receivers/aave-v2-receiver/variables.sol | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/contracts/receivers/aave-v2-receiver/interfaces.sol b/contracts/receivers/aave-v2-receiver/interfaces.sol index e15cf82..f481668 100644 --- a/contracts/receivers/aave-v2-receiver/interfaces.sol +++ b/contracts/receivers/aave-v2-receiver/interfaces.sol @@ -95,4 +95,8 @@ interface AaveInterface { uint256 ltv, uint256 healthFactor ); +} + +interface InstaListInterface { + function accountID(address) external view returns (uint); } \ No newline at end of file diff --git a/contracts/receivers/aave-v2-receiver/main.sol b/contracts/receivers/aave-v2-receiver/main.sol index c28f021..1a20c19 100644 --- a/contracts/receivers/aave-v2-receiver/main.sol +++ b/contracts/receivers/aave-v2-receiver/main.sol @@ -99,7 +99,8 @@ contract AaveV2Migrator is MigrateResolver { address[] memory supplyTokens = data.supplyTokens; address[] memory borrowTokens = data.borrowTokens; - // TODO: before migrating make sure the new DSA is v2 DSA on L1. + // TODO: IMPORTANT!! before migrating make sure the new DSA is v2 DSA on L1. + require(instaList.accountID(dsa) != 0, "not-a-dsa"); AaveInterface aave = AaveInterface(aaveProvider.getLendingPool()); diff --git a/contracts/receivers/aave-v2-receiver/variables.sol b/contracts/receivers/aave-v2-receiver/variables.sol index 6e01591..e87decf 100644 --- a/contracts/receivers/aave-v2-receiver/variables.sol +++ b/contracts/receivers/aave-v2-receiver/variables.sol @@ -4,7 +4,8 @@ import { TokenMappingInterface, AaveLendingPoolProviderInterface, AaveDataProviderInterface, - IndexInterface + IndexInterface, + InstaListInterface } from "./interfaces.sol"; contract Variables { @@ -37,4 +38,6 @@ contract Variables { // Address which will receive L1 data and post it on L2 address public maticReceiver = 0x0000000000000000000000000000000000001001; + InstaListInterface public instaList = InstaListInterface(0x839c2D3aDe63DF5b0b8F3E57D5e145057Ab41556); + } \ No newline at end of file