@layerzerolabs/verify-contract 1.0.423 → 1.1.1

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 CHANGED
@@ -1,16 +1,81 @@
1
- # Verify-Contract
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
 
3
- ## Setup
4
- - Ensure you fill out the missing API keys inside your .env (copy the values from .env.example)
7
+ <h1 align="center">@layerzerolabs/verify-contract</h1>
5
8
 
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>
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ yarn add @layerzerolabs/verify-contract
25
+
26
+ pnpm add @layerzerolabs/verify-contract
27
+
28
+ npm install @layerzerolabs/verify-contract
29
+ ```
6
30
 
7
31
  ## Usage
8
32
 
9
- - Inside your deploy script:
33
+ ### CLI
34
+
35
+ This package comes with a CLI interface and registers an executable called `lz-verify-contract`:
36
+
37
+ ```bash
38
+ lz-verify-contract --help
39
+ ```
40
+
41
+ For now only `hardhat-deploy` verification is available:
42
+
43
+ ```bash
44
+ lz-verify-contract hardhat-deploy --help
45
+ ```
10
46
 
11
- ``const verify = require('@layerzerolabs/verify-contract')``
47
+ Using the CLI contracts can be verified one network at a time.
12
48
 
13
- ``await verify(hre.network.name, ["ContractName1", "ContractName2"])``
49
+ ### Programatic usage
14
50
 
51
+ For programmatic usage you can use the package exports:
15
52
 
53
+ ```typescript
54
+ import { verifyHardhatDeploy } from "@layerzerolabs/verify-contract";
16
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
+ ```