1 | {
|
2 | "$id": "contract-object.spec.json",
|
3 | "$schema": "http://json-schema.org/schema#",
|
4 | "title": "Contract Object",
|
5 | "description": "Describes a contract consumable by Truffle, possibly including deployed instances on networks",
|
6 |
|
7 | "type": "object",
|
8 | "properties": {
|
9 | "contractName": {
|
10 | "allOf": [{ "$ref": "#/definitions/ContractName" }],
|
11 | "description": "Name used to identify the contract",
|
12 | "default": "Contract"
|
13 | },
|
14 | "abi": {
|
15 | "allOf": [{ "$ref": "abi.spec.json#" }],
|
16 | "description": "Interface description returned by compiler for source"
|
17 | },
|
18 | "metadata": { "$ref": "#/definitions/Metadata" },
|
19 | "bytecode": {
|
20 | "allOf": [{ "$ref": "#/definitions/Bytecode" }],
|
21 | "description": "Bytecode sent as contract-creation transaction data, with unresolved link references"
|
22 | },
|
23 | "deployedBytecode": {
|
24 | "allOf": [{ "$ref": "#/definitions/Bytecode" }],
|
25 | "description": "On-chain deployed contract bytecode, with unresolved link references"
|
26 | },
|
27 | "sourceMap": {
|
28 | "allOf": [{ "$ref": "#/definitions/SourceMap" }],
|
29 | "description": "Source mapping for contract-creation transaction data bytecode"
|
30 | },
|
31 | "deployedSourceMap": {
|
32 | "allOf": [{ "$ref": "#/definitions/SourceMap" }],
|
33 | "description": "Source mapping for contract bytecode"
|
34 | },
|
35 | "source": { "$ref": "#/definitions/Source" },
|
36 | "sourcePath": { "$ref": "#/definitions/SourcePath" },
|
37 | "ast": { "$ref": "#/definitions/AST" },
|
38 | "legacyAST": { "$ref": "#/definitions/LegacyAST" },
|
39 | "compiler": {
|
40 | "type": "object",
|
41 | "properties": {
|
42 | "name": {"type": "string"},
|
43 | "version": {"type": "string"}
|
44 | }
|
45 | },
|
46 | "networks": {
|
47 | "patternProperties": {
|
48 | "^[a-zA-Z0-9]+$": { "$ref": "network-object.spec.json#" }
|
49 | },
|
50 | "additionalProperties": false
|
51 | },
|
52 | "schemaVersion": { "$ref": "#/definitions/SchemaVersion" },
|
53 | "updatedAt": {
|
54 | "type": "string",
|
55 | "format": "date-time"
|
56 | },
|
57 | "devdoc": { "$ref": "#/definitions/NatSpec" },
|
58 | "userdoc": { "$ref": "#/definitions/NatSpec" }
|
59 | },
|
60 | "required": [
|
61 | "abi"
|
62 | ],
|
63 | "patternProperties": {
|
64 | "^x-": { "anyOf": [
|
65 | { "type": "string" },
|
66 | { "type": "boolean" },
|
67 | { "type": "number" },
|
68 | { "type": "object" },
|
69 | { "type": "array" }
|
70 | ]}
|
71 | },
|
72 | "additionalProperties": false,
|
73 |
|
74 | "definitions": {
|
75 | "ContractName": {
|
76 | "type": "string",
|
77 | "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$"
|
78 | },
|
79 |
|
80 | "NatSpec": {
|
81 | "type": "object"
|
82 | },
|
83 |
|
84 | "Metadata": {
|
85 | "type": "string"
|
86 | },
|
87 |
|
88 | "Bytecode": {
|
89 | "type": "string",
|
90 | "pattern": "^0x0$|^0x([a-fA-F0-9]{2}|__.{38})+$"
|
91 | },
|
92 |
|
93 | "Source": {
|
94 | "type": "string"
|
95 | },
|
96 |
|
97 | "SourceMap": {
|
98 | "type": "string",
|
99 | "examples": [
|
100 | "315:637:1:-;;;452:55;;;;;;;-1:-1:-1;;;;;485:9:1;476:19;:8;:19;;;;;;;;;;498:5;476:27;;452:55;315:637;;;;;;;"
|
101 | ]
|
102 | },
|
103 |
|
104 | "SourcePath": {
|
105 | "type": "string"
|
106 | },
|
107 |
|
108 | "AST": {
|
109 | "type": "object"
|
110 | },
|
111 |
|
112 | "LegacyAST": {
|
113 | "type": "object"
|
114 | },
|
115 |
|
116 | "SchemaVersion": {
|
117 | "type": "string",
|
118 | "pattern": "[0-9]+\\.[0-9]+\\.[0-9]+"
|
119 | }
|
120 | }
|
121 | }
|