Source Chain

  • Implement a protocol contract that calls the MetalayerRouter
  • Calculate and include appropriate gas payment
  • Properly encode message data and read operations

Destination Chain

  • Implement the IMetalayerRecipient interface
  • Handle incoming messages and read results
  • Process cross-chain operations securely

Security Considerations

  • The MetalayerRouter must be configured to be trusted on the destination chain. Do not allow the deliver function in your protocol to be called by any address other than the local MetalayerRouter.
  • Consider finality requirements for your use case. If your contract needs to wait for finality on the source chain before processing a message, set the _useFinalized flag to true in the dispatch function. This significantly reduces the risk of a reorg in your contract.