Skip to content
Lattice

IWormholeRelayer

Git Source

Title: IWormholeRelayer / IWormholeReceiver

Author: Vendored minimal subset of the Wormhole Solidity SDK

(https://github.com/wormhole-foundation/wormhole-solidity-sdk). Upstream license: Apache-2.0. Only the methods the WormholeGatewayAdapter calls/implements are re-declared. Vendored subset — do not add a wormhole-solidity-sdk dependency.

IWormholeRelayer is the standard relayer (send + quote); IWormholeReceiver is the callback the relayer invokes on delivery. Addresses are Wormhole "universal" 32-byte addresses.

Functions

sendPayloadToEvm

Request delivery of payload to targetAddress on targetChain (Wormhole chain id).

function sendPayloadToEvm(
        uint16 targetChain,
        address targetAddress,
        bytes calldata payload,
        uint256 receiverValue,
        uint256 gasLimit,
        uint16 refundChain,
        address refundAddress
    ) external payable returns (uint64 sequence);

Parameters

NameTypeDescription
targetChainuint16
targetAddressaddress
payloadbytes
receiverValueuint256
gasLimituint256
refundChainuint16
refundAddressaddress

Returns

NameTypeDescription
sequenceuint64

quoteEVMDeliveryPrice

Quote the native cost of an EVM delivery with gasLimit + receiverValue to targetChain.

function quoteEVMDeliveryPrice(uint16 targetChain, uint256 receiverValue, uint256 gasLimit)
        external
        view
        returns (uint256 nativePriceQuote, uint256 targetChainRefundPerGasUnused);

Parameters

NameTypeDescription
targetChainuint16
receiverValueuint256
gasLimituint256

Returns

NameTypeDescription
nativePriceQuoteuint256
targetChainRefundPerGasUnuseduint256