Home

Awesome

A crosschain execution engine build in Phat Contract

inDex Execution Engine Diagram

Terminology

Prepare environment

If your are new for Ink! smart contract language, please head to Parity Ink document or you can checkout our PhatContract document for the details.

 $ yarn

Compile contract

This repo contains several contracts, each of them can be compiled and deployed individually, for example build <target-contract>:

 $ cd contracts/<target-contract>
 $ cargo contract build

or use Devphase

 $ yarn devphase compile

You can also specify which the contract to build by adding the contract name. The name should be in snake case, consistent with the directory names under contracts/.

Test with Devphase

 $ yarn devphase test

Launch a standalone local test stack for custom testing

  1. start the local stack.
 $ yarn devphase stack
  1. Init the testnet (currently by this script)
# edit .env file
 $ node src/setup-drivers.js
  1. You can also dump the contract log from the log server driver with the same scripts:
 $ node src/dump-logs.js

The tests are written in TypeScript at ./tests/*.test.ts. The logs are output to ./logs/{date} directory.

Deploy contract on live network

You can either use phala/sdk or the Webpage App deploy the contract, we highly recommend use the Webpage App to save your time.

Play with inDEX

Follow play-with-index and have a try