Skip to content

fix: migrate example extension to hardhat v3#123

Merged
technophile-04 merged 1 commit into
examplefrom
example-hhv3
Jun 5, 2026
Merged

fix: migrate example extension to hardhat v3#123
technophile-04 merged 1 commit into
examplefrom
example-hhv3

Conversation

@rin-st

@rin-st rin-st commented Jun 3, 2026

Copy link
Copy Markdown
Member

Migrates the example extension's hardhat side to be compatible with hardhat v3 + rocketh (the base templates were migrated in create-eth, see PR #433). Without this, yarn cli ... -e scaffold-eth/create-eth-extensions:example fails after the backmerge.

What

File Change
hardhat.config.ts.args.mjs customNetwork → add type: "http" (hh-v3 requires a network type); drop invalid per-network verify block → declare custom block explorer via top-level chainDescriptors (keyed by chainId) + customNetwork.chainId; register the extension task via tasks: [...deployTasks, sayHelloTask]
deploy/01_deploy_se2_token.ts old hardhat-deploy API (hre.getNamedAccounts()) → rocketh deployScript
tasks/index.ts hh-v2 task().setAction(fn)setInlineAction(...).build(), exported & registered in config
test/SE2Token.ts hh-v2 import { ethers } from "hardhat" + typechain → typed Abi_SE2Token fixture (network.create() + loadAndExecuteDeploymentsFromFiles + getContractAt), mirroring the base test

(The next16 wagmiConfig lint fix is already on example via #122.)

Local validation (generated hardhat + extension instance, node 22.18)

  • yarn compile ✓ (solc 0.8.20)
  • yarn deploy ✓ (SE2Token deployed, deployedContracts.ts regenerated)
  • yarn test ✓ (3 passing)
  • hardhat:check-types ✓ (was 10 errors)
  • hardhat:lint --max-warnings=0 ✓ / next:lint --max-warnings=0 ✓ / next:check-types
  • hardhat sayHello task ✓ (prints "Hello, World!", listed in --help)

Notes

  • customNetwork.chainId: 99999 is a placeholder; the chainDescriptors custom-explorer flow was verified against installed hh-v3 type defs, not exercised against a real explorer.

🤖 Generated with Claude Code

@technophile-04 technophile-04 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @rin-st!

@technophile-04 technophile-04 merged commit 1ed4be4 into example Jun 5, 2026
8 of 9 checks passed
@technophile-04 technophile-04 deleted the example-hhv3 branch June 5, 2026 09:58
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.

2 participants