Package Exports
- @chainlink/contracts/app.config.json
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@chainlink/contracts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Chainlink's solidity contracts and abstractions.
Available Packages
chainlink-solidity # Solidity Contracts and Compiled JSON ABI
├── @chainlink/contracts # Solidity Contracts
└── @chainlink/abi # Compiled JSON ABI
Installing Contracts
# via Yarn
$ yarn add @chainlink/contracts
# via npm
$ npm install @chainlink/contracts --save
If you wanted to consume the v0.6.x version of our ChainlinkClient
smart contract, do the following:
import "@chainlink/contracts/contracts/v0.6/ChainlinkClient.sol";
Installing Compiled ABIs
JSON artifacts generated by sol-compiler are available in the @chainlink/abi
package.
# via Yarn
$ yarn add @chainlink/abi
# via npm
$ npm install @chainlink/abi --save
If you wanted to consume the v0.6.x version of our ChainlinkClient JSON artifact with Javascript, you could do the following:
const ChainlinkClientJson = require('@chainlink/abi/v0.6/ChainlinkClient.json')
Truffle Example
To use Chainlink ABIs with truffle, your repo needs to import @truffle/contract
, and do the following:
const contract = require('@truffle/contract')
const Oracle = require('@chainlink/abi/v0.6/Oracle.json')
let myOracle = contract(Oracle)
Local Development
Note: Contracts in src/v0.7/dev
are under active development and not yet stable.
Please use them for testing and development only.
# Clone Chainlink repository
$ git clone https://github.com/smartcontractkit/chainlink.git
# Continuing via Yarn
$ yarn install
$ yarn setup:contracts
# Continuing via npm
$ npm install
$ npm run setup:contracts
Testing
After completing the above Development commands, run tests with:
# From this directory, `evm-contracts` via Yarn
$ yarn test
# via npm
$ npm run test
# From project root
$ yarn wsrun @chainlink/contracts test
Contributing
Contributions are welcome! Please refer to Chainlink's contributing guidelines for detailed contribution information.
Thank you!