JSON schema for contract artifacts
Last updated 13 days ago by haltman .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @truffle/contract-schema 
SYNC missed versions from official npm registry.

Schema Description: Truffle Contract Object

type object
JSON Schema contract-object.spec.json

@truffle/contract uses a formally specified1 JSON object format to represent Ethereum Virtual Machine (EVM) smart contracts. This representation is intended to facilitate the use of general purpose smart contract abstractions (such as @truffle/contract) by capturing relevant smart contract information in a persistent and portable manner.

Objects following this schema represent individual smart contracts as defined by their name and interface. Each object primarily includes a JSON array representing the contract's ABI2, but extends to include any and all information related to the contract and its lifecycle(s). Objects in this schema may represent pre-compiled source code, compilation annotations such as source mappings, references to specified deployed instances on multiple networks, and/or links to external contracts.

A full property listing is below. Properties not marked "required" are not necessary to include in valid descriptions of contract objects, but functionally certain information must be present to allow the contract object representation to be useful (source/bytecode/etc. enable the deployment of new instances, networks listed with prior contract instance addresses enable interaction with deployed contracts on-chain)


1. JSON Schema http://json-schema.org

2. Ethereum Contract JSON ABI https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI#json



type string matching pattern ^[a-zA-Z_][a-zA-Z0-9_]*$
default "Contract"

Name used to identify the contract. Semi-alphanumeric string.


type array
JSON Schema abi.spec.json

External programmatic description of contract's interface. The contract's ABI determines the means by which applications may interact with individual contract instances. Array of functions and events representing valid inputs and outputs for the instance.


type string

Contract metadata. Stringified JSON.


type string matching pattern ^0x0$\|^0x([a-fA-F0-9]{2}\|__.{38})+$
ref Bytecode

EVM instruction bytecode that runs as part of contract create transaction. Constructor code for new contract instance. Specified as a hexadecimal string, may include __-prefixed (double underscore) link references.


type string matching pattern ^0x0$\|^0x([a-fA-F0-9]{2}\|__.{38})+$
ref Bytecode

EVM instruction bytecode associated with contract that specifies behavior for incoming transactions/messages. Underlying implementation of ABI. Specified as a hexadecimal string, may include __-prefixed (double underscore) link references.


type string matching pattern ^[0-9;]*

Source mapping for bytecode, pairing contract creation transaction data bytes with origin statements in uncompiled source.


type string matching pattern ^[0-9;]*

Source mapping for deployedBytecode, pairing contract program data bytes with origin statements in uncompiled source.


type string

Uncompiled source code for contract. Text string.


type string

File path for uncompiled source code.


type object

format not included in current version of this specification

Abstract Syntax Tree. A nested JSON object representation of contract source code, as output by compiler.


type object

format not included in current version of this specification

Legacy Abstract Syntax Tree. A nested JSON object representation of contract source code, as output by compiler.


type object

Compiler information.


type string

Name of the compiler used.


type string

Version of the compiler used.


type object

Listing of contract instances. Object mapping network ID keys to network object values. Includes address information, links to other contract instances, and/or contract event logs.

Properties (key matching ^[a-zA-Z0-9]+$)

type object
ref Network Object


type string matching pattern [0-9]+\.[0-9]+\.[0-9]+

Version of this schema used by contract object representation.


type string
format IS0-8601 Datetime

Time at which contract object representation was generated/most recently updated.


type string
default "ethereum"

Specific blockchain network type targeted.


type string

NatSpec developer documentation of the contract.


type string

NatSpec user documentation of the contract.

Custom Properties


type string or number or object or array

Objects following this schema may include additional properties with x--prefixed keys.



type string matching pattern ^0x0$\|^0x([a-fA-F0-9]{2}\|__.{38})+$

0x-prefixed string representing compiled EVM machine language.

This string representation may indicate link references in place of linked instance addresses. Link references must begin with __ and be exactly 40 characters long (i.e., string length of an address in hexadecimal).

Current Tags

  • 3.0.24-alphaTez.9                                ...           alphaTez (7 months ago)
  • 3.1.0-ens-events.0                                ...           ens-events (a year ago)
  • 3.2.5                                ...           latest (13 days ago)
  • 3.0.19-micah.0                                ...           micah (a year ago)
  • 3.0.16-migrate-describe.1                                ...           migrate-describe (a year ago)
  • 3.2.2-next.0                                ...           next (2 months ago)
  • 3.2.0-tezos.1                                ...           tezos (5 months ago)
  • 3.0.22-truffleLogger.1                                ...           truffleLogger (8 months ago)

54 Versions

  • 3.2.5                                ...           13 days ago
  • 3.2.4                                ...           a month ago
  • 3.2.3                                ...           2 months ago
  • 3.2.2                                ...           2 months ago
  • 3.2.2-next.0                                ...           2 months ago
  • 3.2.1                                ...           3 months ago
  • 3.2.0                                ...           4 months ago
  • 3.2.0-tezos.1                                ...           5 months ago
  • 3.1.0                                ...           5 months ago
  • 3.2.0-tezos.0                                ...           6 months ago
  • 3.1.0-tezos.0                                ...           7 months ago
  • 3.0.24-alphaTez.9                                ...           7 months ago
  • 3.0.24-alphaTez.8                                ...           7 months ago
  • 3.0.24-alphaTez.7                                ...           7 months ago
  • 3.0.24-alphaTez.6                                ...           7 months ago
  • 3.0.24-alphaTez.5                                ...           7 months ago
  • 3.0.24-alphaTez.4                                ...           7 months ago
  • 3.0.24-alphaTez.3                                ...           7 months ago
  • 3.0.24-alphaTez.2                                ...           7 months ago
  • 3.0.24-alphaTez.1                                ...           8 months ago
  • 3.0.24-alphaTez.0                                ...           8 months ago
  • 3.0.23                                ...           8 months ago
  • 3.0.23-alphaTez.0                                ...           8 months ago
  • 3.0.22                                ...           8 months ago
  • 3.0.21                                ...           8 months ago
  • 3.1.6-alphaTez.3                                ...           8 months ago
  • 3.0.22-truffleLogger.1                                ...           8 months ago
  • 3.1.6-alphaTez.2                                ...           8 months ago
  • 3.1.6-alphaTez.1                                ...           8 months ago
  • 3.1.6-alphaTez.0                                ...           9 months ago
  • 3.1.5-alphaTez.0                                ...           9 months ago
  • 3.0.22-truffleLogger.0                                ...           9 months ago
  • 3.0.20                                ...           9 months ago
  • 3.0.21-truffleLogger.0                                ...           9 months ago
  • 3.0.20-truffleLogger.0                                ...           9 months ago
  • 3.1.4-alphaTez.0                                ...           9 months ago
  • 3.1.3-alphaTez.0                                ...           9 months ago
  • 3.1.2-alphaTez.0                                ...           9 months ago
  • 3.0.19                                ...           10 months ago
  • 3.0.19-micah.0                                ...           a year ago
  • 3.0.18                                ...           a year ago
  • 3.0.18-next.1                                ...           a year ago
  • 3.0.18-next.0                                ...           a year ago
  • 3.0.20-micah.0                                ...           a year ago
  • 3.0.17                                ...           a year ago
  • 3.1.1-alphaTez.0                                ...           a year ago
  • 3.1.0-alphaTez.0                                ...           a year ago
  • 3.0.17-alphaTez.0                                ...           a year ago
  • 3.1.0-ens-events.0                                ...           a year ago
  • 3.0.16                                ...           a year ago
  • 3.0.16-migrate-describe.1                                ...           a year ago
  • 3.0.16-migrate-describe.0                                ...           a year ago
  • 3.0.15                                ...           a year ago
  • 3.0.14                                ...           a year ago

Copyright 2014 - 2016 © taobao.org |