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
The following changes have been applied:
* small textual changes
* reordered the guides - verifying a contract after deploying a contract
makes sense, but I think verifying a deployment makes more sense as
the last thing you do with Ignition (after visualizing and tests)
* remove infura as a mentioned option due to NomicFoundation/hardhat-ignition#633
* renamed to `Verifying your deployment`
Copy file name to clipboardexpand all lines: docs/src/content/ignition/docs/guides/verify.md
+28-24
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
-
# Verifying your contracts
1
+
# Verifying your deployment
2
2
3
-
Once your module has been deployed to a live network, the next step is to verify its source code.
3
+
Once your Ignition module is tested and ready, the next step is to deploy it to a live network and verify the source code of each of its contracts.
4
4
5
5
Verifying a contract means making its source code public, along with the compiler settings you used, which allows anyone to compile it and compare the generated bytecode with the one that is deployed on-chain. Doing this is extremely important in an open platform like Ethereum.
6
6
7
-
In this guide we'll explain how to do this with Hardhat Ignition in the [Etherscan](https://etherscan.io/) explorer.
7
+
In this guide we'll explain how to do this with the [Etherscan](https://etherscan.io/) explorer.
8
8
9
9
## Getting an API key from Etherscan
10
10
11
-
The first thing you need is an API key from Etherscan. To get one, go to [their site](https://etherscan.io/login), sign in (or create an account if you don't have one) and open the "API Keys" tab. Then click the "Add" button and give a name (like "Hardhat") to the API key you are creating. After that you'll see the newly created key in the list.
11
+
The first thing you need is an API key from Etherscan. To get one, go to [their site](https://etherscan.io/login), sign in (or create an account if you don't have one) and open the "API Keys" tab. Then click the "Add" button and give a name to the API key you are creating (e.g. "Hardhat"). After that you'll see the newly created key in the list.
12
12
13
13
Open your Hardhat config and add the API key you just created:
14
14
@@ -42,28 +42,29 @@ module.exports = {
42
42
43
43
::::
44
44
45
-
## Deploying and verifying a contract in the Sepolia testnet
45
+
## Deploying and verifying on the Sepolia testnet
46
46
47
-
We are going to use the [Sepolia testnet](https://ethereum.org/en/developers/docs/networks/#sepolia) to deploy and verify our contract, so you need to add this network in your Hardhat config. Here we are using [Alchemy](https://alchemy.com/) to connect to the network, but you can use an alternative JSON-RPC URL like [Infura](https://infura.io/) if you want.
47
+
We are going to use the [Sepolia testnet](https://ethereum.org/en/developers/docs/networks/#sepolia) to deploy and verify our Ignition module, so you need to add this network in your Hardhat config. Here we are using [Alchemy](https://alchemy.com/) to connect to the network.
48
48
49
-
::::tabsgroup{options=Alchemy,Infura}
49
+
::::tabsgroup{options=TypeScript,JavaScript}
50
50
51
-
:::tab{value=Alchemy}
51
+
:::tab{value=TypeScript}
52
52
53
-
```js
53
+
```ts
54
54
// Go to https://alchemy.com, sign up, create a new App in
55
-
// its dashboard, and replace "KEY" with its key
56
-
constALCHEMY_API_KEY="KEY";
55
+
// its dashboard, and set the Hardhat configuration variable
@@ -112,7 +114,7 @@ To deploy on Sepolia you need to send some Sepolia ether to the address that's g
112
114
113
115
:::tip
114
116
115
-
This guide assumes you are using the contracts and deployment module from the [quick start guide](/ignition/docs/getting-started#quick-start), but the steps are the same for any contract.
117
+
This guide assumes you are using the contracts and Ignition module from the [quick start guide](/ignition/docs/getting-started#quick-start), but the steps are the same for any deployment.
The `--verify` flag is optional, but it tells Hardhat Ignition to verify the contracts immediately after finishing the deployment. If you have an existing deployment and want to verify it, you can also run the `verify` task directly using the deployment ID:
152
+
The `--verify` flag is optional, but it tells Hardhat Ignition to verify the contracts after a successful deployment.
153
+
154
+
If you have an existing deployment and want to verify it, you can also run the `verify` task directly by passing the deployment ID:
151
155
152
156
```sh
153
157
npx hardhat ignition verify chain-11155111
@@ -159,6 +163,6 @@ If you get an error saying that the address does not have bytecode, it probably
159
163
160
164
:::
161
165
162
-
After the task is successfully executed, you'll see a link to the publicly verified code of your contract.
166
+
After the task has successfully executed, for each deployed contract you'll see a link to its publicly verified code.
163
167
164
168
To learn more about verifying, read the [hardhat-verify](/hardhat-runner/plugins/nomicfoundation-hardhat-verify) documentation.
0 commit comments