Hardhat Migration is a TypeScript plugin for Hardhat that provides a structured migration framework for smart contract deployments. It allows developers to write migrations as TypeScript files, with support for transaction tracking, rollbacks, and network-specific configurations. The current stable version is 1.0.2, released in 2023. It is community-maintained and offers a simple, filesystem-based migration approach, differentiating itself from other deployment tools by focusing on ease of use and TypeScript integration. Peer dependency: Hardhat ^2.0.0.
npm install hardhat-migrationNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows setup of hardhat.config.ts with migration path and a simple migration file that deploys a contract.
Convert .js migration files to .ts and ensure TypeScript is configured in Hardhat.
Use import syntax and ensure your project is ESM or Hardhat is configured for ESM.
Change import to 'import { migrate } from 'hardhat-migration/tasks'Use consistent naming like '001_', '002_' to ensure correct order.
Use only one migration system; remove 'hardhat-deploy' or its migration tasks.
Run 'npm install --save-dev hardhat-migration' and ensure it's in package.json.
Update Hardhat to version 2.0.0 or higher: 'npm install --save-dev hardhat@^2.0.0'
Use named import: 'import { migration } from 'hardhat-migration'Use import syntax instead of require().