Clique Application Structure

Clique provides an official task registry for the community to download, publish, build, and share tasks. You can easily submit a query composed of these tasks through our config file Clique Manifest. You can also deploy custom tasks yourself if there is no existing task that fits your needs.

Task Deployment

You can deploy a custom task by:

  • Initialize a custom task template through Clique CLI

  • Customize your task code and update your task manifest

  • Verify the manifest and submit it to the Clique TEE Network through Clique CLI

Here is a simple generated task manifest

spec-version = "1"
name = "clique_fibonacci"
type = "Dynamic"

proof-type = ["TEE"]

[input]
n = { type = "u256", description = "n" }

[output]
result = { type = "u256", description = "fibonacci sequence for n" }

[code]
type = "EVM"
data = "6080604052348015600e575f80fd5b5061022d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063371432331461002d575b5f80fd5b610047600480360381019061004291906100fd565b61005d565b6040516100549190610137565b60405180910390f35b5f80820361006d575f90506100c1565b6001820361007e57600190506100c1565b5f80600190505f80600290505b8581116100b957828461009e919061017d565b915082935081925080806100b1906101b0565b91505061008b565b508093505050505b919050565b5f80fd5b5f819050919050565b6100dc816100ca565b81146100e6575f80fd5b50565b5f813590506100f7816100d3565b92915050565b5f60208284031215610112576101116100c6565b5b5f61011f848285016100e9565b91505092915050565b610131816100ca565b82525050565b5f60208201905061014a5f830184610128565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610187826100ca565b9150610192836100ca565b92508282019050808211156101aa576101a9610150565b5b92915050565b5f6101ba826100ca565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036101ec576101eb610150565b5b60018201905091905056fea2646970667358221220365d9643fc7bf275e8e02fe7cd0f5a26ff14400be75bed36b39c21b2dd78440964736f6c634300081a0033"
abi = '[{"inputs":[{"internalType":"uint256","name":"n","type":"uint256"}],"name":"evaluate","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"pure","type":"function"}]'

The EVM template for the custom task is available on GitHub at

https://github.com/CliqueOfficial/template-evm

Clique Integration Flow

On-chain Application

Here is a diagram that describes how the Clique Network can be integrated with your DApp.

Smart Contract Integration with the Clique Network

Step-by-Step Integration Flow

  1. Register a callback by using our Smart Contract SDK

  2. Once the response is fulfilled and verified by the CliqueTaskManager contract, it will invoke a callback registration.

Off-chain Application

You can check out our Clique Client SDK to integrate with your off-chain service. Here are integration examples for a few different languages:

  • [Rust example link]

  • [NodeJS example link]

  • [Web example link]

Last updated