WormholeSRImplementation

Introduction

WormholeSRImplementation is a BroadcastAmbImplementation used in BroadcastRegistry and is the data layer by which messages on one chain can be broadcast to multiple chains.

You can read more about Wormhole's Specialized Relayer (SR) here: https://docs.wormhole.com/wormhole/explore-wormhole/relayer#specialized-relayers

Core Concepts

setWormholeCore

This function allows the ProtocolAdmin role to configure the Wormhole core contract for the respective chain found here: https://docs.wormhole.com/wormhole/blockchain-environments/contracts

function setWormholeCore(
    address wormhole_
) external onlyProtocolAdmin

broadcastPayload

This function implements the function in BroadcastAmbImplementation and publishes a message to Wormhole.

function broadcastPayload(
    address srcSender_,
    bytes memory message_,
    bytes memory extraData_
) external payable virtual

receiveMessage

This function allows roles that are Wormhole VAA Relayers to receive messages in Wormhole. Despite being public, the function will revert if the caller of this function is not a Relayer.

function receiveMessage(
    bytes memory encodedMessage
) public

setChainId

This function allows the ProtocolAdmin to add new chain ids based on the mapping in Wormhole.

function setChainId(
    uint64 superChainId_, 
    uint16 ambChainId_)
external onlyProtocolAdmin

setFinality

This function allows the ProtocolAdmin to set the required finality level on the source chain for message broadcasting.

function setFinality(
    uint8 finality_
) external onlyProtocolAdmin

Last updated