-
Task
A Task contains bunch of steps, each of step represents an operation on a blockchain. It can be one of
Bridge
,Swap
, andTransfer
-
Request
A request contains task information and worker account that will be used to execute the task
-
Handler
Proxy contract deployed on every source chain that we supported. Handler contract contains a task queue that only whitelisted workers can claim(consume) task from it. Solidity version implementation can be found here
-
Worker
An account used to temporary hold user assets and send transaction to blockchain. Worker accounts are pre-derived inside Phat contract, those key will never reveal for the outside
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.
- Install dependencies
$ yarn
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/
.
$ yarn devphase test
- start the local stack.
$ yarn devphase stack
- Init the testnet (currently by this script)
# edit .env file
$ node src/setup-drivers.js
- 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.
You can either use phala/sdk or the Webpage App deploy the contract, we highly recommend use the Webpage App to save your time.
Follow play-with-index and have a try