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.
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→ nativebigintwith method chain handlingethers.providers.*→ v6 provider namesethers.constants.*→ v6 equivalentsZeroAddress,ZeroHashetc.callStatic.foo→foo.staticCall)getGasPrice()→getFeeData()Run it:
bash npx codemod @chinyereee/ethers-v5-to-v6 ./your-projectRepo: 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.