UNPKG

2.76 kBMarkdownView Raw
1# Schema Description: Truffle Contract Network Instance Object
2
3| type | _object_ |
4| ---: | ---- |
5| JSON Schema | [network-object.spec.json](spec/network-object.spec.json) |
6
7Contract instances encoded within the contract object schema follow the format
8described herein. Each instance ("network object") must include the address for
9the contract on the network, as well as may include additional information as
10appropriate. This may include a listing of event descriptions according to the
11ABI, and links to dependent instances of other contracts (within the same
12network).
13
14
15## Properties
16
17### `address`
18
19| type | _string_ matching pattern `^0x[a-fA-F0-9]{40}$` |
20| ---: | ---- |
21| ref | [Address](#network-object--address) |
22| **required** |
23
24The contract instance's primary identifier on the network. 40 character long
25hexadecimal string, prefixed by `0x`.
26
27
28### `events`
29
30| type | _object_ |
31| ---: | ---- |
32| default | `{}` |
33
34Listing of events the contract instance may produce, either directly or
35indirectly, via dependent, linked instances. Object mapping event hash
36identifiers (`0x`-prefixed 64-character hexadecimal strings) to semantically
37meaningful descriptions of the event.
38
39#### `events` Properties (key matching `^0x[a-fA-F0-9]{64}$`)
40
41| type | _object_ |
42| ---: | ---- |
43| ref | [abi.spec.json](spec/abi.spec.json) |
44
45Ethereum Contract JSON ABI item representing an EVM output log event for a
46contract. Matches objects with `"type": "event"` in the JSON ABI.
47
48
49
50### `links`
51
52| type | _object_ |
53| ---: | ---- |
54| default | `{}` |
55
56Listing of dependent contract instances and their events. Facilitates the
57resolution of link references for a particular contract to instances of other
58contracts. Object mapping linked contract names to objects representing an
59individual link.
60
61#### `links` Properties (key matching `^[a-zA-Z_][a-zA-Z0-9_]*$`)
62
63| type | _object_ |
64| ---: | ---- |
65
66Object representing linked contract instance.
67
68##### Link Object Properties
69
70###### `address`
71
72| type | _string_ matching pattern `^0x[a-fA-F0-9]{40}$` |
73| ---: | ---- |
74| ref | [Address](#network-object--address) |
75
76The primary locator for the linked contract.
77
78###### `events`
79
80| type | _object_ |
81| ---: | ---- |
82
83Listing of events the _linked_ contract instance may produce, either directly or
84indirectly, via its own dependent, linked instances. Object mapping event hash
85identifiers (`0x`-prefixed 64-character hexadecimal strings) to semantically
86meaningful descriptions of the event.
87
88
89
90
91
92## Definitions
93
94### <a name="network-object--address">Address</a>
95
96| type | _string_ matching pattern `^0x[a-fA-F0-9]{40}$` |
97| ---: | ---- |
98
99Primary identifier for an account on an EVM blockchain network. 40 character
100long hexadecimal string, prefixed by `0x`.