hardhat deployment plugin
See the codeA Hardhat Plugin For Replicable Deployments And Easy Testing
Note: This is the documentation for hardhat-deploy v2 that works with hardhat v3
Documentation for hardhat-deploy v1 can be found on the v1 branch
hardhat-deploy is powered by rocketh, and its source code and active development now live in the rocketh monorepo. This repository remains the home of the hardhat-deploy brand and its history, but code changes and issue tracking happen in rocketh so everything stays tested and released together.
The npm package is unchanged: keep installing hardhat-deploy exactly as before.
hardhat-deploy makes it easy for you to deploy your EVM smart contracts across many chains while keeping track of them and replicating the same environment for testing.
It adds a mechanism to associate names to addresses, so test and deployment scripts can be reconfigured by simply changing the address a name points to. This results in much clearer tests and deployment scripts — no more accounts[0] in your code.
While Hardhat's official Ignition plugin offers a robust deployment system, it comes with a rigid DSL that limits flexibility. hardhat-deploy + rocketh provides:
deployViaProxy for upgradeable contracts, including support for OpenZeppelin transparent proxies.diamondCut for you.@rocketh/export) — listing deployed contracts' addresses and their ABIs (useful for web apps)Version 2 is a full rewrite that has been used in production for several years. It is fully modular, making it much easier to contribute new deployment mechanisms.
Under the hood, hardhat-deploy uses rocketh, a framework-agnostic system that provides a minimal API to save and load deployments. Everything else is handled by external modules:
@rocketh/deploy — provides a deploy function to deploy contracts@rocketh/proxy — deploy proxies declaratively like in hardhat-deploy v1@rocketh/diamond — deploy diamonds declaratively@rocketh/read-execute — helpers for reading and executing transactions@rocketh/viem — viem client integrationYou can also provide your own modules for advanced use cases.
import { deployScript, artifacts } from "../rocketh/deploy.js";
export default deployScript(
async ({ deployViaProxy, namedAccounts }) => {
const { deployer, admin } = namedAccounts;
await deployViaProxy(
"GreetingsRegistry",
{
account: deployer,
artifact: artifacts.GreetingsRegistry,
args: ["prefix:"],
},
{
owner: admin,
},
);
},
{ tags: ["GreetingsRegistry"] },
);
Please find the full documentation here, and the rocketh documentation at rocketh.dev
If you're migrating from hardhat-deploy v1 to v2 and want to use AI to help with the process, check out our SKILL.md file. This comprehensive guide is designed for AI assistants and includes detailed instructions for systematic migration, code transformation rules, and troubleshooting guidance.
Note: This migration skill now lives in the rocketh monorepo at
skills/hardhat-deploy-migration/. If you had it bookmarked underwighawag/hardhat-deploy, update your link to the rocketh location above.
Get started quickly with the template-ethereum-contracts template that provides a production-ready setup with hardhat-deploy and rocketh.
MIT
If you find this project useful, please consider sponsoring it! Your support helps me continue developing and maintaining this tool.
Overall
Maintained
Code review
Latest release
Releases this year
1,026 followers · starred Apr 2021
11,202 followers · starred Jan 2022
70 followers · starred Apr 2023
86 followers · starred Dec 2020
hardhat deployment plugin
See the codeA Hardhat Plugin For Replicable Deployments And Easy Testing
Note: This is the documentation for hardhat-deploy v2 that works with hardhat v3
Documentation for hardhat-deploy v1 can be found on the v1 branch
hardhat-deploy is powered by rocketh, and its source code and active development now live in the rocketh monorepo. This repository remains the home of the hardhat-deploy brand and its history, but code changes and issue tracking happen in rocketh so everything stays tested and released together.
The npm package is unchanged: keep installing hardhat-deploy exactly as before.
hardhat-deploy makes it easy for you to deploy your EVM smart contracts across many chains while keeping track of them and replicating the same environment for testing.
It adds a mechanism to associate names to addresses, so test and deployment scripts can be reconfigured by simply changing the address a name points to. This results in much clearer tests and deployment scripts — no more accounts[0] in your code.
While Hardhat's official Ignition plugin offers a robust deployment system, it comes with a rigid DSL that limits flexibility. hardhat-deploy + rocketh provides:
deployViaProxy for upgradeable contracts, including support for OpenZeppelin transparent proxies.diamondCut for you.@rocketh/export) — listing deployed contracts' addresses and their ABIs (useful for web apps)Version 2 is a full rewrite that has been used in production for several years. It is fully modular, making it much easier to contribute new deployment mechanisms.
Under the hood, hardhat-deploy uses rocketh, a framework-agnostic system that provides a minimal API to save and load deployments. Everything else is handled by external modules:
@rocketh/deploy — provides a deploy function to deploy contracts@rocketh/proxy — deploy proxies declaratively like in hardhat-deploy v1@rocketh/diamond — deploy diamonds declaratively@rocketh/read-execute — helpers for reading and executing transactions@rocketh/viem — viem client integrationYou can also provide your own modules for advanced use cases.
import { deployScript, artifacts } from "../rocketh/deploy.js";
export default deployScript(
async ({ deployViaProxy, namedAccounts }) => {
const { deployer, admin } = namedAccounts;
await deployViaProxy(
"GreetingsRegistry",
{
account: deployer,
artifact: artifacts.GreetingsRegistry,
args: ["prefix:"],
},
{
owner: admin,
},
);
},
{ tags: ["GreetingsRegistry"] },
);
Please find the full documentation here, and the rocketh documentation at rocketh.dev
If you're migrating from hardhat-deploy v1 to v2 and want to use AI to help with the process, check out our SKILL.md file. This comprehensive guide is designed for AI assistants and includes detailed instructions for systematic migration, code transformation rules, and troubleshooting guidance.
Note: This migration skill now lives in the rocketh monorepo at
skills/hardhat-deploy-migration/. If you had it bookmarked underwighawag/hardhat-deploy, update your link to the rocketh location above.
Get started quickly with the template-ethereum-contracts template that provides a production-ready setup with hardhat-deploy and rocketh.
MIT
If you find this project useful, please consider sponsoring it! Your support helps me continue developing and maintaining this tool.
Overall
Maintained
Code review
Latest release
Releases this year
1,026 followers · starred Apr 2021
11,202 followers · starred Jan 2022
70 followers · starred Apr 2023
86 followers · starred Dec 2020