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