Skip to content

Commit 14c9044

Browse files
chore: add ZKsync OS verification url (#466)
adds verification url for ZKsync OS and updates the dev quickstart with verification steps
1 parent ba01e1f commit 14c9044

File tree

7 files changed

+102
-8
lines changed

7 files changed

+102
-8
lines changed

components/ZksyncEraNetworkDetails.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ const zksyncOSTestnetDetails: NetworkDetail[] = [
168168
},
169169
{
170170
property: 'Explorer Verification API',
171-
value: '(coming soon)',
172-
isCopyable: false,
171+
value: 'https://block-explorer-api.zksync-os-testnet-alpha.zksync.dev/api',
172+
isCopyable: true,
173173
},
174174
];
175175
</script>

content/00.zksync-network/65.zksync-os/_partials/_foundry.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ title: Foundry
66

77
```bash
88
forge init Counter
9+
```
10+
11+
```bash
912
cd Counter
1013
```
1114

@@ -24,13 +27,13 @@ title: Foundry
2427
1. Deploy the contract:
2528

2629
```bash
27-
forge script script/Counter.s.sol --rpc-url https://zksync-os-testnet-alpha.zksync.dev --broadcast --private-key $TESTNET_PRIVATE_KEY
30+
forge script script/Counter.s.sol --rpc-url https://zksync-os-testnet-alpha.zksync.dev --broadcast --skip-simulation --private-key $TESTNET_PRIVATE_KEY
2831
```
2932

3033
1. Set the number value:
3134

3235
```bash
33-
cast send 0xCA1386680bfd9D89c7cc6Fc3ba11938ba6E44fef \
36+
cast send 0x<YOUR_CONTRACT_ADDRESS> \
3437
"setNumber(uint256)" 5 \
3538
--rpc-url https://zksync-os-testnet-alpha.zksync.dev \
3639
--private-key $TESTNET_PRIVATE_KEY
@@ -39,7 +42,18 @@ title: Foundry
3942
1. Get the latest number value:
4043

4144
```bash
42-
cast call 0xCA1386680bfd9D89c7cc6Fc3ba11938ba6E44fef \
45+
cast call 0x<YOUR_CONTRACT_ADDRESS> \
4346
"number()" \
4447
--rpc-url https://zksync-os-testnet-alpha.zksync.dev
4548
```
49+
50+
1. Verify the contract:
51+
52+
```bash
53+
forge verify-contract \
54+
--chain-id 8022833 \
55+
--verifier custom \
56+
--verifier-url https://block-explorer-api.zksync-os-testnet-alpha.zksync.dev/api \
57+
0x<YOUR_CONTRACT_ADDRESS> \
58+
src/Counter.sol:Counter
59+
```

content/_partials/_zksyncos/_run-script.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,62 @@ title: Hardhat 3 Run Script
2323
```
2424

2525
::
26+
27+
9. Install the Hardhat verify SDK: <!-- markdownlint-disable-line -->
28+
29+
::code-group
30+
31+
```bash [npm]
32+
npm install --save-dev @nomicfoundation/hardhat-verify
33+
```
34+
35+
```bash [yarn]
36+
yarn add -D @nomicfoundation/hardhat-verify
37+
```
38+
39+
```bash [pnpm]
40+
pnpm add -D @nomicfoundation/hardhat-verify
41+
```
42+
43+
```bash [bun]
44+
bun add -D @nomicfoundation/hardhat-verify
45+
```
46+
47+
::
48+
49+
10. Add `hardhatVerify` to the hardhat plugins and configure the verification endpoint: <!-- markdownlint-disable-line -->
50+
51+
```ts [hardhat.config.ts]
52+
import hardhatVerify from "@nomicfoundation/hardhat-verify";
53+
54+
const config: HardhatUserConfig = {
55+
plugins: [
56+
hardhatVerify,
57+
// ...other plugins...
58+
],
59+
// ...other config...
60+
:code-import{filePath="zksync-os/hardhat.config.ts:verify-config"}
61+
};
62+
```
63+
64+
11. Use your deployed contract address to verify using `hardhat-verify`: <!-- markdownlint-disable-line -->
65+
66+
::code-group
67+
68+
```bash [npm]
69+
npx hardhat verify --network zksyncOS 0x<YOUR_CONTRACT_ADDRESS>
70+
```
71+
72+
```bash [yarn]
73+
yarn hardhat verify --network zksyncOS 0x<YOUR_CONTRACT_ADDRESS>
74+
```
75+
76+
```bash [pnpm]
77+
pnpm hardhat verify --network zksyncOS 0x<YOUR_CONTRACT_ADDRESS>
78+
```
79+
80+
```bash [bun]
81+
bun hardhat verify --network zksyncOS 0x<YOUR_CONTRACT_ADDRESS>
82+
```
83+
84+
::

content/_partials/_zksyncos/_setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Hardhat 3 Setup
44

55
3. Add ZKsync OS to the `hardhat.config.ts` file and configure the ignition required confirmations. <!-- markdownlint-disable-line -->
66

7-
```ts
7+
```ts [hardhat.config.ts]
88
:code-import{filePath="zksync-os/hardhat.config.ts:hh-config"}
99
```
1010

examples/zksync-os/bun.lock

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"@nomicfoundation/hardhat-ignition": "^3.0.3",
88
"@nomicfoundation/hardhat-toolbox-mocha-ethers": "^3.0.0",
99
"@nomicfoundation/hardhat-toolbox-viem": "^5.0.0",
10+
"@nomicfoundation/hardhat-verify": "^3.0.4",
1011
"@nomicfoundation/hardhat-viem": "^3.0.0",
1112
"@types/chai": "^4.3.20",
1213
"@types/chai-as-promised": "^8.0.2",
@@ -179,7 +180,7 @@
179180

180181
"@nomicfoundation/hardhat-utils": ["@nomicfoundation/[email protected]", "", { "dependencies": { "@streamparser/json-node": "^0.0.22", "debug": "^4.3.2", "env-paths": "^2.2.0", "ethereum-cryptography": "^2.2.1", "fast-equals": "^5.0.1", "json-stream-stringify": "^3.1.6", "rfdc": "^1.3.1", "undici": "^6.16.1" } }, "sha512-d/LYe9k9W56dimt6mY6SA1SjadSKKyHZC2S+0JsSFr4BjU4SHBDaM0cKWx44JdZqBdMjLWCiRBcVaIq3X8qTAA=="],
181182

182-
"@nomicfoundation/hardhat-verify": ["@nomicfoundation/[email protected].2", "", { "dependencies": { "@ethersproject/abi": "^5.8.0", "@nomicfoundation/hardhat-errors": "^3.0.2", "@nomicfoundation/hardhat-utils": "^3.0.1", "@nomicfoundation/hardhat-zod-utils": "^3.0.0", "cbor2": "^1.9.0", "chalk": "^5.3.0", "debug": "^4.3.2", "semver": "^7.6.3", "zod": "^3.23.8" }, "peerDependencies": { "hardhat": "^3.0.0" } }, "sha512-t+YykFxz2Zz/f8n1Fe0tGTDOTgaTbZDM+XgroIbx/Fwc5Rq9hIAWQLk0WVuDQx7bisMnUTzhsjEO00+4ExfTig=="],
183+
"@nomicfoundation/hardhat-verify": ["@nomicfoundation/[email protected].4", "", { "dependencies": { "@ethersproject/abi": "^5.8.0", "@nomicfoundation/hardhat-errors": "^3.0.3", "@nomicfoundation/hardhat-utils": "^3.0.3", "@nomicfoundation/hardhat-zod-utils": "^3.0.0", "cbor2": "^1.9.0", "chalk": "^5.3.0", "debug": "^4.3.2", "semver": "^7.6.3", "zod": "^3.23.8" }, "peerDependencies": { "hardhat": "^3.0.0" } }, "sha512-2EeteIxYL+teGDDm/NxMXmyiclAeg3XLAgGRL3CWCjEpxHX0xHa1sQOIsBkTs+DaVZnPCOY/s6/F+xvXgfoVyQ=="],
183184

184185
"@nomicfoundation/hardhat-viem": ["@nomicfoundation/[email protected]", "", { "dependencies": { "@nomicfoundation/hardhat-errors": "^3.0.0", "@nomicfoundation/hardhat-utils": "^3.0.0" }, "peerDependencies": { "hardhat": "^3.0.0", "viem": "^2.30.0" } }, "sha512-4QHBfTgJuo1O8vK9AO2AQYKsIp9yg06aF9C+WydDr2XS7VLJYh3g3gZdszLbSD9eHWsuviN688VKbcmfIZNWvQ=="],
185186

@@ -585,6 +586,10 @@
585586

586587
"@nomicfoundation/hardhat-keystore/@noble/hashes": ["@noble/[email protected]", "", {}, "sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ=="],
587588

589+
"@nomicfoundation/hardhat-verify/@nomicfoundation/hardhat-errors": ["@nomicfoundation/[email protected]", "", { "dependencies": { "@nomicfoundation/hardhat-utils": "^3.0.1" } }, "sha512-qvVIyNE5yXFdwCD7G74fb3j+p5PjYSej/K2mhOuJBhxdGwzARpyoJbcDZrjkNyabytlt95iniZLHHWM9jvVXEA=="],
590+
591+
"@nomicfoundation/hardhat-verify/@nomicfoundation/hardhat-utils": ["@nomicfoundation/[email protected]", "", { "dependencies": { "@streamparser/json-node": "^0.0.22", "debug": "^4.3.2", "env-paths": "^2.2.0", "ethereum-cryptography": "^2.2.1", "fast-equals": "^5.0.1", "json-stream-stringify": "^3.1.6", "rfdc": "^1.3.1", "undici": "^6.16.1" } }, "sha512-XNoDJshvGR3l8/oQdNoLPLlcv+P+mGZBLixCyuO8Q0wTIyH/1+KYI77E+yvgTyw+GG4UmldFw9R3Hmnemk3KCA=="],
592+
588593
"@scure/bip32/@noble/curves": ["@noble/[email protected]", "", { "dependencies": { "@noble/hashes": "1.8.0" } }, "sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA=="],
589594

590595
"@scure/bip32/@noble/hashes": ["@noble/[email protected]", "", {}, "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A=="],

examples/zksync-os/hardhat.config.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { HardhatUserConfig } from 'hardhat/config';
2+
import hardhatVerify from '@nomicfoundation/hardhat-verify';
23

34
import hardhatToolboxViemPlugin from '@nomicfoundation/hardhat-toolbox-viem';
45
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -7,7 +8,7 @@ import { configVariable } from 'hardhat/config';
78

89
const config: HardhatUserConfig = {
910
// plugins: [hardhatToolboxMochaEthersPlugin],
10-
plugins: [hardhatToolboxViemPlugin],
11+
plugins: [hardhatToolboxViemPlugin, hardhatVerify],
1112
solidity: {
1213
profiles: {
1314
default: {
@@ -37,6 +38,20 @@ const config: HardhatUserConfig = {
3738
},
3839
},
3940
// ANCHOR_END: hh-config
41+
// ANCHOR: verify-config
42+
chainDescriptors: {
43+
8022833: {
44+
name: 'zksyncOS',
45+
blockExplorers: {
46+
blockscout: {
47+
name: 'Testnet Explorer',
48+
url: 'https://zksync-os-testnet-alpha.staging-scan-v2.zksync.dev',
49+
apiUrl: 'https://block-explorer-api.zksync-os-testnet-alpha.zksync.dev/api',
50+
},
51+
},
52+
},
53+
},
54+
// ANCHOR_END: verify-config
4055
};
4156

4257
export default config;

examples/zksync-os/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@nomicfoundation/hardhat-ignition": "^3.0.3",
1313
"@nomicfoundation/hardhat-toolbox-mocha-ethers": "^3.0.0",
1414
"@nomicfoundation/hardhat-toolbox-viem": "^5.0.0",
15+
"@nomicfoundation/hardhat-verify": "^3.0.4",
1516
"@nomicfoundation/hardhat-viem": "^3.0.0",
1617
"@types/chai": "^4.3.20",
1718
"@types/chai-as-promised": "^8.0.2",

0 commit comments

Comments
 (0)