Skip to content

Commit fdcf6a4

Browse files
committed
Merge branch 'main' into edr/main
2 parents 04f9ae4 + b626dc1 commit fdcf6a4

File tree

156 files changed

+2515
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+2515
-256
lines changed

.changeset/beige-ladybugs-confess.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": patch
3+
---
4+
5+
Added a notification when a new Hardhat version is available

.changeset/dry-pianos-scream.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": patch
3+
---
4+
5+
Fixed a bug during project initialization when using yarn or pnpm

.changeset/eleven-pears-accept.md

-5
This file was deleted.

.changeset/fair-tools-remember.md

-5
This file was deleted.

.changeset/friendly-ways-beg.md

-5
This file was deleted.

.changeset/modern-fishes-look.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": patch
3+
---
4+
5+
Added a fix to prevent submitting transactions with 0 priority fee (thanks @itsdevbear!)

.changeset/old-phones-live.md

-5
This file was deleted.

.changeset/quiet-cooks-sneeze.md

-5
This file was deleted.

.changeset/real-coins-tease.md

-5
This file was deleted.

.changeset/small-crews-kiss.md

-5
This file was deleted.

.changeset/soft-lobsters-rush.md

-5
This file was deleted.

.changeset/strong-mangos-tickle.md

-5
This file was deleted.

.github/workflows/e2e-tests.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: E2E tests
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
8+
jobs:
9+
run-e2e:
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest, macos-latest, windows-latest]
13+
name: Run E2E tests on ${{ matrix.os }}
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: pnpm/action-setup@v2
18+
with:
19+
version: 8
20+
- uses: actions/setup-node@v2
21+
with:
22+
node-version: 18
23+
- name: Run fixture-projects script
24+
run: |
25+
cd e2e
26+
chmod +x run-fixture-projects.sh
27+
./run-fixture-projects.sh
28+
shell: bash
29+
- name: Run test-project-initialization script
30+
run: |
31+
cd e2e
32+
chmod +x test-project-initialization.sh
33+
./test-project-initialization.sh
34+
shell: bash

docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Landing pages don't support themes.
200200

201201
## Creating new landings
202202

203-
Landing pages contains special "blocks" see src/components/landingBlocks. To create a new landing page start from copying `/pages/index.tsx` and `src/content/home.ts`. You can create another page by reodering existing blocks and passing another content to them. If necessary create new landing blocks.
203+
Landing pages contains special "blocks" see src/components/landingBlocks. To create a new landing page start from copying `/pages/index.tsx` and `src/content/home.ts`. You can create another page by reordering existing blocks and passing another content to them. If necessary create new landing blocks.
204204

205205
## CI/CD
206206

docs/next.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const linariaConfig = withLinaria({
1414
// We moved the privacy policy to /static to make the next rule
1515
// simpler, so we need to redirect it before it, instead of in a customRedirect
1616
{
17-
source: "/privacy-policy.html",
17+
source: "/privacy-policy",
1818
destination: "/static/privacy-policy.html",
1919
permanent: false,
2020
},

docs/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"preinstall": "npx -y only-allow pnpm",
76
"prebuild": "ts-node --transpileOnly --skipProject scripts/prepare-error-list.ts",
87
"dev": "next-remote-watch ./src/content",
98
"dev:debug": "NODE_OPTIONS='--inspect' next dev",
109
"build": "next build",
1110
"postbuild": "next-sitemap",
1211
"build:test": "ANALYZE=true next build",
1312
"start": "next start",
14-
"lint": "eslint src -f unix",
15-
"storybook": "NODE_OPTIONS='--openssl-legacy-provider' start-storybook -p 6006 --ci",
16-
"build-storybook": "NODE_OPTIONS='--openssl-legacy-provider' build-storybook"
13+
"lint": "eslint src -f unix"
1714
},
1815
"dependencies": {
1916
"@callstack/react-theme-provider": "^3.0.7",

docs/redirects.config.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,21 @@ const customRedirects = [
8888
destination: "/hardhat-runner/docs/guides/migrating-from-hardhat-waffle",
8989
permanent: false,
9090
},
91+
{
92+
source: "/hardhat-runner/docs/guides/migrating-from-hardhat-waffle",
93+
destination: "/hardhat-runner/docs/advanced/migrating-from-hardhat-waffle",
94+
permanent: false,
95+
},
9196
{
9297
source: "/custom-hardfork-history",
9398
destination:
9499
"/hardhat-network/docs/guides/forking-other-networks.html#using-a-custom-hardfork-history",
95100
permanent: false,
96101
},
97102
{
98-
source: "/solidity-survey-2022",
103+
source: "/solidity-survey-2023",
99104
destination:
100-
"https://cryptpad.fr/form/#/2/form/view/HuPIRv4gvziSV0dPV1SJncKzYJXTVc8LGCaMfLUoj2c/",
105+
"https://cryptpad.fr/form/#/2/form/view/pV-DdryeJoYUWvW+gXsFaMNynEY7t5mUsgeD1urgwSE",
101106
permanent: false,
102107
},
103108
{
@@ -304,6 +309,12 @@ const customRedirects = [
304309
destination: "/hardhat-runner/plugins/nomicfoundation-hardhat-ethers",
305310
permanent: false,
306311
},
312+
{
313+
source: "/release/:version",
314+
destination:
315+
"https://github.com/NomicFoundation/hardhat/releases/tag/hardhat%40:version",
316+
permanent: false,
317+
},
307318
...loadErrorRedirects(),
308319
];
309320

docs/src/components/Navigation.mocks.json

+4
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@
169169
"label": "@nomiclabs/hardhat-web3",
170170
"href": "/plugins/nomiclabs-hardhat-web3"
171171
},
172+
{
173+
"label": "@nomicfoundation/hardhat-web3-v4",
174+
"href": "/plugins/nomicfoundation-hardhat-web3-v4"
175+
},
172176
{
173177
"label": "@nomiclabs/hardhat-truffle5",
174178
"href": "/plugins/nomiclabs-hardhat-truffle5"

docs/src/config.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ export const SOCIALS_LINKS = {
2222
[SocialsEnum.DISCORD]: "/discord",
2323
};
2424

25-
export const BANNER_LINK = "https://nomic.foundation/hiring";
25+
export const BANNER_LINK =
26+
"https://cryptpad.fr/form/#/2/form/view/pV-DdryeJoYUWvW+gXsFaMNynEY7t5mUsgeD1urgwSE";
2627

2728
export const PRIVACY_POLICY_PATH = "/privacy-policy.html";
2829

2930
export const bannerContent = {
30-
text: "Join the Hardhat team! Nomic Foundation is hiring",
31-
shortText: "Join the Hardhat team! We are hiring",
31+
text: "Please take a few minutes to complete the 2023 Solidity Survey",
32+
shortText: "Complete the 2023 Solidity Survey here",
3233
href: BANNER_LINK,
3334
};
3435

docs/src/content/hardhat-chai-matchers/docs/reference.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ If the event has arguments, the `.withArgs` matcher can be added:
128128

129129
```ts
130130
await expect(token.transfer(address, 0))
131-
.to.be.revertedWithCustomError(token, "InvalidTransferValue")
131+
.to.emit(token, "Transfer")
132132
.withArgs(100);
133133
```
134134

@@ -203,7 +203,7 @@ Can be used after a `.emit` or a `.revertedWithCustomError` matcher to assert th
203203
```ts
204204
// events
205205
await expect(token.transfer(address, 0))
206-
.to.be.revertedWithCustomError(token, "InvalidTransferValue")
206+
.to.emit(token, "Transfer")
207207
.withArgs(100);
208208

209209
// errors

docs/src/content/hardhat-network/docs/explanation/mining-modes.md

+12
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ const pendingBlock = await network.provider.send("eth_getBlockByNumber", [
2727
]);
2828
```
2929

30+
### Mining multiple transactions in one block
31+
32+
Note that for the special case of the Hardhat Network, the transaction `gas`-limit config [defaults to the fixed `blockGasLimit`](../reference/index.md#gas), not to [`auto`](/hardhat-runner/docs/config) (gas-estimation). This [speeds things up](https://github.com/NomicFoundation/hardhat/issues/4090#issuecomment-1622155314), but consequently limits the transactions per block to a maximum of 1. So to mine multiple transactions in a single block on the Hardhat Network, in addition to disabling automine, either specify the transaction `gasLimit` explicitly for each of the transactions, or force automatic gas-estimation in your config with:
33+
34+
```
35+
networks: {
36+
hardhat: {
37+
gas: "auto",
38+
},
39+
},
40+
```
41+
3042
### Mining transactions in FIFO order
3143

3244
The way Hardhat Network's mempool orders transactions is customizable. By default, they are prioritized following Geth's rules, but you can enable a FIFO behavior instead, which ensures that transactions are added to blocks in the same order they are sent, and which is useful to recreate blocks from other networks.

docs/src/content/hardhat-runner/docs/advanced/using-viem.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Use the `hre.viem` object to get these helpers, similar to how clients are used.
105105
const initialSupply = await myToken.read.getCurrentSupply();
106106
console.log(`Initial supply of MyToken: ${initialSupply}`);
107107

108-
await myToken.write.increaseSupply([500_000n]);
108+
const hash = await myToken.write.increaseSupply([500_000n]);
109109
// increaseSupply sends a tx, so we need to wait for it to be mined
110110
const publicClient = await hre.viem.getPublicClient();
111111
await publicClient.waitForTransactionReceipt({ hash });

docs/src/content/hardhat-runner/docs/config/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ The `solidity` config is an optional field that can be one of the following:
182182

183183
- `version`: The solc version to use.
184184

185-
- `settings`: An object with the same schema as the `settings` entry in the [Input JSON](https://solidity.readthedocs.io/en/v0.7.4/using-the-compiler.html#input-description).
185+
- `settings`: An object with the same schema as the `settings` entry in the [Input JSON](https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description).
186186

187187
- An object which describes multiple compilers and their respective configurations. It contains the following:
188188

docs/src/content/hardhat-runner/docs/getting-started/index.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ $ npx hardhat init
8585
? What do you want to do? …
8686
❯ Create a JavaScript project
8787
Create a TypeScript project
88+
Create a TypeScript project (with Viem)
8889
Create an empty hardhat.config.js
8990
Quit
9091
```
@@ -272,7 +273,7 @@ You can run it using `npx hardhat run`:
272273

273274
```
274275
$ npx hardhat run scripts/deploy.ts
275-
Lock with 1 ETH deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3
276+
Lock with 0.001ETH deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3
276277
```
277278

278279
:::
@@ -281,7 +282,7 @@ Lock with 1 ETH deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3
281282

282283
```
283284
$ npx hardhat run scripts/deploy.js
284-
Lock with 1 ETH deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3
285+
Lock with 0.001ETH deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3
285286
```
286287

287288
:::

docs/src/content/hardhat-runner/docs/guides/project-setup.md

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Welcome to Hardhat v{HARDHAT_VERSION}
8686
? What do you want to do? …
8787
▸ Create a JavaScript project
8888
Create a TypeScript project
89+
Create a TypeScript project (with Viem)
8990
Create an empty hardhat.config.js
9091
Quit
9192
```

docs/src/content/hardhat-runner/docs/other-guides/waffle-testing.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Welcome to Hardhat v{HARDHAT_VERSION}
3838
? What do you want to do? …
3939
▸ Create a JavaScript project
4040
Create a TypeScript project
41+
Create a TypeScript project (with Viem)
4142
Create an empty hardhat.config.js
4243
Quit
4344
```

docs/src/content/hardhat-runner/docs/reference/solidity-support.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ These are the versions of Solidity that you can expect to fully work with Hardha
1313
- Any 0.5.x version starting from 0.5.1
1414
- Any 0.6.x version
1515
- Any 0.7.x version
16-
- Any 0.8.x version up to and including 0.8.22
16+
- Any 0.8.x version up to and including 0.8.23
1717

1818
We recommend against using Hardhat with newer, unsupported versions of Solidity. But if you need to do so; please read on.
1919

docs/src/content/hardhat-runner/plugins/_dirinfo.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ order:
99
- "@nomicfoundation/hardhat-verify"
1010
- "@nomicfoundation/hardhat-foundry"
1111
- "@nomicfoundation/hardhat-ledger"
12+
- "@nomicfoundation/hardhat-web3-v4"
1213
- "@nomiclabs/hardhat-vyper"
1314
- "@nomiclabs/hardhat-solhint"
1415
- "@nomiclabs/hardhat-solpp"

docs/src/content/hardhat-runner/plugins/plugins.ts

+8
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,14 @@ const officialPlugins: IPlugin[] = [
962962
description: "Injects Web3 1.x into the Hardhat Runtime Environment",
963963
tags: ["Web3.js", "Testing", "Tasks", "Scripts"],
964964
},
965+
{
966+
name: "@nomicfoundation/hardhat-web3-v4",
967+
author: "ChainSafe and Nomic Foundation",
968+
npmPackage: "@nomicfoundation/hardhat-web3-v4",
969+
authorUrl: "https://twitter.com/ChainSafeth",
970+
description: "Injects Web3 4.x into the Hardhat Runtime Environment",
971+
tags: ["Web3.js", "Testing", "Tasks", "Scripts"],
972+
},
965973
{
966974
name: "@nomiclabs/hardhat-truffle5",
967975
author: "Nomic Foundation",

docs/src/content/ignition/docs/getting-started/index.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,36 @@ To install Hardhat Ignition in an existing Hardhat project, you will need:
3232

3333
You can also follow [Hardhat's Quick Start guide](../../../hardhat-runner/docs/getting-started/index.md) to create a new project from scratch to follow this guide.
3434

35+
:::tip
36+
37+
If you prefer to use **Viem** instead of **ethers**, check out the [Viem guide](../../../ignition/docs/guides/viem.md) for installation instructions.
38+
39+
:::
40+
3541
Once you have a Hardhat project ready, open a terminal in its root directory, and run:
3642

3743
::::tabsgroup{options="npm 7+,npm 6,yarn"}
3844

3945
:::tab{value="npm 7+"}
4046

4147
```sh
42-
npm install --save-dev @nomicfoundation/hardhat-ignition
48+
npm install --save-dev @nomicfoundation/hardhat-ignition-ethers
4349
```
4450

4551
:::
4652

4753
:::tab{value="npm 6"}
4854

4955
```sh
50-
npm install --save-dev @nomicfoundation/hardhat-ignition
56+
npm install --save-dev @nomicfoundation/hardhat-ignition-ethers @nomicfoundation/hardhat-ethers @nomicfoundation/hardhat-ignition @nomicfoundation/hardhat-verify @nomicfoundation/ignition-core ethers
5157
```
5258

5359
:::
5460

5561
:::tab{value=yarn}
5662

5763
```sh
58-
yarn add --dev @nomicfoundation/hardhat-ignition
64+
yarn add --dev @nomicfoundation/hardhat-ignition-ethers @nomicfoundation/hardhat-ethers @nomicfoundation/hardhat-ignition @nomicfoundation/hardhat-verify @nomicfoundation/ignition-core ethers
5965
```
6066

6167
:::
@@ -69,15 +75,15 @@ Finally, add this to your config file to [enable the plugin](../../../hardhat-ru
6975
:::tab{value="TypeScript"}
7076

7177
```typescript
72-
import "@nomicfoundation/hardhat-ignition";
78+
import "@nomicfoundation/hardhat-ignition-ethers";
7379
```
7480

7581
:::
7682

7783
:::tab{value="JavaScript"}
7884

7985
```javascript
80-
require("@nomicfoundation/hardhat-ignition");
86+
require("@nomicfoundation/hardhat-ignition-ethers");
8187
```
8288

8389
:::

0 commit comments

Comments
 (0)