wighawag/rocketh/hardhat-deploy-migration
Claude Code and agent skill by wighawag/rocketh
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Comprehensive guide for migrating projects from hardhat-deploy v1 to v2, including dependency updates, configuration restructuring, deploy script conversion, test updates, and troubleshooting
Install
npx vskill@latest install wighawag/rocketh/hardhat-deploy-migrationSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as wighawag/rocketh/hardhat-deploy-migration.
SKILL: Migrate hardhat-deploy v1 to v2
This guide provides comprehensive instructions for migrating projects from hardhat-deploy v1 to v2. It's designed for AI assistants to understand and execute the migration process systematically.
Note: For complete working examples, see the template-ethereum-contracts repository which demonstrates a full hardhat-deploy v2 setup.
Before converting anything, check the project against the capability map. This skill teaches how to translate what v2 HAS. What v1 has that v2 does not, or has differently (everydeploymentsmember, every deploy and proxy option, named-account forms, CLI flags, environment variables, deployment-file fields,catchUnknownSigner's thunk form, and how one project consumes another's contracts), is listed in ONE place: the v1-to-v2 capability map (source: `hardhat-deploy/migration/index.md`). Fetch it, look up every v1 feature the project uses, and when one is marked not supported or not supported yet, tell the user before porting that script. Do not invent a translation the map does not give.
Table of Contents
- Introduction
- Prerequisites Check
- Architecture Comparison
- Step-by-Step Migration
- Common Patterns & Examples
- Troubleshooting Guide
- Migration Checklist
- Advanced Topics
Introduction
Overview
hardhat-deploy v2 is a complete rewrite that requires Hardhat 3.x and introduces significant architectural changes:
- ESM Modules: v2 uses native ES modules (
import/export) instead of CommonJS - Rocketh Integration: v2 integrates with the rocketh ecosystem for deployment management
- Configuration Changes: Named accounts moved from hardhat.config.ts to rocketh/config.ts
- Plugin System: Enhanced extensibility through rocketh extensions
Key Differences Summary
| Aspect | v1 Pattern | v2 Pattern | |
|---|---|---|---|
| Hardhat version | 2.x | 3.x (specifically ^3.1.5) | |
| Module system | CommonJS (require/module.exports) | ESM (import/export) | |
| Named accounts | namedAccounts in hardhat.config.ts | rocketh/config.ts | |
| Deploy function | deployments.deploy(name, {...}) | deploy(name, {account: ..., artifact: ...}) | |
| Deployer param | from: address | account: address | |
| Solidity config | solidity: "0.8.x" | solidity: {profiles: {default: {version: "..."}}} | |
| Test fixtures | deployments.createFixture() | Custom fixture with loadAndExecuteDeploymentsFromFiles() | |
| Contract interaction | ethers.getContract() | env.get() + env.execute() |
When to Stay on v1
If you have a production project using hardhat-deploy v1 with Hardhat 2.x, it's often better to stay on v1:
v1 continues to receive security fixes but won't get new features.
Prerequisites Check
Before starting the migration, verify your environment meets these requirements:
Checklist
Required Versions
- Node.js: 22 or higher
- Hardhat: 3.x or higher (specifically
^3.1.5recommended) - TypeScript: 5.x (for TypeScript projects)
Pre-Migration Assessment
Check for these v1 patterns in your project:
Architecture Comparison
v1 Architecture
Key Files in v1:
hardhat.config.ts- Single configuration filedeploy/*.ts- Deploy scripts with HRE patterntest/*.ts- Tests using deployments fixtureutils/network.ts- Network configuration helper
v2 Architecture
Key Files in v2:
hardhat.config.ts- Hardhat configuration (no named accounts)rocketh/config.ts- Named accounts and extensionsrocketh/deploy.ts- Deploy script setuprocketh/environment.ts- Environment setup for tests/scriptsdeploy/*.ts- Deploy scripts with new patterntest/*.ts- Tests using new fixture pattern
Step-by-Step Migration
Step 1: Update Dependencies
Update your package.json to use Hardhat 3.x and hardhat-deploy v2:
v1 package.json example:
v2 package.json example: (see template-ethereum-contracts/package.json)
Transformation Rules:
- Add
"type": "module"at the top level - Update
hardhatto^3.1.4or higher - Update
hardhat-deployto^2.0.0or higher - Remove
hardhat-deploy-ethersandhardhat-deploy-tenderly - Add rocketh packages:
rocketh,@rocketh/deploy,@rocketh/read-execute,@rocketh/node,@rocketh/signer - Add optional packages:
@rocketh/proxy,@rocketh/export,@rocketh/verifier,@rocketh/doc - Add
viemfor contract interactions - Add
earlfor assertions (for node:test) - Add Hardhat 3.x plugins
Install dependencies:
Step 2: Restructure Configuration
2.1 Convert hardhat.config.ts
v1 hardhat.config.ts example:
v2 hardhat.config.ts example: (see template-ethereum-contracts/hardhat.config.ts)
Transformation Rules:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/hardhat-deploy-migration/SKILL.md
Popularity
- Repository stars
- 35
- Repository forks
- 10
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/wighawag/rocketh/hardhat-deploy-migration)