@@ -179,7 +179,7 @@ Note that we are installing the latest version of 4.x, at the time of this tutor
179
179
Next, create a new file called ` index.js ` in your project directory and add the following code to it:
180
180
181
181
``` javascript
182
- const { Web3 } = require (' web3' ); // web3.js has native ESM builds and (`import { Web3 } from 'web3'`)
182
+ const { Web3 } = require (' web3' ); // web3.js has native ESM builds and (`import Web3 from 'web3'`)
183
183
184
184
// Set up a connection to the Ganache network
185
185
const web3 = new Web3 (new Web3.providers.HttpProvider (' http://localhost:7545' ));
@@ -214,7 +214,7 @@ Create a file named `deploy.js` and fill it with the following code:
214
214
``` javascript
215
215
// For simplicity we use `web3` package here. However, if you are concerned with the size,
216
216
// you may import individual packages like 'web3-eth', 'web3-eth-contract' and 'web3-providers-http'.
217
- const { Web3 } = require (' web3' ); // web3.js has native ESM builds and (`import { Web3 } from 'web3'`)
217
+ const { Web3 } = require (' web3' ); // web3.js has native ESM builds and (`import Web3 from 'web3'`)
218
218
const fs = require (' fs' );
219
219
const path = require (' path' );
220
220
@@ -289,7 +289,7 @@ In this step, we will use web3.js to interact with the smart contract on the Gan
289
289
Create a file named ` interact.js ` and fill it with the following code:
290
290
291
291
``` javascript
292
- const { Web3 } = require (' web3' ); // web3.js has native ESM builds and (`import { Web3 } from 'web3'`)
292
+ const { Web3 } = require (' web3' ); // web3.js has native ESM builds and (`import Web3 from 'web3'`)
293
293
const fs = require (' fs' );
294
294
const path = require (' path' );
295
295
0 commit comments