Prerequisites
- Basic knowledge of Solidity.
- The Application Smart Contract (ASC) with the integration of the gateway contract, i.e., your executable contract, must be deployed on the source and destination chain. ()
Getting Started
Integration of IGMPReceived interface
Integration of IGateway interface
Making a GMP request
- Deploy a contract using the gateway address of the selected network.
https://docs.analog.one/documentation/developers/analog-gmp/gateway-addresses-and-network-ids
- Estimate the task message/gas cost by calling
estimateMessageCost
on gateway passing it networkid
, messageSize
and gasLimit
.
Function Signature:
estimateMessageCost(uint16 networkid, uint256 messageSize, uint256 gasLimit)
- While requesting
submitMessage
you must pass the GMP task gas fee as a value with the GMP request. If the amount passed is lower than the estimated message cost call the transaction will fail with an error execution reverted: insufficient tx value
.
- You can make the GMP call using
submitMessage
Example
gateway.submitMessage{value: msg.value}(dest_address, dest_network, GMP_GAS_LIMIT, payload);
- Once the block is finalized on the source side, the task will be created on the Timechain. You can track the status of your task on our explorer.
- Once your task is completed, your destination chain contract state will be updated.