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
@@ -178,6 +178,7 @@ Run the command, hardhat will compile all test files in directory of `tests`, th
178
178
179
179
```sh
180
180
npx hardhat test
181
+
#test network no need assign --network <network name>
181
182
```
182
183
183
184
you could also specify some test files to run it
@@ -197,7 +198,10 @@ npx hardhat run ./scripts/deploy.js
197
198
Run the specified network, such as the contract deployed on goerli test network(make sure that the wallet could pay the gas)
198
199
199
200
```sh
200
-
npx hardhat run ./scripts/deploy.js --network goerli
201
+
npx hardhat run ./scripts/deploy.js --network sepolia
202
+
203
+
204
+
#Please remember the "deploy address" returned after running here, which will be used by verify in Sepolia network verification below
201
205
```
202
206
203
207
### Verify
@@ -207,15 +211,25 @@ Verify the smart contract, here is an example of `goerli`.
207
211
Add the following configuration to `hardhat.config.js`:
208
212
209
213
```js
210
-
etherscan: {
211
-
apiKey: "<etherscan的api key>",
214
+
etherscan: {
215
+
apiKey: "<etherscan的api key>", //Use process.env.APIKEY Get Variables
212
216
}
213
217
```
218
+
https://etherscan.io/myapikey Create an account on the official website. After logging in, go to My Account (the actual name of the account you created) ->API Key
219
+
220
+
Ensure configuration in hardhat.config.js
221
+
222
+
Require ("@nomofoundation/hardhat-verify");
223
+
224
+
And the above module npm install --savedev @nomicfoundation/hardhat-verify has been installed
##The data in arguments SimpleToken.js are the parameters set during the construction of the SimpleToken contract when running the deploy. js script on line 207
219
233
```
220
234
221
235
### Task
@@ -316,15 +330,15 @@ Changing greeting from 'Hello, world!' to 'hello Dapp-Learning!'
316
330
npx hardhat run scripts/deploy.js --network <network-name>
317
331
```
318
332
319
-
`network-name` should be replaced with your networks, `goerli` is a choice which exists in the config file.
333
+
`network-name` should be replaced with your networks, `sepolia` is a choice which exists in the config file.
`network-name`: the name of the network you specify, here you can replace it with `goerli`, which corresponds to the network name in the configuration file.
341
+
`network-name`: the name of the network you specify, here you can replace it with `sepolia`, which corresponds to the network name in the configuration file.
328
342
329
343
`contract-address`: The address of the contract deployed in the previous step.
0 commit comments