npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@shyftnetwork/shyft_truffle-contract-schema

v2.0.3

Published

JSON schema for contract artifacts

Downloads

5

Readme

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)

References

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

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

Properties

contractName

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

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

abi

| type | array | | ---: | ---- | | JSON Schema | abi.spec.json | | required |

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.

ast

| type | object | | ---: | ---- |

not included in current version of this specification

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

bytecode

| 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.

deployedBytecode

| 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.

source

| type | string | | ---: | ---- |

Uncompiled source code for contract. Text string.

sourcePath

| type | string | | ---: | ---- |

File path for uncompiled source code.

sourceMap

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

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

deployedSourceMap

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

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

schemaVersion

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

Version of this schema used by contract object representation.

updatedAt

| type | string | | ---: | ---- | | format | IS0-8601 Datetime |

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

networks

| 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 |

Custom Properties

^x-([a-zA-Z]+-)*[a-zA-Z]+

| type | string or number or object or array | | ---: | ---- |

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

Definitions

Bytecode

| 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).