Skip to content

Refactor Locked Migration#219

Merged
adraffy merged 52 commits intomainfrom
feat/refactor-migration
Mar 3, 2026
Merged

Refactor Locked Migration#219
adraffy merged 52 commits intomainfrom
feat/refactor-migration

Conversation

@adraffy
Copy link
Member

@adraffy adraffy commented Feb 22, 2026

  • replaced IMigratedWrappedNameRegistry with IWrapperRegistry
  • replaced MigratedWrappedNameRegistry with WrapperRegistry
  • replaced LockedNamesLib with WrappedReceiver
  • refactored LockedMigrationController and WrapperRegistry to use WrapperReceiver
  • refactored MigrationErrors
  • added V1Fixture and V2Fixture
    • these can be used to simplify other test contracts (in future PRs)
  • changed PermissionedRegistry constructor to avoid _grantRoles if roleBitmap = 0

WrapperReceiver is the shared code for converting a NameWrapper token to V2. It contains ALL of the logic for the NameWrapper. Instead of mocks, it's tested against the real NameWrapper contract.

WrapperReceiver.finishERC1155Migration() is currently an external call to itself.


  • does LockedMigrationController need a guard to ensure that register() is only called on RESERVED?
  • should we emit an event for the 2LD? like event LockedNameMigrated ?
    • There is an underlying event PermissionedRegistry.NameRegistered however ETHRegistrar.register() emits its own event IETHRegistrar.NameRegistered

@adraffy adraffy changed the base branch from feat/internalize-entry to main February 23, 2026 22:39
@adraffy adraffy marked this pull request as ready for review February 25, 2026 21:43
@immunefi-magnus
Copy link

immunefi-magnus bot commented Feb 25, 2026

🛡️ Immunefi PR Reviews

This pull request is not eligible for a PR Reviews review. Please contact Immunefi support.

Reason: This PR can't be reviewed because no PR Reviews plan is configured for your organisation. Please ask your admin to set up a plan to enable reviews.

@adraffy
Copy link
Member Author

adraffy commented Feb 27, 2026

For the question above:

does LockedMigrationController need a guard to ensure that register() is only called on RESERVED

Now that we have reserve, I changed the LockedMigrationController test to use premigration and only grant it ROLE_REGISTER_RESERVED which ensures this situation is impossible.


  • added some more comments
  • added test for unreserved migration
  • added test that checks all of the migration events
  • added owner == address(this) idiot check
  • removed V1 expiry sync
  • changed LockedMigrationController to sync V2 expiry instead
  • changed PermissionedRegistry.register() to accept expiry = 0 for reserved-registrations

@adraffy adraffy requested a review from Arachnid March 2, 2026 10:50
@adraffy adraffy merged commit 509e25f into main Mar 3, 2026
6 checks passed
@adraffy adraffy deleted the feat/refactor-migration branch March 4, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2-audit PRs needed for audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants