From 834d43eb38d51bbf5593258572791e32d8209d93 Mon Sep 17 00:00:00 2001 From: Mubaris NK Date: Sun, 4 Apr 2021 18:59:26 +0530 Subject: [PATCH] Fix double migration issue --- contracts/receivers/aave-v2-receiver/main.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contracts/receivers/aave-v2-receiver/main.sol b/contracts/receivers/aave-v2-receiver/main.sol index 9158328..da679db 100644 --- a/contracts/receivers/aave-v2-receiver/main.sol +++ b/contracts/receivers/aave-v2-receiver/main.sol @@ -68,6 +68,8 @@ contract AaveV2Migrator is MigrateResolver { function _migratePosition(address owner) internal { AaveData storage data = positions[owner]; + require(!data.isFinal, "already-migrated"); + for (uint i = 0; i < data.supplyTokens.length; i++) { IERC20(data.supplyTokens[i]).safeTransfer(data.targetDsa, data.supplyAmts[i]); }