Standard Relayer
Last updated
Was this helpful?
Last updated
Was this helpful?
The Standard Relayer provides a mechanism for a contract on one chain to send a message to a contract on a different chain without the developer dealing with any off chain deployments.
Currently the Standard Relayer feature is limited to EVM environments.
Find the complete list of EVM environment blockchains .
To send a message to a contract on another EVM chain, we can call the sendPayloadToEvm
method, provided by the IWormholeRelayer
interface.
The sendPayloadToEvm
method is marked payable
so we can pay for our transaction to be submitted.
The value to attach to the invocation is determined by calling the quoteEVMDeliveryPrice
, which provides an estimate of the cost of gas on the target chain.
This method should be called prior to sending a message and the value returned for nativePriceQuote
should be attached to the call to send the payload in order to cover the cost of the transaction on the target chain.
In total, sending a message across EVM chains can be as simple as:
The logic inside the function body may be whatever business logic is required to take action on the specific payload.
Some implementation details should be considered during development to ensure safety and improve UX.
Receiving a message from relayer
Check for expected emitter
call parseAndVerify on any additionalVAAs
Replay protection
Message Ordering
no guarantees on order of messages delivered
Fowarding/Call Chaining
Refunding overpayment of gasLimit
Refunding overpayment of value sent
If taking advantage of Automatic Relaying, no off chain logic need be implemented.
While no off chain programs are required, a developer may want to track the progress of messages in flight. To track the progress of messages in flight, use the worm CLI tool's status
subcommand.
A tutorial that covers message passing across EVM environments
A tutorial that covers token transfer across EVM environments
On chain, a smart contract interacts with the to send and receive messages.
To receive a message using the Standard Relayer
feature, the target contract must implement the interface.
See the for installation and usage.
Reference documentation for EVM chains is available