hardhat-deploy 2.0.0-next.66 → 2.0.0-next.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -9
- package/package.json +26 -5
package/README.md
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
|
-
<
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img alt="Rocketh Logo" src="./public/logo.svg" width="100"/><br/>
|
|
3
|
+
<a href="https://rocketh.dev/hardhat-deploy/">hardhat-deploy</a>
|
|
4
|
+
<hr/>
|
|
5
|
+
|
|
6
|
+
<!-- <a href="https://npmjs.com/package/hardhat-deploy"><img alt="Version" src="https://img.shields.io/npm/v/hardhat-deploy" /></a> -->
|
|
7
|
+
|
|
8
|
+
<a href="https://github.com/wighawag/hardhat-deploy/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/wighawag/hardhat-deploy" /></a>
|
|
9
|
+
<a href="https://npmjs.com/package/hardhat-deploy"><img src="https://img.shields.io/npm/dw/hardhat-deploy" alt="weekly downloads" /></a>
|
|
10
|
+
<a href="https://npmjs.com/package/hardhat-deploy"><img alt="Dependents" src="https://img.shields.io/librariesio/dependents/npm/hardhat-deploy" /></a>
|
|
11
|
+
|
|
12
|
+
<!-- <a href="https://github.com/wighawag/hardhat-deploy/stargazers"><img alt="Github Stars" src="https://img.shields.io/github/stars/wighawag/hardhat-deploy" /></a> -->
|
|
13
|
+
<!-- <a href="https://npmjs.com/package/hardhat-deploy"><img alt="Node Version" src="https://img.shields.io/node/v/hardhat-deploy"></a> -->
|
|
14
|
+
|
|
15
|
+
<a href="https://github.com/wighawag/hardhat-deploy/issues"><img alt="Issues and PRs" src="https://img.shields.io/github/issues-pr/wighawag/hardhat-deploy" /></a>
|
|
16
|
+
<a href="https://github.com/wighawag/hardhat-deploy/actions"><img alt="Tests Status" src="https://img.shields.io/github/actions/workflow/status/wighawag/hardhat-deploy/test.yml?label=test" /></a>
|
|
17
|
+
<a href="https://github.com/wighawag/hardhat-deploy/commits/main/"><img alt="Commit activity" src="https://img.shields.io/github/commit-activity/w/wighawag/hardhat-deploy" /></a>
|
|
18
|
+
<a href="https://github.com/wighawag/hardhat-deploy/commits/main/"><img alt="Last commit" src="https://img.shields.io/github/last-commit/wighawag/hardhat-deploy" /></a>
|
|
19
|
+
|
|
20
|
+
<!-- <a href="https://npmjs.com/package/hardhat-deploy"><img alt="dependencies status" src="https://img.shields.io/librariesio/release/npm/hardhat-deploy" /></a>-->
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<h1>hardhat-deploy</h1>
|
|
2
25
|
|
|
3
26
|
_A [Hardhat](https://hardhat.org) Plugin For Replicable Deployments And Easy Testing_
|
|
4
27
|
|
|
@@ -6,17 +29,84 @@ _A [Hardhat](https://hardhat.org) Plugin For Replicable Deployments And Easy Tes
|
|
|
6
29
|
>
|
|
7
30
|
> Documentation for hardhat-deploy v1 can be found on the [v1 branch](https://github.com/wighawag/hardhat-deploy/tree/v1#readme)
|
|
8
31
|
|
|
9
|
-
|
|
32
|
+
## What is hardhat-deploy?
|
|
33
|
+
|
|
34
|
+
**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.
|
|
35
|
+
|
|
36
|
+
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.
|
|
37
|
+
|
|
38
|
+
## Why hardhat-deploy + rocketh?
|
|
39
|
+
|
|
40
|
+
While Hardhat's official [Ignition](https://hardhat.org/ignition) plugin offers a robust deployment system, it comes with a rigid DSL that limits flexibility. **hardhat-deploy + rocketh** provides:
|
|
41
|
+
|
|
42
|
+
- **Intuitive Deployment Scripts**: Write deployment logic in plain TypeScript without learning a new DSL.
|
|
43
|
+
- **Browser-Compatible Deployments**: Thanks to [rocketh](https://github.com/wighawag/rocketh)'s framework-agnostic design, your deployment scripts can be executed directly in the browser — enabling in-app deployments, testing in web environments, and seamless integration with web frontends.
|
|
44
|
+
- **Hot Contract Replacement (HCR)**: The equivalent of HMR (Hot Module Replacement) for smart contracts. Edit your contracts and see changes live while developing your app or game using proxy patterns with conventions that make it work seamlessly.
|
|
45
|
+
- **Flexible Proxy Patterns**: Declarative proxy deployment with `deployViaProxy` for upgradeable contracts, including support for [OpenZeppelin](https://openzeppelin.com) transparent proxies.
|
|
46
|
+
- **Diamond Support**: Deploy [EIP-2535 Diamonds](https://eips.ethereum.org/EIPS/eip-2535) declaratively — specify the new state and let hardhat-deploy generate the `diamondCut` for you.
|
|
47
|
+
- **Full Control**: Access to all deployment parameters and lifecycle hooks.
|
|
48
|
+
|
|
49
|
+
## Key Features
|
|
50
|
+
|
|
51
|
+
- **Chain configuration export** (via `@rocketh/export`) — listing deployed contracts' addresses and their ABIs (useful for web apps)
|
|
52
|
+
- **Library linking** at the time of deployment
|
|
53
|
+
- **Deterministic deployment** across networks
|
|
54
|
+
- **Support for specific deploy scripts per environment** (L1 vs L2 for example)
|
|
55
|
+
- **Deployment dependency system** — only deploy what is needed
|
|
56
|
+
- **Deployment retrying** (by saving pending tx) — recover confidently from interruptions
|
|
57
|
+
- **Deployments as test fixtures** via Hardhat helpers with caching optimization
|
|
58
|
+
- **Helpers to read and execute transactions** on deployed contracts by name
|
|
59
|
+
- **Save metadata** of deployed contracts for full verification via Sourcify or Etherscan
|
|
60
|
+
- **Contract verification** submission at any time since all necessary info is saved
|
|
61
|
+
- **Support for Hardhat's fork feature** — access deployments even when running through fork
|
|
62
|
+
|
|
63
|
+
## Architecture
|
|
64
|
+
|
|
65
|
+
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.
|
|
66
|
+
|
|
67
|
+
Under the hood, hardhat-deploy uses [rocketh](https://github.com/wighawag/rocketh), a framework-agnostic system that provides a minimal API to save and load deployments. Everything else is handled by external modules:
|
|
68
|
+
|
|
69
|
+
- **`@rocketh/deploy`** — provides a `deploy` function to deploy contracts
|
|
70
|
+
- **`@rocketh/proxy`** — deploy proxies declaratively like in hardhat-deploy v1
|
|
71
|
+
- **`@rocketh/diamond`** — deploy diamonds declaratively
|
|
72
|
+
- **`@rocketh/read-execute`** — helpers for reading and executing transactions
|
|
73
|
+
- **`@rocketh/viem`** — viem client integration
|
|
74
|
+
|
|
75
|
+
You can also provide your own modules for advanced use cases.
|
|
76
|
+
|
|
77
|
+
## Quick Example
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
import { deployScript, artifacts } from "../rocketh/deploy.js";
|
|
81
|
+
|
|
82
|
+
export default deployScript(
|
|
83
|
+
async ({ deployViaProxy, namedAccounts }) => {
|
|
84
|
+
const { deployer, admin } = namedAccounts;
|
|
85
|
+
|
|
86
|
+
await deployViaProxy(
|
|
87
|
+
"GreetingsRegistry",
|
|
88
|
+
{
|
|
89
|
+
account: deployer,
|
|
90
|
+
artifact: artifacts.GreetingsRegistry,
|
|
91
|
+
args: ["prefix:"],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
owner: admin,
|
|
95
|
+
},
|
|
96
|
+
);
|
|
97
|
+
},
|
|
98
|
+
{ tags: ["GreetingsRegistry"] },
|
|
99
|
+
);
|
|
100
|
+
```
|
|
10
101
|
|
|
11
|
-
|
|
102
|
+
## Documentation
|
|
12
103
|
|
|
13
|
-
|
|
104
|
+
Please find the [full documentation here](https://rocketh.dev/hardhat-deploy/)
|
|
14
105
|
|
|
15
|
-
|
|
16
|
-
But you can provide your own module for advanced use case.
|
|
106
|
+
## Template
|
|
17
107
|
|
|
18
|
-
|
|
108
|
+
Get started quickly with the [template-ethereum-contracts](https://github.com/wighawag/template-ethereum-contracts) template that provides a production-ready setup with hardhat-deploy and rocketh.
|
|
19
109
|
|
|
20
|
-
##
|
|
110
|
+
## License
|
|
21
111
|
|
|
22
|
-
|
|
112
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hardhat-deploy",
|
|
3
|
-
"version": "2.0.0-next.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.0-next.67",
|
|
4
|
+
"description": "Hardhat plugin for replicable smart contract deployments and easy testing across multiple EVM chains, with support for proxies, diamonds, named accounts, and deployment fixtures",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"hardhat",
|
|
7
|
+
"ethereum",
|
|
8
|
+
"solidity",
|
|
9
|
+
"deployment",
|
|
10
|
+
"test",
|
|
11
|
+
"cli"
|
|
12
|
+
],
|
|
13
|
+
"author": "Ronan Sandford",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"homepage": "https://github.com/wighawag/hardhat-deploy#readme",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/wighawag/hardhat-deploy.git"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/wighawag/hardhat-deploy/issues"
|
|
22
|
+
},
|
|
5
23
|
"publishConfig": {
|
|
6
24
|
"access": "public"
|
|
7
25
|
},
|
|
@@ -32,19 +50,22 @@
|
|
|
32
50
|
"bin": {
|
|
33
51
|
"hardhat-deploy": "./dist/cli.js"
|
|
34
52
|
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=22.0.0"
|
|
55
|
+
},
|
|
35
56
|
"devDependencies": {
|
|
36
57
|
"@changesets/cli": "^2.29.8",
|
|
37
|
-
"@rocketh/node": "0.17.
|
|
58
|
+
"@rocketh/node": "0.17.21",
|
|
38
59
|
"@types/node": "^25.0.10",
|
|
39
60
|
"as-soon": "^0.1.5",
|
|
40
61
|
"hardhat": "3.1.5",
|
|
41
62
|
"rimraf": "^6.1.2",
|
|
42
|
-
"rocketh": "0.17.
|
|
63
|
+
"rocketh": "0.17.18",
|
|
43
64
|
"set-defaults": "^0.0.5",
|
|
44
65
|
"typescript": "^5.9.3"
|
|
45
66
|
},
|
|
46
67
|
"peerDependencies": {
|
|
47
|
-
"@rocketh/node": "^0.17.
|
|
68
|
+
"@rocketh/node": "^0.17.21",
|
|
48
69
|
"hardhat": "^3.1.5"
|
|
49
70
|
},
|
|
50
71
|
"dependencies": {
|