Skip to content

Community codemod available for v5 → v6 migration — worth referencing in docs? #5129

@Chinyereee

Description

@Chinyereee

Suggestion

Hi!
I built and published an open-source codemod that automates 90% of the v5 → v6 migration for projects using jscodeshift.

Tested on Uniswap/v3-periphery: 28 files migrated automatically, 502 lines changed, 0 false positives, 154 tests.

What it handles automatically:

  • ethers.utils.* → flattened v6 namespace (25 renames)
  • BigNumber → native bigint with method chain handling
  • ethers.providers.* → v6 provider names
  • ethers.constants.* → v6 equivalents ZeroAddress , ZeroHash etc.
  • Contract method buckets (callStatic.foo foo.staticCall)
  • getGasPrice()getFeeData()

Run it:
bash npx codemod @chinyereee/ethers-v5-to-v6 ./your-project

Repo: https://github.com/Chinyereee/ethers-v5-to-v6-codemod

Would you be open to adding a one-line reference to this in the migration guide at https://docs.ethers.org/v6/migrating/ ?
Happy to submit a docs PR if that's easier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationDocumentation related issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions