Secure the networkBug Bounty 2019

Loaders

Loaders make it possible to easily access and load Ethereum smart contracts. To interact with a contract, whether it's deployed on a local or remote network, you need the address of the deployed contract and its Application Binary Interface (ABI).

Loaders provide a simple way to get the address and ABI of a deployed contract, in a certain version, at a particular location. This information is passed as an object to the adapter, which initialize the contract for use.

NetworkLoader

Install @colony/colony-js-contract-loader-network:

yarn add @colony/colony-js-contract-loader-network

Load contract data from a given network using NetworkLoader:

import { NetworkLoader } from '@colony/colony-js-contract-loader-network';

const loader = new NetworkLoader({ network: 'rinkeby' });

TrufflePigLoader

For local development, colonyJS provides a loader that accepts a contract name and returns the contract's ABI from truffle-generated contract files being sniffed out by our very own TrufflePig.

Install @colony/colony-js-contract-loader-http:

yarn add @colony/colony-js-contract-loader-http

Load contract data from Trufflepig using TrufflepigLoader:

import { TrufflepigLoader } from '@colony/colony-js-contract-loader-http';

const loader = new TrufflepigLoader();

Future loaders

  • Check out tailor to learn more about loaders we plan to support in the future.