Skip to content

New ensjs - #230

Draft
LeonmanRolls wants to merge 516 commits into
mainfrom
feature/fet-1885-ensjs-refactor
Draft

New ensjs#230
LeonmanRolls wants to merge 516 commits into
mainfrom
feature/fet-1885-ensjs-refactor

Conversation

@LeonmanRolls

Copy link
Copy Markdown
Member

No description provided.

@LeonmanRolls LeonmanRolls changed the title Add more error types to actions New ensjs May 27, 2025
@svemat01
svemat01 marked this pull request as draft May 27, 2025 18:02
@pkg-pr-new

pkg-pr-new Bot commented Jul 4, 2025

Copy link
Copy Markdown

Open in StackBlitz

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

commit: e96662c

Comment thread packages/ensjs/src/utils/name/hexEncodedName.ts Fixed
Malak67 and others added 26 commits December 9, 2025 12:09
feat(ensjs/v2): `getNameRolesForAccount`
v1rtl and others added 9 commits June 29, 2026 15:23
- l1.ts (sepolia): ensUniversalResolver 0xeEeE… (stale UpgradableUniversalResolverProxy
  pointing at a dead RootRegistry) -> 0x2f8a… (canonical UniversalResolverV2 that
  resolves both v1 and v2 names and exposes findParentRegistry).
- addTestContracts (devnet): ensUniversalResolver -> legacy UniversalResolver (0x4b6a…),
  which resolves both v1 and v2 names; the devnet UpgradableUniversalResolverProxy
  cannot resolve unmigrated v1 names.
- getAvailable: temporarily hardcode the URv2 address used for findParentRegistry per
  chain, since no single devnet UR both resolves v1 names and exposes findParentRegistry.
  Documented for removal once the devnet ships a unified URv2 (matching sepolia).
feat(ensjs/getAvailable): support .eth subnames of any depth
Point sepolia ensUniversalResolver at the UpgradableUniversalResolverProxy
(0xeEeE…EeEe), which resolves both v1 and v2 names and exposes
findParentRegistry. Remove the temporary hardcoded UR-by-chain-id map in
v2/getAvailable now that the configured ensUniversalResolver handles
findParentRegistry for both v1 and v2 names.
vitest config:
- Split tests into two projects: pure-logic (utils, coders, mocked
  actions) run in parallel; devnet-touching tests run serially in a
  single fork (evm_snapshot/revert share global IDs on the shared
  devnet and cannot run across multiple forks).

test123.eth fixes:
- Wallet set-record/resolver/primaryName and wrapName tests operated on
  test123.eth, which is intentionally v1-only (not pre-migrated to v2),
  so the UR findResolver returned address(0) and writes/reads failed.
  Point them at pre-migrated names (with-subnames.eth /
  with-contenthash.eth) that resolve via the ENSv1 mirror; keep
  test123.eth v1-only for the getRegisterPrice availability tests.

deps:
- Bump vitest + @vitest/coverage-v8 to ^3.2.6; update vi.fn<...>()
  generics to the v3 single-type-arg signature in ccip tests.
- react: bump wagmi + @wagmi/core to ^3, drop tslib.
- Remove ts-node from root and react (replaced by node/tsx).
…able

fix(ensjs): use UR proxy address for getAvailable subname traversal
(chore): Adding default reverse registrar abi snippets
Refactor v2 getOwner to call UniversalResolver.findOwner instead of
reading getState on a specific registry directly. This supports .eth
names of any depth via the universal resolver, matching the existing
getNameRegistries pattern.

The action now takes only a name; the UniversalResolver address is
resolved from the chain's ensUniversalResolver contract.
refactor(ensjs): use UR.findOwner for v2 getOwner
@Chakravarthy7102
Chakravarthy7102 force-pushed the feature/fet-1885-ensjs-refactor branch from db0294b to 1b5a991 Compare July 7, 2026 14:08
Malak67 and others added 13 commits July 8, 2026 14:35
…snippets

feat(ensjs-abi): add BaseRegistrar admin + wrapETH2LD snippets
- 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.
- 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.
- 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.
- 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.
- 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.
- Removed the ETHRenewerV1 ABI and related code from the renewal process, consolidating the logic to use a single ABI for both renewer contracts.
- Updated `renewNameWriteParameters` to reflect this change, simplifying the return structure.
- Adjusted exports in the v1 index file to remove references to the deprecated ETHRenewerV1, enhancing code clarity and maintainability.
Add ETHRenewerV1 support for legacy name renewals
cache: "pnpm"

- name: Install dependencies
run: pnpm install
Sync the sepolia v2 entries with the contracts-v2 deployment doc
(contracts/docs/addresses/sepolia.md @ 97a5729).

Addresses verified on-chain via cast:
- RootRegistry.getSubregistry("eth") resolves to the new ETHRegistry
- ETHRegistrar.rentPriceOracle() resolves to the new StandardRentPriceOracle
- ETHRegistry.getResolver("test") resolves to the deployment's ENSV1Resolver
- USDC/DAI mocks report the expected symbols and decimals

ensUniversalResolver is unchanged: its EIP-1967 slot now routes through
ManagedUniversalResolverProxy to UniversalResolverV2. Mainnet and all v1
entries are untouched.
@sonarqubecloud

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.

7 participants