@layerzerolabs/verify-contract 1.1.1 → 1.1.4

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
@@ -48,13 +48,18 @@ Using the CLI contracts can be verified one network at a time.
48
48
 
49
49
  ### Programatic usage
50
50
 
51
- For programmatic usage you can use the package exports:
51
+ The package provides two types of verification for hardhat deploy: _target_ and _non-target_.
52
+
53
+ #### Target verification
54
+
55
+ This is suitable for verifying contracts that have been the compilation targets for a deployment, i.e. they have their own deployment file.
56
+ This is the default and easiest case for which we know all the information we need from the deployment file.
52
57
 
53
58
  ```typescript
54
- import { verifyHardhatDeploy } from "@layerzerolabs/verify-contract";
59
+ import { verifyHardhatDeployTarget } from "@layerzerolabs/verify-contract";
55
60
 
56
61
  // Programmatic usage allows for more fine-grained and multi-network verification
57
- verifyHardhatDeploy({
62
+ verifyHardhatDeployTarget({
58
63
  paths: {
59
64
  deployments: "./my/little/deployments/folder",
60
65
  },
@@ -64,18 +69,84 @@ verifyHardhatDeploy({
64
69
  apiKey: "david.hasselhoff.1234",
65
70
  },
66
71
  },
67
- // The verify option allows you to limit the scope of verification to
72
+ // The filter option allows you to limit the scope of verification to
68
73
  // specific contracts
69
74
  //
70
75
  // It supports several ways of scoping the verification:
71
76
  //
72
77
  // A list of case-sensitive contract names
73
- verify: ["Factory", "Router"],
78
+ filter: ["Factory", "Router"],
74
79
  // A single contract name
75
- verify: "ONFT1155",
80
+ filter: "ONFT1155",
76
81
  // Boolean to toggle the verification as a whole
77
- verify: false,
82
+ filter: false,
78
83
  // 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"),
84
+ filter: (name, path) => name.startsWith("Potato721"),
85
+ });
86
+ ```
87
+
88
+ #### Non-target verification
89
+
90
+ This is suitable for verifying contracts that have been e.g. deployed dynamically from other contracts within the deployment.
91
+
92
+ In this case we need to know more information - the specific deployment file to use, the address of the contract and also its constructor arguments.
93
+
94
+ ```typescript
95
+ import { verifyHardhatDeployNonTarget } from "@layerzerolabs/verify-contract";
96
+
97
+ // Programmatic usage allows for more fine-grained and multi-network verification
98
+ verifyHardhatDeployNonTarget({
99
+ paths: {
100
+ deployments: "./my/little/deployments/folder",
101
+ },
102
+ networks: {
103
+ whatachain: {
104
+ apiUrl: "https://api.whatachain.io/api",
105
+ apiKey: "david.hasselhoff.1234",
106
+ },
107
+ },
108
+ // The contracts array is used to pass the contract details
109
+ contracts: [
110
+ {
111
+ address: "0x0",
112
+ network: "whatachain",
113
+ // We'll need to pass the name of the deployment file to use (relative to the deployments path)
114
+ deployment: "OtherContract.json",
115
+ constructorArguments: [1000, "0x0"],
116
+ // In this case we'll need to pass a fully-qualified contract name
117
+ contractName: "contracts/examples/Pool.sol",
118
+ },
119
+ ],
80
120
  });
81
121
  ```
122
+
123
+ ### Default configuration
124
+
125
+ The package is preconfigured for scan API URLs for several well-known networks:
126
+
127
+ | Network | API URL |
128
+ | -------------------------------------------------------------- | ------------------------------------------------ |
129
+ | `avalanche`, `avalanche-mainnet` | `https://api.snowtrace.io/api` |
130
+ | `fuji`, `avalanche-testnet` | `https://api-testnet.snowtrace.io/api` |
131
+ | `bsc` | `https://api.bscscan.com/api` |
132
+ | `bsc-testnet` | `https://api-testnet.bscscan.com/api` |
133
+ | `ethereum` | `https://api.etherscan.io/api` |
134
+ | `ethereum-goerli` | `https://api-goerli.etherscan.io/api` |
135
+ | `goerli` | `https://api-goerli.etherscan.io/api` |
136
+ | `fantom` | `https://api.ftmscan.com/api` |
137
+ | `fantom-testnet` | `https://api-testnet.ftmscan.com/api` |
138
+ | `arbitrum` | `https://api.arbiscan.io/api` |
139
+ | `arbitrum-goerli` | `https://api-goerli.arbiscan.io/api` |
140
+ | `polygon` | `https://api.polygonscan.com/api` |
141
+ | `mumbai` | `https://api-testnet.polygonscan.com/api` |
142
+ | `optimism` | `https://api-optimistic.etherscan.io/api` |
143
+ | `optimism-goerli` | `https://api-goerli-optimistic.etherscan.io/api` |
144
+ | `gnosis` | `https://api.gnosisscan.io/api` |
145
+ | `zkpolygon`, `zkpolygon-mainnet` | `https://api-zkevm.polygonscan.com/api` |
146
+ | `base`, `base-mainnet` | `https://api.basescan.org/api` |
147
+ | `base-goerli` | `https://api-goerli.basescan.org/api` |
148
+ | `zkconsensys`, `zkconsensys-mainnet`, `linea`, `linea-mainnet` | `https://api.lineascan.build/api` |
149
+ | `moonbeam` | `https://api-moonbeam.moonscan.io/api` |
150
+ | `moonbeam-testnet` | `https://api-moonbase.moonscan.io/api` |
151
+ | `kava`, `kava-mainnet` | `https://kavascan.com/api` |
152
+ | `kava-testnet` | `https://testnet.kavascan.com/api` |
@@ -0,0 +1,249 @@
1
+ T__0=1
2
+ T__1=2
3
+ T__2=3
4
+ T__3=4
5
+ T__4=5
6
+ T__5=6
7
+ T__6=7
8
+ T__7=8
9
+ T__8=9
10
+ T__9=10
11
+ T__10=11
12
+ T__11=12
13
+ T__12=13
14
+ T__13=14
15
+ T__14=15
16
+ T__15=16
17
+ T__16=17
18
+ T__17=18
19
+ T__18=19
20
+ T__19=20
21
+ T__20=21
22
+ T__21=22
23
+ T__22=23
24
+ T__23=24
25
+ T__24=25
26
+ T__25=26
27
+ T__26=27
28
+ T__27=28
29
+ T__28=29
30
+ T__29=30
31
+ T__30=31
32
+ T__31=32
33
+ T__32=33
34
+ T__33=34
35
+ T__34=35
36
+ T__35=36
37
+ T__36=37
38
+ T__37=38
39
+ T__38=39
40
+ T__39=40
41
+ T__40=41
42
+ T__41=42
43
+ T__42=43
44
+ T__43=44
45
+ T__44=45
46
+ T__45=46
47
+ T__46=47
48
+ T__47=48
49
+ T__48=49
50
+ T__49=50
51
+ T__50=51
52
+ T__51=52
53
+ T__52=53
54
+ T__53=54
55
+ T__54=55
56
+ T__55=56
57
+ T__56=57
58
+ T__57=58
59
+ T__58=59
60
+ T__59=60
61
+ T__60=61
62
+ T__61=62
63
+ T__62=63
64
+ T__63=64
65
+ T__64=65
66
+ T__65=66
67
+ T__66=67
68
+ T__67=68
69
+ T__68=69
70
+ T__69=70
71
+ T__70=71
72
+ T__71=72
73
+ T__72=73
74
+ T__73=74
75
+ T__74=75
76
+ T__75=76
77
+ T__76=77
78
+ T__77=78
79
+ T__78=79
80
+ T__79=80
81
+ T__80=81
82
+ T__81=82
83
+ T__82=83
84
+ T__83=84
85
+ T__84=85
86
+ T__85=86
87
+ T__86=87
88
+ T__87=88
89
+ T__88=89
90
+ T__89=90
91
+ T__90=91
92
+ T__91=92
93
+ T__92=93
94
+ T__93=94
95
+ T__94=95
96
+ T__95=96
97
+ Int=97
98
+ Uint=98
99
+ Byte=99
100
+ Fixed=100
101
+ Ufixed=101
102
+ BooleanLiteral=102
103
+ DecimalNumber=103
104
+ HexNumber=104
105
+ NumberUnit=105
106
+ HexLiteralFragment=106
107
+ ReservedKeyword=107
108
+ AnonymousKeyword=108
109
+ BreakKeyword=109
110
+ ConstantKeyword=110
111
+ ImmutableKeyword=111
112
+ ContinueKeyword=112
113
+ LeaveKeyword=113
114
+ ExternalKeyword=114
115
+ IndexedKeyword=115
116
+ InternalKeyword=116
117
+ PayableKeyword=117
118
+ PrivateKeyword=118
119
+ PublicKeyword=119
120
+ VirtualKeyword=120
121
+ PureKeyword=121
122
+ TypeKeyword=122
123
+ ViewKeyword=123
124
+ GlobalKeyword=124
125
+ ConstructorKeyword=125
126
+ FallbackKeyword=126
127
+ ReceiveKeyword=127
128
+ Identifier=128
129
+ StringLiteralFragment=129
130
+ VersionLiteral=130
131
+ WS=131
132
+ COMMENT=132
133
+ LINE_COMMENT=133
134
+ 'pragma'=1
135
+ ';'=2
136
+ '*'=3
137
+ '||'=4
138
+ '^'=5
139
+ '~'=6
140
+ '>='=7
141
+ '>'=8
142
+ '<'=9
143
+ '<='=10
144
+ '='=11
145
+ 'as'=12
146
+ 'import'=13
147
+ 'from'=14
148
+ '{'=15
149
+ ','=16
150
+ '}'=17
151
+ 'abstract'=18
152
+ 'contract'=19
153
+ 'interface'=20
154
+ 'library'=21
155
+ 'is'=22
156
+ '('=23
157
+ ')'=24
158
+ 'error'=25
159
+ 'using'=26
160
+ 'for'=27
161
+ '|'=28
162
+ '&'=29
163
+ '+'=30
164
+ '-'=31
165
+ '/'=32
166
+ '%'=33
167
+ '=='=34
168
+ '!='=35
169
+ 'struct'=36
170
+ 'modifier'=37
171
+ 'function'=38
172
+ 'returns'=39
173
+ 'event'=40
174
+ 'enum'=41
175
+ '['=42
176
+ ']'=43
177
+ 'address'=44
178
+ '.'=45
179
+ 'mapping'=46
180
+ '=>'=47
181
+ 'memory'=48
182
+ 'storage'=49
183
+ 'calldata'=50
184
+ 'if'=51
185
+ 'else'=52
186
+ 'try'=53
187
+ 'catch'=54
188
+ 'while'=55
189
+ 'unchecked'=56
190
+ 'assembly'=57
191
+ 'do'=58
192
+ 'return'=59
193
+ 'throw'=60
194
+ 'emit'=61
195
+ 'revert'=62
196
+ 'var'=63
197
+ 'bool'=64
198
+ 'string'=65
199
+ 'byte'=66
200
+ '++'=67
201
+ '--'=68
202
+ 'new'=69
203
+ ':'=70
204
+ 'delete'=71
205
+ '!'=72
206
+ '**'=73
207
+ '<<'=74
208
+ '>>'=75
209
+ '&&'=76
210
+ '?'=77
211
+ '|='=78
212
+ '^='=79
213
+ '&='=80
214
+ '<<='=81
215
+ '>>='=82
216
+ '+='=83
217
+ '-='=84
218
+ '*='=85
219
+ '/='=86
220
+ '%='=87
221
+ 'let'=88
222
+ ':='=89
223
+ '=:'=90
224
+ 'switch'=91
225
+ 'case'=92
226
+ 'default'=93
227
+ '->'=94
228
+ 'callback'=95
229
+ 'override'=96
230
+ 'anonymous'=108
231
+ 'break'=109
232
+ 'constant'=110
233
+ 'immutable'=111
234
+ 'continue'=112
235
+ 'leave'=113
236
+ 'external'=114
237
+ 'indexed'=115
238
+ 'internal'=116
239
+ 'payable'=117
240
+ 'private'=118
241
+ 'public'=119
242
+ 'virtual'=120
243
+ 'pure'=121
244
+ 'type'=122
245
+ 'view'=123
246
+ 'global'=124
247
+ 'constructor'=125
248
+ 'fallback'=126
249
+ 'receive'=127