Skip to content

Commit c1dd8af

Browse files
authored
Merge pull request #7139 from NomicFoundation/hardhat-3-readmes
Update readmes
2 parents 0402362 + 1efc238 commit c1dd8af

File tree

24 files changed

+602
-396
lines changed

24 files changed

+602
-396
lines changed

README.md

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,31 @@
1-
![](https://user-images.githubusercontent.com/176499/96893278-ebc67580-1460-11eb-9530-d5df3a3d65d0.png) [![NPM Package](https://img.shields.io/npm/v/hardhat.svg?style=flat-square)](https://www.npmjs.org/package/hardhat) [![GitPOAP Badge](https://public-api.gitpoap.io/v1/repo/NomicFoundation/hardhat/badge)](https://www.gitpoap.io/gh/NomicFoundation/hardhat)
1+
![](https://user-images.githubusercontent.com/176499/96893278-ebc67580-1460-11eb-9530-d5df3a3d65d0.png)
22

3-
---
4-
5-
Hardhat is an Ethereum development environment for professionals. It facilitates performing frequent tasks, such as running tests, automatically checking code for mistakes or interacting with a smart contract. Check out the [plugin list](https://hardhat.org/plugins/) to use it with your existing tools.
3+
Hardhat is an Ethereum development environment for professionals. It facilitates performing frequent tasks, such as running tests, automatically checking code for mistakes or interacting with smart contracts.
64

75
Built by the [Nomic Foundation](https://nomic.foundation/) for the Ethereum community.
86

9-
Join our [Hardhat Support Discord server](https://hardhat.org/discord) to stay up to date on new releases, plugins and tutorials.
10-
117
---
128

13-
> 💡 **The Nomic Foundation is hiring! Check [our open positions](https://www.nomic.foundation/jobs?utm_source=myALpQnzlM).**
9+
> 💡 This is the README for Hardhat 3, the new major version of Hardhat. For the previous version (v2), see [this branch](https://github.com/NomicFoundation/hardhat/tree/v2) instead.
1410
1511
---
1612

17-
## Installation
13+
## Getting started
1814

19-
To install Hardhat, go to an empty folder, initialize an `npm` project (i.e. `npm init`), and run
15+
To install Hardhat and initialize a new project, run the following command in an empty directory:
2016

21-
```
22-
npm install --save-dev hardhat
17+
```bash
18+
npx hardhat --init
2319
```
2420

25-
Once it's installed, just run this command and follow its instructions:
26-
27-
```
28-
npx hardhat init
29-
```
21+
This will take you through an interactive setup process to get started.
3022

31-
## Documentation
23+
## Learn more
3224

33-
On [Hardhat's website](https://hardhat.org) you will find:
34-
35-
- [Guides to get started](https://hardhat.org/getting-started/)
36-
- [Hardhat Network](https://hardhat.org/hardhat-network/)
37-
- [Plugin list](https://hardhat.org/plugins/)
25+
To learn more about Hardhat, check out the [documentation](https://hardhat.org/docs/).
3826

3927
## Contributing
4028

4129
Contributions are always welcome! Feel free to open any issue or send a pull request.
4230

43-
Go to [CONTRIBUTING.md](https://github.com/NomicFoundation/hardhat/blob/main/CONTRIBUTING.md) to learn about how to set up Hardhat's development environment.
44-
45-
## Feedback, help and news
46-
47-
[Hardhat Support Discord server](https://hardhat.org/discord): for questions and feedback.
48-
49-
[Follow Hardhat on Twitter.](https://twitter.com/HardhatHQ)
50-
51-
## Happy building!
52-
53-
👷‍♀️👷‍♂️👷‍♀️👷‍♂️👷‍♀️👷‍♂️👷‍♀️👷‍♂️👷‍♀️👷‍♂️👷‍♀️👷‍♂️👷‍♀️👷‍♂️
31+
Go to [CONTRIBUTING.md](https://github.com/NomicFoundation/hardhat/blob/main/CONTRIBUTING.md) to learn about how to set up Hardhat's development environment.

v-next/hardhat-errors/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Hardhat errors
1+
# hardhat-errors
2+
3+
> ⚠️ This package is an internal Hardhat component and it's not meant to be used directly.
24
35
This packages has the definition of the error classes used by Hardhat, and the list of possible errors.
46

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,41 @@
1-
# Hardhat Ethers Chai Matchers plugin
1+
# hardhat-ethers-chai-matchers
22

33
This plugin adds Ethereum-specific matchers to the [Chai](https://chaijs.com/) assertion library that integrate with [ethers.js](https://ethers.org/), making your smart contract tests easy to write and read.
44

55
## Installation
66

7+
> This plugin is part of the [Ethers+Mocha Hardhat Toolbox](/v-next/hardhat-toolbox-mocha-ethers/). If you are using that toolbox, there's nothing else you need to do.
8+
79
To install this plugin, run the following command:
810

911
```bash
10-
npm install --save-dev @nomicfoundation/hardhat-ethers-chai-matchers@next
12+
npm install --save-dev @nomicfoundation/hardhat-ethers-chai-matchers
1113
```
1214

13-
and add the following statements to your `hardhat.config.ts` file:
14-
15-
```typescript
16-
// ...
17-
import ethersChaiMatchersPlugin from "@nomicfoundation/hardhat-ethers-chai-matchers";
15+
In your `hardhat.config.ts` file, import the plugin and add it to the `plugins` array:
1816

19-
// ...
17+
```ts
18+
import hardhatEthersChaiMatchers from "@nomicfoundation/hardhat-ethers-chai-matchers";
2019

2120
export default {
22-
// ...
23-
plugins: [
24-
// ...
25-
ethersChaiMatchersPlugin,
26-
],
27-
28-
// ...
21+
plugins: [hardhatEthersChaiMatchers],
2922
};
3023
```
3124

3225
## Usage
3326

3427
You don't need to do anything else to use this plugin. Whenever you run your tests with Hardhat, it will automatically add the matchers.
3528

36-
Here is an example of using the `changeEtherBalances` matcher:
29+
Here is an example of using the `emit` matcher:
3730

3831
```ts
3932
import { expect } from "chai";
4033

41-
// ...
42-
// ...
43-
44-
const amount = ethers.utils.parseEther("1");
34+
it("some test", async function () {
35+
const contract = await ethers.deployContract("SomeContract");
4536

46-
await expect(() =>
47-
sender.sendTransaction({
48-
to: contract,
49-
value: AMOUNT,
50-
}),
51-
).to.changeEtherBalances(provider, [sender, contract], [-AMOUNT, AMOUNT]);
37+
await expect(contract.someFunction())
38+
.to.emit(contract, "SomeEvent")
39+
.withArgs("0x...", 3);
40+
});
5241
```

0 commit comments

Comments
 (0)