-
Notifications
You must be signed in to change notification settings - Fork 8
/
smart-contract-verifier.swagger.yaml
559 lines (559 loc) · 16.8 KB
/
smart-contract-verifier.swagger.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
swagger: "2.0"
info:
title: v2/smart-contract-verifier.proto
version: version not set
tags:
- name: SolidityVerifier
- name: VyperVerifier
- name: SourcifyVerifier
- name: Health
consumes:
- application/json
produces:
- application/json
paths:
/api/v2/verifier/solidity/methods:lookup:
post:
operationId: SolidityVerifier_LookupMethods
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/v2LookupMethodsResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/v2LookupMethodsRequest'
tags:
- SolidityVerifier
/api/v2/verifier/solidity/sources:verify-multi-part:
post:
operationId: SolidityVerifier_VerifyMultiPart
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/v2VerifyResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/v2VerifySolidityMultiPartRequest'
tags:
- SolidityVerifier
/api/v2/verifier/solidity/sources:verify-standard-json:
post:
operationId: SolidityVerifier_VerifyStandardJson
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/v2VerifyResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/v2VerifySolidityStandardJsonRequest'
tags:
- SolidityVerifier
/api/v2/verifier/solidity/versions:
get:
operationId: SolidityVerifier_ListCompilerVersions
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/v2ListCompilerVersionsResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
tags:
- SolidityVerifier
/api/v2/verifier/sourcify/sources:verify:
post:
operationId: SourcifyVerifier_Verify
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/v2VerifyResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/v2VerifySourcifyRequest'
tags:
- SourcifyVerifier
/api/v2/verifier/sourcify/sources:verify-from-etherscan:
post:
operationId: SourcifyVerifier_VerifyFromEtherscan
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/v2VerifyResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/v2VerifyFromEtherscanSourcifyRequest'
tags:
- SourcifyVerifier
/api/v2/verifier/vyper/sources:verify-multi-part:
post:
operationId: VyperVerifier_VerifyMultiPart
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/v2VerifyResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/v2VerifyVyperMultiPartRequest'
tags:
- VyperVerifier
/api/v2/verifier/vyper/sources:verify-standard-json:
post:
operationId: VyperVerifier_VerifyStandardJson
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/v2VerifyResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/v2VerifyVyperStandardJsonRequest'
tags:
- VyperVerifier
/api/v2/verifier/vyper/versions:
get:
operationId: VyperVerifier_ListCompilerVersions
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/v2ListCompilerVersionsResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
tags:
- VyperVerifier
/health:
get:
summary: |-
If the requested service is unknown, the call will fail with status
NOT_FOUND.
operationId: Health_Check
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/v2HealthCheckResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
parameters:
- name: service
in: query
required: false
type: string
tags:
- Health
definitions:
ExtraDataBytecodePart:
type: object
properties:
type:
type: string
data:
type: string
HealthCheckResponseServingStatus:
type: string
enum:
- UNKNOWN
- SERVING
- NOT_SERVING
- SERVICE_UNKNOWN
default: UNKNOWN
description: ' - SERVICE_UNKNOWN: Used only by the Watch method.'
LookupMethodsResponseMethod:
type: object
properties:
fileName:
type: string
fileOffset:
type: integer
format: int64
length:
type: integer
format: int64
SourceMatchType:
type: string
enum:
- MATCH_TYPE_UNSPECIFIED
- PARTIAL
- FULL
default: MATCH_TYPE_UNSPECIFIED
description: ' - MATCH_TYPE_UNSPECIFIED: Default value. This value is unused.'
SourceSourceType:
type: string
enum:
- SOURCE_TYPE_UNSPECIFIED
- SOLIDITY
- VYPER
- YUL
default: SOURCE_TYPE_UNSPECIFIED
description: ' - SOURCE_TYPE_UNSPECIFIED: Default value. Used if is impossible to determine the source type.'
VerifyResponseExtraData:
type: object
properties:
localCreationInputParts:
type: array
items:
type: object
$ref: '#/definitions/ExtraDataBytecodePart'
description: |-
/ Creation transaction input resultant from local compilation
/ parsed and split on Main and Meta parts. Is empty for Sourcify verification.
localDeployedBytecodeParts:
type: array
items:
type: object
$ref: '#/definitions/ExtraDataBytecodePart'
description: |-
/ Deployed bytecode resultant from local compilation
/ parsed and split on Main and Meta parts. Is empty for Sourcify verification.
VerifyResponsePostActionResponses:
type: object
properties:
lookupMethods:
$ref: '#/definitions/v2LookupMethodsResponse'
description: |-
/ If requested, will contain the response for
/ 'lookup-methods' processing applied to the verified contract.
googlerpcStatus:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
$ref: '#/definitions/protobufAny'
protobufAny:
type: object
properties:
'@type':
type: string
additionalProperties: {}
v2BytecodeType:
type: string
enum:
- BYTECODE_TYPE_UNSPECIFIED
- CREATION_INPUT
- DEPLOYED_BYTECODE
default: BYTECODE_TYPE_UNSPECIFIED
v2HealthCheckResponse:
type: object
properties:
status:
$ref: '#/definitions/HealthCheckResponseServingStatus'
v2ListCompilerVersionsResponse:
type: object
properties:
compilerVersions:
type: array
items:
type: string
title: / Compiler versions available
v2LookupMethodsRequest:
type: object
properties:
bytecode:
type: string
abi:
type: string
sourceMap:
type: string
fileIds:
type: object
additionalProperties:
type: string
v2LookupMethodsResponse:
type: object
properties:
methods:
type: object
additionalProperties:
$ref: '#/definitions/LookupMethodsResponseMethod'
v2Source:
type: object
properties:
fileName:
type: string
title: / The name of the file verified contract was located at
contractName:
type: string
title: / The name of the contract which was verified
compilerVersion:
type: string
title: Compiler version used to compile the contract
compilerSettings:
type: string
title: |-
/ 'settings' key in Standard Input JSON
/ (https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description)
sourceType:
$ref: '#/definitions/SourceSourceType'
sourceFiles:
type: object
additionalProperties:
type: string
abi:
type: string
title: |-
/ Contract abi (https://docs.soliditylang.org/en/latest/abi-spec.html?highlight=abi#json);
/ (does not exist for Yul contracts)
constructorArguments:
type: string
title: |-
/ Constructor arguments used for deploying verified contract
/ (exists only for creation inputs)
matchType:
$ref: '#/definitions/SourceMatchType'
title: / Similar to Sourcify (see https://docs.sourcify.dev/docs/full-vs-partial-match/)
compilationArtifacts:
type: string
description: |-
/ General and compiler-specific artifacts (abi, userdoc, devdoc, licenses, ast, etc),
/ encoded as a json.
creationInputArtifacts:
type: string
description: / Info about the creation code (sourcemaps, linkreferences) encoded as a json.
deployedBytecodeArtifacts:
type: string
description: / Info about the runtime code (sourcemaps, linkreferences, immutables) encoded as a json.
v2VerificationMetadata:
type: object
properties:
chainId:
type: string
title: / Id of the chain the contract is verified on
contractAddress:
type: string
title: / The address of the contract to be verified
v2VerifyFromEtherscanSourcifyRequest:
type: object
properties:
address:
type: string
title: / Address of the contract to be verified
chain:
type: string
title: |-
/ The chain (network) the contract was deployed to
/ (https://docs.sourcify.dev/docs/api/chains/)
v2VerifyResponse:
type: object
properties:
message:
type: string
status:
$ref: '#/definitions/v2VerifyResponseStatus'
source:
$ref: '#/definitions/v2Source'
extraData:
$ref: '#/definitions/VerifyResponseExtraData'
postActionResponses:
$ref: '#/definitions/VerifyResponsePostActionResponses'
v2VerifyResponseStatus:
type: string
enum:
- STATUS_UNSPECIFIED
- SUCCESS
- FAILURE
default: STATUS_UNSPECIFIED
v2VerifySolidityMultiPartRequest:
type: object
properties:
bytecode:
type: string
title: / Bytecode to compare local compilation result with
bytecodeType:
$ref: '#/definitions/v2BytecodeType'
title: / Either CREATION_INPUT or DEPLOYED_BYTECODE, depending on what should be verified
compilerVersion:
type: string
title: / Compiler version used to compile the contract
evmVersion:
type: string
title: / Version of the EVM to compile for. If absent results in default EVM version
optimizationRuns:
type: integer
format: int32
title: |-
/ If present, optimizations are enabled with specified number of runs,
/ otherwise optimizations are disabled
sourceFiles:
type: object
additionalProperties:
type: string
title: / Map from a source file name to the actual source code
libraries:
type: object
additionalProperties:
type: string
title: / Map from a library name to its address
metadata:
$ref: '#/definitions/v2VerificationMetadata'
title: / An optional field to be filled by explorers
postActions:
type: array
items:
type: string
description: |-
/ Additional actions the client wants the result to be returned.
/ Currently supports only: "lookup-methods" for Solidity contracts.
v2VerifySolidityStandardJsonRequest:
type: object
properties:
bytecode:
type: string
title: / Bytecode to compare local compilation result with
bytecodeType:
$ref: '#/definitions/v2BytecodeType'
title: / Either CREATION_INPUT or DEPLOYED_BYTECODE, depending on what should be verified
compilerVersion:
type: string
title: / Compiler version used to compile the contract
input:
type: string
title: / https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description
metadata:
$ref: '#/definitions/v2VerificationMetadata'
title: / An optional field to be filled by explorers
postActions:
type: array
items:
type: string
description: |-
/ Additional actions the client wants the result to be returned.
/ Currently supports only: "lookup-methods" for Solidity contracts.
v2VerifySourcifyRequest:
type: object
properties:
address:
type: string
title: / Address of the contract to be verified
chain:
type: string
title: |-
/ The chain (network) the contract was deployed to
/ (https://docs.sourcify.dev/docs/api/chains/)
files:
type: object
additionalProperties:
type: string
title: |-
/ Files required for verification (see Sourcify Api)
Is named as `files` instead of `source_files`
to correspond with Sourcify api
chosenContract:
type: integer
format: int32
title: (optional) see Sourcify Api
v2VerifyVyperMultiPartRequest:
type: object
properties:
bytecode:
type: string
title: / Bytecode to compare local compilation result with
bytecodeType:
$ref: '#/definitions/v2BytecodeType'
title: / Either CREATION_INPUT or DEPLOYED_BYTECODE, depending on what should be verified
compilerVersion:
type: string
title: / Compiler version used to compile the contract
evmVersion:
type: string
title: / Version of the EVM to compile for. If absent results in default EVM version
sourceFiles:
type: object
additionalProperties:
type: string
title: / Map from a source file name to the actual source code
interfaces:
type: object
additionalProperties:
type: string
description: |-
/ Map from an interface names to the actual interfaces.
/ If non-specified, no interfaces are considered.
metadata:
$ref: '#/definitions/v2VerificationMetadata'
title: / An optional field to be filled by explorers
v2VerifyVyperStandardJsonRequest:
type: object
properties:
bytecode:
type: string
title: / Bytecode to compare local compilation result with
bytecodeType:
$ref: '#/definitions/v2BytecodeType'
title: / Either CREATION_INPUT or DEPLOYED_BYTECODE, depending on what should be verified
compilerVersion:
type: string
title: / Compiler version used to compile the contract
input:
type: string
title: / https://docs.vyperlang.org/en/stable/compiling-a-contract.html#input-json-description
metadata:
$ref: '#/definitions/v2VerificationMetadata'
title: / An optional field to be filled by explorers