Getting Started

If you need technical guidance or wish to discuss your project's implementation, please reach out to us. Our committed team is available to assist with your projects and help ensure their success. For expert support, please fill out the Entangle Contact form.

Be aware, that UIP 2.0 is in Testnet phase. Mainnet integration flow might change. Stay up to date with the latest updates and follow us on social media: Discord and Twitter

Prerequisites

Before you begin, you'll need to enure you're familiar with the concepts we'll be using for most of the guides. If you're unsure about anything, we recommend reading more via the provided links.

The guides will be utilising the testnet. To utilise the testnet for contract deployment and calls you will need to acquire testnet funds. You can acquire these tokens on public faucets. Click on the respective token to be taken to a public faucet and complete the steps to acquire the necessary funds in your wallet.

Understanding the Basics

In a nutshell, as a Web3 developer planning to utilize UIP, you need to understand the basic architecture.

  • You will need to deploy contracts on every network where your application will operate, and they should call the Endpoints methods.

  • Through Endpoints, UIP will transmit your transactions and your clients’ transactions.

  • Endpoints have interfaces that need to be followed.

  • Your client will interact specifically with your contracts, while UIP will only deliver the messages.

Application Architecture

To use UIP, you first need to implement logic for handling crosschain operations within your smart contracts and connect them to the UIP Endpoint interface.

Once this is done, the process is as follows:

  1. A user initiates a transaction on the source chain. This transaction includes a payload with information for execution on the destination chain.

  2. Your smart contract on the source chain calls the 'propose' function of the UIP Endpoint contract. This notifies the network about the new message.

  3. The message is verified and delivered to the destination chain. The Transmitter executes the message by calling the 'execute' function of the UIP Endpoint. During this stage, the message also undergoes a Transmitter signatures verification process.

  4. After all security checks are passed, the message is passed through the Endpoint to your smart contract on the destination chain.

Basic Setup

Firstly, make sure that your smart contracts are compatible with the Endpoint contract.

This contract has the following interface for proposing omnichain operations:

    function propose(
        uint256 destChainID,
        bytes32 selectorSlot,
        AgentParams calldata agentParams,
        bytes calldata destAddress,
        bytes calldata params
    ) external payable

You can set up parameters such as block finalisation and required gas limit for execution on destination chain in AgentParams structure:

struct AgentParams {
    uint256 waitForBlocks;
    uint256 customGasLimit;
}

The smart contract on the destination chain will be capable of processing the following call:

        (bool success, bytes memory ret) = addressToCall.call{value: msg.value}(
            abi.encodeWithSelector(selector, internalCallData)
        );

Finally you have to make sure to deploy smart contracts on all chains before you're ready to go.

Explore

Now that you're ready to begin building, inspire yourself with some ideas by checking out the Build The Future page.

Last updated