Add ENSv2 migration command - #8
Merged
Merged
Conversation
Member
|
Successfully migrated |
commit: |
gskril
marked this pull request as ready for review
July 22, 2026 05:54
gskril
approved these changes
Jul 22, 2026
gskril
left a comment
Member
There was a problem hiding this comment.
Probably can clean up code and can definitely test further, but migration is working at least for unwrapped names so i'm merging for now. This repo is meant to be fast pace.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ens migrate <name>for one-way ENSv1-to-ENSv2 migration of reserved.eth2LDs.safeTransferFromcall and migration payload for the selected controller.flagswhen there are none.Why
Existing ENSv1 names claim their pre-migrated ENSv2 reservations through different controllers depending on whether the name is unwrapped, wrapped but unlocked, or wrapped and locked. The CLI previously had no way to inspect this state and generate the correct unsigned migration transaction.
The command follows the ENSv2 migration controller flow and uses a direct token transfer for a single-name CLI operation, avoiding the approval-for-all requirement of the batch-oriented
MigrationHelper.ENSv1 Public Resolver authorization is tied to the ENSv1 registry, so reusing it after migration can leave the ENSv2 owner unable to update records. The CLI now discovers and uses the target owner’s canonical OwnedResolver when it is already deployed.
Behavior
Running:
now:
.eth2LD in ENSv2.ETHRenewerV1.--resolverwhen provided; otherwise uses the new owner’s deployed canonical OwnedResolver when available.For wrapped-locked names with
CANNOT_SET_RESOLVER, resolver discovery is skipped because the migration controller ignores the resolver payload. The returned flags explain this and other relevant fuse-dependent behavior.Names with
CANNOT_TRANSFERfail early because NameWrapper cannot perform the transfer required for migration. A locked name withCANNOT_APPROVEand an existing frozen token approval also returns an actionable warning before broadcast.Validation
bun run typecheckbun run buildbun run src/index.ts migrate --helpbun run src/index.ts resolver deploy --helpgit diff --checkReferences