Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit b01d5f9

Browse files
author
Dan Forbes
authored
Simplify Contracts Tutorial by Removing Use of Hardhat Plugin (#7084)
1 parent 7af8090 commit b01d5f9

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

docs/docs/guides/smart_contracts/smart_contracts_guide.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ In this step, we will set up Web3.js and Hardhat.
164164
First, install the required packages with npm:
165165

166166
```bash
167-
npm i web3 hardhat @nomicfoundation/hardhat-web3-v4
167+
npm i web3 hardhat
168168
```
169169

170170
Next, initialize the Hardhat project:
@@ -173,19 +173,7 @@ Next, initialize the Hardhat project:
173173
npx hardhat init
174174
```
175175

176-
Initializing the Hardhat project will require responding to several prompts - select the default option for each prompt.
177-
178-
After you initialize the Hardhat project, a number of new files and directories will be created, including a Hardhat configuration file called `hardhat.config.js`. Edit `hardhat.config.js` to include the [Web3.js plugin for Hardhat](https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-web3-v4).
179-
180-
```js
181-
require("@nomicfoundation/hardhat-toolbox");
182-
require("@nomicfoundation/hardhat-web3-v4"); // <=== add this import
183-
184-
/** @type import('hardhat/config').HardhatUserConfig */
185-
module.exports = {
186-
solidity: "0.8.24",
187-
};
188-
```
176+
Initializing the Hardhat project will require responding to several prompts - select the default option for each prompt. After you initialize the Hardhat project, a number of new files and directories will be created.
189177

190178
To start the Hardhat development network, execute the following command:
191179

@@ -221,7 +209,7 @@ The Hardhat development network needs to remain running in the terminal that was
221209
Next, create a new file called `index.js` in your project directory and add the following code to it:
222210

223211
```js
224-
const { Web3 } = require("hardhat");
212+
const { Web3 } = require("web3");
225213

226214
const web3 = new Web3("http://127.0.0.1:8545/");
227215

@@ -261,7 +249,7 @@ In this step, we will use Web3.js to deploy the smart contract to the developmen
261249
Create a file named `deploy.js` and fill it with the following code:
262250

263251
```js
264-
const { Web3 } = require("hardhat");
252+
const { Web3 } = require("web3");
265253
const path = require("path");
266254
const fs = require("fs");
267255

@@ -330,7 +318,7 @@ In this step, we will use Web3.js to interact with the smart contract on the dev
330318
Create a file named `interact.js` and fill it with the following code:
331319

332320
```js
333-
const { Web3 } = require("hardhat");
321+
const { Web3 } = require("web3");
334322
const path = require("path");
335323
const fs = require("fs");
336324

0 commit comments

Comments
 (0)