Contributing

The source for the contracts can be found on Github.

To set up for contributing, install requirements with NPM:

npm install

Tip

Many of the following commands simply wrap corresponding Truffle commands.

Testing and Linting

The test suite may be run using:

npm test

In order to run a subset of test cases which match a regular expression, the TEST_GREP environment variable may be used:

TEST_GREP='obtainable conditionIds' npm test

The JS test files may be linted via:

npm run lint

Contracts may also be linted via:

npm run lint-contracts

Development commands

To compile all the contracts, obtaining build artifacts containing each containing their respective contract’s ABI and bytecode, use the following command:

npm run compile

Running the migrations, deploying the contracts onto a chain and recording the contract’s deployed location in the build artifact can also be done:

npm run migrate

Dropping into a Truffle develop session can be done via:

npm run develop

Network Information

Showing the deployed addresses of all contracts on all networks can be done via:

npm run networks

Extra command line options for the underlying Truffle command can be passed down through NPM by preceding the options list with --. For example, in order to purge the build artifacts of any unnamed network information, you can run:

npm run networks -- --clean

To take network info from networks.json and inject it into the build artifacts, you can run:

npm run injectnetinfo

If you instead wish to extract all network information from the build artifacts into networks.json, run:

npm run extractnetinfo

Warning

Extracting network info will overwrite networks.json.

Building the Documentation

(Will install Sphinx and Solidity Domain for Sphinx):

cd docs
pip install -r requirements.txt
make html

Contributors