Skip to content

Commit bf6257b

Browse files
committed
Add tooling for Lens verification
1 parent 64b1a43 commit bf6257b

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ export ETHERSCAN_API_KEY=<Your Key>
8787
yarn verify:etherscan --network $NETWORK
8888
```
8989

90+
Single contracts can be verified as well, but the constructor arguments must be explicitly given to the command.
91+
A common example is the vault relayer contract, which is not automatically verified with the command above since it is only deployed indirectly during initialization. This contract can be manually verified with:
92+
93+
```sh
94+
npx hardhat verify --network $NETWORK 0xC92E8bdf79f0507f65a392b0ab4667716BFE0110 0xBA12222222228d8Ba445958a75a0704d566BF2C8
95+
```
96+
97+
The first address is the vault relayer address, the second is the deployment input (usually, the Balancer vault).
98+
9099
#### Tenderly
91100

92101
For verifying all deployed contracts:

hardhat.config.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import "hardhat-deploy";
33
import "hardhat-gas-reporter";
44
import "solidity-coverage";
55
import "@tenderly/hardhat-tenderly";
6+
import "@nomicfoundation/hardhat-verify";
67

78
import dotenv from "dotenv";
89
import type { HttpNetworkUserConfig } from "hardhat/types";
@@ -104,6 +105,10 @@ export default {
104105
...sharedNetworkConfig,
105106
url: "https://xdai.poanetwork.dev",
106107
},
108+
lens: {
109+
...sharedNetworkConfig,
110+
url: "https://rpc.lens.xyz",
111+
},
107112
},
108113
namedAccounts: {
109114
// Note: accounts defined by a number refer to the the accounts as configured
@@ -120,6 +125,25 @@ export default {
120125
hardhat: 2,
121126
},
122127
},
128+
etherscan: {
129+
apiKey: {
130+
lens: "unneeded",
131+
},
132+
customChains: [
133+
{
134+
network: "lens",
135+
chainId: 232,
136+
urls: {
137+
apiURL:
138+
"https://api-explorer-verify.lens.matterhosted.dev/contract_verification",
139+
browserURL: "https://explorer.lens.xyz/",
140+
},
141+
},
142+
],
143+
},
144+
sourcify: {
145+
enabled: true,
146+
},
123147
gasReporter: {
124148
enabled: REPORT_GAS ? true : false,
125149
currency: "USD",

0 commit comments

Comments
 (0)