Phala-Network
index-contract
Rust

A crosschain execution engine build in Phat Contract

Last updated Dec 18, 2025
11
Stars
3
Forks
3
Issues
0
Stars/day
Attention Score
3
Language breakdown
Rust 85.8%
JavaScript 7.4%
TypeScript 6.9%
Files click to expand
README

A crosschain execution engine build in Phat Contract

inDex Execution Engine Diagram

Terminology

  • Task
A Task contains bunch of steps, each of step represents an operation on a blockchain. It can be one of Bridge, Swap, and Transfer
  • 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

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.

  • Install dependencies
$ 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

  • start the local stack.
$ yarn devphase stack
# 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.

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

© 2026 GitRepoTrend · Phala-Network/index-contract · Updated daily from GitHub