0x v2 beta starter project
Clone or download
Latest commit 7394559 Aug 4, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
contract_templates Forwarder contract Jul 12, 2018
src Update to latest 0x.js with Kovan addresses Aug 4, 2018
.gitignore Add ganache snapshot Jun 29, 2018
README.md Update README.md Jul 21, 2018
package.json Update to latest 0x.js with Kovan addresses Aug 4, 2018
tsconfig.json Initial v2-beta-starter Jun 28, 2018
yarn.lock Update deps Aug 4, 2018

README.md

This project will run against both a local ganache and the 0x v2 Kovan deployment.

cli

Scenarios

  • Fill Order (ERC20)
  • Fill Order Fees
  • Fill Order (ERC721)
  • Cancel Orders Up To
  • Match Orders
  • Execute Transaction

Getting Started

Update the mnemonic in src/constants.ts or use the one provided (note if many people use this mnemonic on Kovan then the funds may be drained).

Install dependencies:

yarn install

Build this package:

yarn run build

Download and start the ganache instance:

yarn run download_snapshot
yarn run ganache-cli

Run this example in another terminal:

yarn run scenario:fill_order

To run all scenarios:

yarn run scenario:all

Switching to Kovan

To switch between Kovan/ganache uncomment the appropriate lines in src/constants.ts and re-build. Ganache is enabled by default.

For Ganache:

// Ganache
export const RPC_URL = GANACHE_RPC;
export const NETWORK_ID = GANACHE_NETWORK_ID;
export const TX_DEFAULTS = GANACHE_TX_DEFAULTS;

For Kovan:

// Kovan
export const RPC_URL = KOVAN_RPC;
export const NETWORK_ID = KOVAN_NETWORK_ID;
export const TX_DEFAULTS = KOVAN_TX_DEFAULTS;