@layerzerolabs/verify-contract 1.0.422 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -5
- package/cli/index.js +20 -0
- package/dist/index.d.mts +24 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +25046 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +25034 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +40 -4
- package/.env.example +0 -26
- package/constants/blockExplorerApi.json +0 -30
- package/index.js +0 -185
package/README.md
CHANGED
|
@@ -1,16 +1,81 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://layerzero.network">
|
|
3
|
+
<img alt="LayerZero" style="max-width: 500px" src="https://d3a2dpnnrypp5h.cloudfront.net/bridge-app/lz.png"/>
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
2
6
|
|
|
7
|
+
<h1 align="center">@layerzerolabs/verify-contract</h1>
|
|
3
8
|
|
|
4
|
-
|
|
9
|
+
<!-- The badges section -->
|
|
10
|
+
<p align="center">
|
|
11
|
+
<!-- Shields.io NPM published package version -->
|
|
12
|
+
<a href="https://www.npmjs.com/package/@layerzerolabs/verify-contract"><img alt="NPM Version" src="https://img.shields.io/npm/v/@layerzerolabs/verify-contract"/></a>
|
|
13
|
+
<!-- Shields.io NPM downloads -->
|
|
14
|
+
<a href="https://www.npmjs.com/package/@layerzerolabs/verify-contract"><img alt="Downloads" src="https://img.shields.io/npm/dm/@layerzerolabs/verify-contract"/></a>
|
|
15
|
+
<!-- Shields.io vulnerabilities -->
|
|
16
|
+
<a href="https://www.npmjs.com/package/@layerzerolabs/verify-contract"><img alt="Snyk Vulnerabilities for npm package version" src="https://img.shields.io/snyk/vulnerabilities/npm/@layerzerolabs/verify-contract"/></a>
|
|
17
|
+
<!-- Shields.io license badge -->
|
|
18
|
+
<a href="https://www.npmjs.com/package/@layerzerolabs/verify-contract"><img alt="NPM License" src="https://img.shields.io/npm/l/@layerzerolabs/verify-contract"/></a>
|
|
19
|
+
</p>
|
|
5
20
|
|
|
21
|
+
## Installation
|
|
6
22
|
|
|
23
|
+
```bash
|
|
24
|
+
yarn add @layerzerolabs/verify-contract
|
|
7
25
|
|
|
26
|
+
pnpm add @layerzerolabs/verify-contract
|
|
8
27
|
|
|
9
|
-
|
|
28
|
+
npm install @layerzerolabs/verify-contract
|
|
29
|
+
```
|
|
10
30
|
|
|
11
|
-
|
|
31
|
+
## Usage
|
|
12
32
|
|
|
13
|
-
|
|
33
|
+
### CLI
|
|
14
34
|
|
|
35
|
+
This package comes with a CLI interface and registers an executable called `lz-verify-contract`:
|
|
15
36
|
|
|
37
|
+
```bash
|
|
38
|
+
lz-verify-contract --help
|
|
39
|
+
```
|
|
16
40
|
|
|
41
|
+
For now only `hardhat-deploy` verification is available:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
lz-verify-contract hardhat-deploy --help
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Using the CLI contracts can be verified one network at a time.
|
|
48
|
+
|
|
49
|
+
### Programatic usage
|
|
50
|
+
|
|
51
|
+
For programmatic usage you can use the package exports:
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import { verifyHardhatDeploy } from "@layerzerolabs/verify-contract";
|
|
55
|
+
|
|
56
|
+
// Programmatic usage allows for more fine-grained and multi-network verification
|
|
57
|
+
verifyHardhatDeploy({
|
|
58
|
+
paths: {
|
|
59
|
+
deployments: "./my/little/deployments/folder",
|
|
60
|
+
},
|
|
61
|
+
networks: {
|
|
62
|
+
whatachain: {
|
|
63
|
+
apiUrl: "https://api.whatachain.io/api",
|
|
64
|
+
apiKey: "david.hasselhoff.1234",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
// The verify option allows you to limit the scope of verification to
|
|
68
|
+
// specific contracts
|
|
69
|
+
//
|
|
70
|
+
// It supports several ways of scoping the verification:
|
|
71
|
+
//
|
|
72
|
+
// A list of case-sensitive contract names
|
|
73
|
+
verify: ["Factory", "Router"],
|
|
74
|
+
// A single contract name
|
|
75
|
+
verify: "ONFT1155",
|
|
76
|
+
// Boolean to toggle the verification as a whole
|
|
77
|
+
verify: false,
|
|
78
|
+
// A function that gets passed the contract name and an relative contract path and returns a boolean to signify the contract needs to be verified
|
|
79
|
+
verify: (name, path) => name.startsWith("Potato721"),
|
|
80
|
+
});
|
|
81
|
+
```
|