AsterizmDemo contract

Deployment and Configuration of the Basic Protocol Demo Contract

To demonstrate the functionality of our protocol, our team has developed a demo contract that facilitates the transmission of text data between networks. You can find the contract code in our repositories (both the basic and upgradeable versions for EVM and the basic version for TVM networks):

To complete the full configuration, you need to perform the following steps:

  1. Deploy the contracts to the required networks and obtain their addresses. This can be done on both Testnet, and Mainnet

  2. Add the obtained addresses to the list of trusted addresses on each network.

  3. Send a message containing text from one network to another.

Contract deployment

Here are console commands for simplified deployment

EVM

npx hardhat demo:deploy {initializerAddress} {relayAddress?} {feeTokenAddress?} --network {networkName}

The command accepts the following parameters:

  • initializerAddress - mandatory parameter: the address of the initializer on the network. You can review the list of available addresses on the respective pages (Mainnet or Testnet)

  • relayAddress - optional parameter: the address of an external relay. You will be able to review the list of available external relays on the respective page

  • feeTokenAddress - optional parameter: token address for transfer commission payment

  • networkName - mandatory parameter: the name of the network to which the contract is deployed. You can explore the list of available networks here.

Upon successful execution, the command will return a response similar to the following (the address of the demo contract will be displayed under the AsterizmDemo address):

Deployment was done.

Total gas limit: 2556349
Owner address: 0xf9E3b4AC4CEFF24464840c426E7e3506dC145c44
Initializer address: 0xFE1B8bc850E34F260A08d41dd034b0fb82EfE45a
AsterizmDemo address: 0x50c7297E385afCC365deD9069a346694107442F0

TVM

npx locklift run --script ./scripts/demo/demo_deploy_task.ts --initializer {initializerAddress} --externalRelay {relayAddress?} --network {networkName}

The command accepts the following parameters:

  • initializerAddress - mandatory parameter: the address of the initializer on the network. You can review the list of available addresses on the respective pages (Mainnet or Testnet)

  • relayAddress - optional parameter: the address of an external relay. You will be able to review the list of available external relays on the respective page

  • networkName - mandatory parameter: the name of the network to which the contract is deployed. You can explore the list of available networks here

Upon successful execution, the command will return a response similar to the following (the address of the demo contract will be displayed under the AsterizmDemo address):

Deployment was done.

Owner address: 0:68a73acf79fed327d33a1e60503060021cbc2d9e1e8500d073d448d9a74f978f
Initializer address: 0:c100d8e7100822e6e5b9169c1423686bb99eb011eb37798232b3a2cedf4ecf08
AsterizmDemo address: 0:d70fd67d3de5f447b35d79a9c51b9d721c45c9eabdf9cafdd894fa17425bea9f

Adding Trusted Addresses

To simplify the process of adding trusted addresses, console commands have been developed.

IMPORTANT!

In each network, it is essential to add the trusted address of those networks to which transfers will be sent. That is if you plan to send such transfers:

  • Ethereum -> Polygon

  • Ethereum -> BSC

  • Polygon -> Ethereum

  • BSC -> Ethereum

then you should add a total of 4 trusted addresses as follows:

  • In the Ethereum network, add 2 trusted addresses (Polygon and BSC)

  • In the Polygon network, add 1 trusted address (Ethereum)

  • In the BSC network, add 1 trusted address (Ethereum)

EVM

npx hardhat deploy:addTrustedAddress {contractAddress} {trustedChainId} {trustedAddress} --network {networkName}

The command accepts the following parameters:

  • contractAddress - mandatory parameter: the address of the demo contract in the current network

  • trustedChainId - mandatory parameter: the ID of the network of the trusted address. You can review the list of available networks on the corresponding pages (Mainnet or Testnet)

  • trustedAddress - mandatory parameter: the address of the trusted demo contract. You will be able to review the list of available external relays later on a dedicated page. Please note that this parameter accepts a uint value, not address. Therefore, you will need to convert the hexadecimal address to decimal

  • networkName - mandatory parameter: the name of the source network. You can check the list of available networks here.

Upon successful execution, the command will return a response similar to the following:

Added trusted address successfully

Total gas limit: 116817
Target contract address: 0x50c7297E385afCC365deD9069a346694107442F0
Transaction hash: 0x8f131674d51e12a213908a81e969feef4010cbfa2dbcbd1b19310b9c6301880f

TVM

npx locklift run --script ./scripts/deploy_singletrustedaddress_task.ts --contractAddress {contractAddress} --trustedChainId {trustedChainId} --trustedAddress {trustedAddress} --network {networkName}

The command accepts the following parameters:

  • contractAddress - mandatory parameter: the address of the demo contract in the current network

  • trustedChainId - mandatory parameter: the ID of the network of the trusted address. You can review the list of available networks on the corresponding pages (Mainnet or Testnet)

  • trustedAddress - mandatory parameter: the address of the trusted demo contract. You will be able to review the list of available external relays later on a dedicated page. Please note that this parameter accepts a uint value, not address. Therefore, you will need to convert the hexadecimal address to decimal

  • networkName - mandatory parameter: the name of the source network. You can check the list of available networks here.

Upon successful execution, the command will return a response similar to the following:

Added trusted address successfully

Target contract address: 0:d70fd67d3de5f447b35d79a9c51b9d721c45c9eabdf9cafdd894fa17425bea9f
Transfer hash: e32ee9f05ff5093ec031b831ccd60019f7d1b265f8052843cd5670ad41feb855

Sending cross-chain messages

To simplify the process of sending messages to the demo contract, console commands have also been developed.

EVM

npx hardhat demo:sendmessage {contractAddress} {destinationChainId} {message} --network {networkName}

The command accepts the following parameters:

  • contractAddress - mandatory parameter: the address of the demo contract in the source network

  • trustedChainId - mandatory parameter: the ID of the destination network. You can review the list of available networks on the corresponding pages (Mainnet or Testnet)

  • message - mandatory parameter: the text that will be transmitted from the source network to the destination network

  • networkName - mandatory parameter: the name of the source network. You can check the list of available networks here

Upon successful execution, the command will return a response similar to the following:

Message sent successfully

Total gas limit: 90759
AsterizmDemo address: 0x50c7297E385afCC365deD9069a346694107442F0
Transaction hash: 0x0f9a07ddaa9915905d5f764d3b68f432e48f39056faa017e6b87c8514b2bfcb5

TVM

npx locklift run --script ./scripts/demo/demo_sendmessage_tast.ts --contractAddress {contractAddress} --destinationChainId {destinationChainId} --message {message} --network {networkName}

The command accepts the following parameters:

  • contractAddress - mandatory parameter: the address of the demo contract in the source network

  • trustedChainId - mandatory parameter: the ID of the destination network. You can review the list of available networks on the corresponding pages (Mainnet or Testnet)

  • message - mandatory parameter: the text that will be transmitted from the source network to the destination network

  • networkName - mandatory parameter: the name of the source network. You can check the list of available networks here

Upon successful execution, the command will return a response similar to the following:

Message sent successfully

Target contract address: 0:d70fd67d3de5f447b35d79a9c51b9d721c45c9eabdf9cafdd894fa17425bea9f
Transfer hash: ba52f4de4b423692e67a361a271f1edd7384f60aaf5e06404a27f7df0257bfdc

Last updated