From 8f926c7230e93462cb6be921727635c1e642462c Mon Sep 17 00:00:00 2001 From: Daniel Beal Date: Sun, 1 Sep 2024 23:04:09 +0900 Subject: [PATCH] Revert "deferred accounts" This reverts commit 361771566af895a3e9256f468e7015829005f2eb. --- .../legacy-market/contracts/LegacyMarket.sol | 29 ++----------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/markets/legacy-market/contracts/LegacyMarket.sol b/markets/legacy-market/contracts/LegacyMarket.sol index e799b91ade..68821a6936 100644 --- a/markets/legacy-market/contracts/LegacyMarket.sol +++ b/markets/legacy-market/contracts/LegacyMarket.sol @@ -45,9 +45,6 @@ contract LegacyMarket is ILegacyMarket, Ownable, UUPSImplementation, IMarket, IE // NOTE: below field is now unused but we leave it here to reduce maintenance burden ISNXDistributor public rewardsDistributor; - // in case an account nft was not able to be transferred to a owner's address due to some error, we allow transferring it later using this structure. - mapping(uint256 => address) deferredAccounts; - error MigrationInProgress(); // redefine event so it can be catched by ethers @@ -281,37 +278,15 @@ contract LegacyMarket is ILegacyMarket, Ownable, UUPSImplementation, IMarket, IE ); // send the built v3 account to the staker - try IERC721(v3System.getAccountTokenAddress()).safeTransferFrom( + IERC721(v3System.getAccountTokenAddress()).safeTransferFrom( address(this), staker, accountId - ) { - - } catch { - deferredAccounts[accountId] = staker; - } + ); emit AccountMigrated(staker, accountId, collateralMigrated, debtValueMigrated); } - /** - * @dev In case a previously migrated account was not able to be sent to a user during the migration, this function can be - * called in order to claim the token afterwards to any address. - */ - function transferDeferredAccount(uint256 accountId, address to) external { - if (deferredAccounts[accountId] != ERC2771Context._msgSender()) { - revert AccessError.Unauthorized(ERC2771Context._msgSender()); - } - - deferredAccounts[accountId] = address(0); - - IERC721(v3System.getAccountTokenAddress()).safeTransferFrom( - address(this), - to, - accountId - ); - } - /** * @dev Moves the collateral and debt associated {staker} in the V2 system to this market. */