Skip to content

Add ETHRenewerV1 support for legacy name renewals#355

Open
Chakravarthy7102 wants to merge 9 commits into
feature/fet-1885-ensjs-refactorfrom
v1-renew
Open

Add ETHRenewerV1 support for legacy name renewals#355
Chakravarthy7102 wants to merge 9 commits into
feature/fet-1885-ensjs-refactorfrom
v1-renew

Conversation

@Chakravarthy7102

Copy link
Copy Markdown
  • Introduced isRenewable function to check if a legacy .eth name can be renewed via the ETHRenewerV1 contract.
  • Implemented renewNameV1 function to facilitate the renewal of unmigrated legacy .eth names using ERC-20 payments.
  • Updated L1 client to include the ETHRenewerV1 contract and its ABI snippets.
  • Exported new actions in public and wallet modules for broader access.

- Introduced `isRenewable` function to check if a legacy .eth name can be renewed via the ETHRenewerV1 contract.
- Implemented `renewNameV1` function to facilitate the renewal of unmigrated legacy .eth names using ERC-20 payments.
- Updated L1 client to include the ETHRenewerV1 contract and its ABI snippets.
- Exported new actions in public and wallet modules for broader access.
@pkg-pr-new

pkg-pr-new Bot commented Jul 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/ensdomains/ensjs/@ensdomains/ensjs@355
npm i https://pkg.pr.new/ensdomains/ensjs/@ensdomains/ensjs-abi@355

commit: e4b9bba

@codecov-commenter

codecov-commenter commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.57009% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.21%. Comparing base (1b5a991) to head (e4b9bba).
⚠️ Report is 2 commits behind head on feature/fet-1885-ensjs-refactor.

Files with missing lines Patch % Lines
packages/ensjs/src/actions/wallet/renewName.ts 70.66% 22 Missing ⚠️
packages/ensjs/src/exports/public/v2.ts 0.00% 1 Missing ⚠️
packages/ensjs/src/exports/wallet.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                         @@
##           feature/fet-1885-ensjs-refactor     #355      +/-   ##
===================================================================
+ Coverage                            69.96%   70.21%   +0.24%     
===================================================================
  Files                                  166      166              
  Lines                                 7738     7721      -17     
  Branches                               812      814       +2     
===================================================================
+ Hits                                  5414     5421       +7     
+ Misses                                2290     2266      -24     
  Partials                                34       34              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- Added `viem` version override to package.json and pnpm-lock.yaml to ensure compatibility.
- Introduced tests for `isRenewable` and `renewNameV1WriteParameters` functions to validate name renewal logic.
- Updated test contracts to include necessary deployment addresses for testing.
- Ensured that the new tests cover both renewable and non-existent labels for comprehensive validation.
- Clarified the description of the renewerAddress parameter in getRenewPrice to specify that it refers to unmigrated v1 names.
- Updated the isRenewable test case to accurately reflect that it returns false for labels that were never registered.
…e code readability and maintain focus on relevant functionality.
Comment thread packages/ensjs/src/actions/wallet/renewName.ts
Comment thread packages/ensjs/src/actions/wallet/v2/renewNameV1.ts Outdated
Comment thread packages/ensjs/src/actions/wallet/v2/renewNameV1.ts Outdated
- Introduced `renewName` function to handle the renewal of 2LD .eth names using the ETHRenewerV1 contract.
- Implemented `renewNameWriteParameters` to generate the necessary parameters for the renewal transaction.
- Added tests for `renewName` to validate behavior for both valid and invalid name inputs.
- Removed outdated `renewNames` functionality and tests to streamline the codebase.
@Chakravarthy7102 Chakravarthy7102 requested a review from v1rtl July 7, 2026 11:42
Comment thread packages/ensjs-abi/package.json Outdated
Comment thread packages/ensjs/src/actions/wallet/renewName.ts
- Replaced references to the outdated ETHRenewerV1 with the new ETHRenewer in the wallet renewal functionality.
- Updated package.json to include the new ETHRenewer ABI and removed the deprecated ETHRenewerV1 entry.
- Adjusted exports in the v1 and v2 index files to reflect the changes in the renewal logic.
- Updated `renewNameWriteParameters` to accept a `contract` parameter, allowing for the use of both `ensEthRegistrar` and `ensEthRenewerV1` for name renewals.
- Enhanced tests to validate the encoding of renewal calldata for both contract types.
- Removed outdated v2 renewal tests and functionality to streamline the codebase.
Comment on lines +100 to +120
const baseParams = {
address,
functionName: 'renew',
args: [label, duration, paymentToken, referrer] as const,
chain: client.chain,
account: client.account,
} as const

if (contract === 'ensEthRenewerV1') {
return {
...baseParams,
abi: ethRenewerV1RenewSnippet,
} as const satisfies WriteContractParameters<
typeof ethRenewerV1RenewSnippet
>
}

return {
...baseParams,
abi: ethRegistrarRenewSnippet,
} as const satisfies WriteContractParameters<typeof ethRegistrarRenewSnippet>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since ABIs are the same, we don't really need two separate ones for it, no?

can be collapsed to the same return and use ethRegistrarRenewSnippet

- Added comments in `renewNameWriteParameters` to explain that while the two renewers share an identical ABI, they are distinct contracts that may diverge in the future. This helps maintain clarity in the code regarding contract-specific logic.
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants