Step-by-Step Instructions

The steps below detail the process for becoming a registered Distributor within Entangle.

Step 0: Preparation of Smart Contracts

The Protocol Owner must set up contracts for cross-chain communication. For EVM-compatible chains, the recipient contract should include specific functions, and for non-EVM chains, a payload handler must be integrated within the primary function, with caller restrictions applied. Moreover, the deployed Aggregation Spotter Contract (Circuit) on this chain should enforce restrictions on calling functions that are integral to the protocol's workflow

Example

The protocol "Z" operates with contracts on both chain "X" and chain "Y." Within chain "X," the contract named "Alice" intends to transmit the operation "hello" to the contract "Bob" located on chain "Y."

The contract "Bob" must include a 'hello' function, as defined in its Solidity code:

function hello(bytes params) onlyRole(AGGREGATION_SPOTTER) {
    (uint code) = abi.decode(params, (uint));
    console.log(“code: %s”, code);
}

For non-EVM contract solutions, refer to the equivalent pseudocode representation.

// Protocol (target contract part)
fn handleOp(op_data: &OperationData) -> Result<(), Error> {
    match op_data.function_selector {
        0x01020304 => handleHelloOp(op_data.params)?,
    }
    Ok(())
}

The functionSelector is a bytes4 value derived from hashing the function signature, analogous to the function selector in the standard EVM ABI.

For additional clarity with the given example: The contract "Bob" should be registered as the protocol contract for chain Y within the MasterAggregationSpotter (Controller) on the Entangle Blockchain.

The proposing contract "Alice" needs to generate operation data to call the "propose" function, structured as “function propose(bytes32 protocolId, uint64 destChainId, bytes protocolAddress, bytes4 function selector, bytes params);” on the Aggregation Spotter Contract (Circuit).

function sendHelloPropose(uint code) internal {
    bytes4 selector = bytes4(keccak("hello(uint)"));
    bytes memory params = abi.encode(code);
    aggregationSpotter.propose(bytes32("protocol-a"), chainIdY, bobContractAddress, selector, params);
}

The contract "Alice" must be registered as an authorized proposer for chain X within the MasterAggregationSpotter Contract (Controller) on the Entangle Blockchain.

Step 1: Access the Distributor Management Module

1.1. Navigate to the Distributor Management Module.

1.2. Establish a connection by clicking the "Connect Wallet" button.

1.3. Select the Entangle network.

Step 2: Add a Protocol Address

Protocol owners may authorize new protocol addresses via the "Add Protocol Address" section by submitting:

2.1. Protocol identifier for the chosen network (limited to a 32-character English letter string).

2.2. Network identifier selected from the dropdown.

2.3. Input the contract address.

2.4. Click "Send" and authorize the transaction to register the protocol address.

Step 3: Add a Proposer Address

Add a new proposer address which will be the contract designated to generate "Propose" events for the protocol by submitting:

3.1. Protocol identifier for the chosen network (limited to a 32-character English letter string).

3.2. Network identifier selected from the dropdown.

3.3. Input the contract address.

3.4. Click "Send" and authorize the transaction to add the Proposer Address.

Step 4: Authorize Keepers (Transmitters)

Protocol Owners are required to authorize Keepers (Transmitters) by accessing the "Add Keepers" section and entering the following details:

4.1. Protocol identifier for the chosen network (limited to a 32-character English letter string).

4.2. Keeper (Transmitter) addresses, formatted as an EVM-compatible address.

4.3. Click "Send" and authorize the transaction to add a Keeper (Transmitter).

Step 5: Authorize Executors (Conductors)

The Protocol Owner is required to register Executor (Conductor) addresses for every blockchain that hosts a permitted protocol address where operations are anticipated to be executed.

5.1. Protocol identifier for the chosen network (limited to a 32-character English letter string).

5.2. Network identifier selected from the dropdown.

5.3. Input the contract address.

5.4. Click "Send" and authorize the transaction to add the Executor (Conductor).

Step 6: Consensus Target Rates

Protocol Owners can modify the required consensus threshold by using the "Set Consensus Target Rate" Tab. This rate specifies the necessary percentage of Keeper (Transmitter) Signatures that must be achieved by Keepers (Transmitters) in order to achieve consensus.

Protocol Owners must submit:

6.1. Protocol identifier for the chosen network (limited to a 32-character English letter string).

6.2. Network identifier selected from the dropdown.

6.3. Input the contract address.

6.4. Click "Send" and authorize the transaction to update the Executor (Conductor).

Please be aware that the guidelines and user interface (UI) for the Distributor Management Module are intended solely for testing purposes. The UI and features may vary in the Mainnet release, as it will be redesigned for enhanced user experience.

Step 7: Provide data to the Entangle Development Team

To obtain authorization from Entangle, submission of the Protocol Owner's name and the Protocol Owner's contract address is mandatory.

7.1. Join Entangle Oracle Admin group on Telegram

7.2. In the group chat, submit the Protocol Owner's name, the address of the Protocol Owner’s contract, and the target consensus rate (as a percentage) for approval by the Entangle development team.

Be aware that the Entangle Distributor Management Module is presently in beta. The Entangle team is committed to offering comprehensive support and guidance to developers (Distributors) throughout the setup phase.

Last updated