You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: docs/docs/guides/smart_contracts/smart_contracts_guide.md
+5-17Lines changed: 5 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -164,7 +164,7 @@ In this step, we will set up Web3.js and Hardhat.
164
164
First, install the required packages with npm:
165
165
166
166
```bash
167
-
npm i web3 hardhat @nomicfoundation/hardhat-web3-v4
167
+
npm i web3 hardhat
168
168
```
169
169
170
170
Next, initialize the Hardhat project:
@@ -173,19 +173,7 @@ Next, initialize the Hardhat project:
173
173
npx hardhat init
174
174
```
175
175
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
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.
189
177
190
178
To start the Hardhat development network, execute the following command:
191
179
@@ -221,7 +209,7 @@ The Hardhat development network needs to remain running in the terminal that was
221
209
Next, create a new file called `index.js` in your project directory and add the following code to it:
222
210
223
211
```js
224
-
const { Web3 } = require("hardhat");
212
+
const { Web3 } = require("web3");
225
213
226
214
const web3 = new Web3("http://127.0.0.1:8545/");
227
215
@@ -261,7 +249,7 @@ In this step, we will use Web3.js to deploy the smart contract to the developmen
261
249
Create a file named `deploy.js` and fill it with the following code:
262
250
263
251
```js
264
-
const { Web3 } = require("hardhat");
252
+
const { Web3 } = require("web3");
265
253
const path = require("path");
266
254
const fs = require("fs");
267
255
@@ -330,7 +318,7 @@ In this step, we will use Web3.js to interact with the smart contract on the dev
330
318
Create a file named `interact.js` and fill it with the following code:
0 commit comments