Superform v1
  • Introduction
  • Components
    • Protocol
    • Keepers
    • API
    • App
  • E2E Flows
    • Same-chain Deposit
    • Cross-chain Deposit
    • Same-chain Withdrawal
    • Cross-chain Withdrawal
  • Periphery Contracts
    • SuperformRouter
      • SuperformRouterPlus
      • SuperformRouterPlusAsync
    • PayMaster
    • PaymentHelper
    • EmergencyQueue
    • SuperformFactory
    • Forms
      • ERC4626Form
      • ERC5115Form
      • ERC7540Form
    • SuperPositions
      • ERC1155A
    • RewardsDistributor
  • Core Contracts
    • State Registries
      • CoreStateRegistry
      • AsyncStateRegistry
      • PayloadHelper
    • AMB Implementations
      • LayerzeroImplementation
      • LayerzeroV2Implementation
      • WormholeARImplementation
      • HyperlaneImplementation
      • AxelarImplementation
    • Broadcasting
      • BroadcastRegistry
      • WormholeSRImplementation
    • Bridge Validators
      • LiFiValidator
      • SocketValidator
      • SocketOneInchValidator
      • DebridgeValidator (and forwarder)
      • OneInchValidator
    • DstSwapper
    • Settings
      • SuperRBAC
      • SuperRegistry
  • SuperVaults
    • SuperVaults
  • Resources
    • Deployment Addresses
    • Subgraphs
      • Protocol Level Entities
      • Form Related Entities
      • Deposits and Withdrawals
      • SuperPosition Events
      • External Entities
    • Infrastructure Integrations
    • Security & Audits
    • Protocol License
    • Glossary
    • Protocol Multisig
    • Superform Labs Socials
Powered by GitBook
On this page
  • Introduction
  • Core Concepts

Was this helpful?

  1. Core Contracts
  2. Broadcasting

WormholeSRImplementation

Last updated 1 year ago

Was this helpful?

Introduction

WormholeSRImplementation is a BroadcastAmbImplementation used in 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:

Core Concepts

setWormholeCore

This function allows the ProtocolAdmin role to configure the Wormhole core contract for the respective chain found here:

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
name
description

srcSender_

address of the sending contract

message_

bytes message to broadcast

extraData_

bytes extraData to override

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
name
description

encodedMessage

bytes message to read into contract

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
name
description

superChainId_

internal chain id used by the Superform protocol. block.chainid casted to uint64

ambChainId_

uint16 chain id allocated to each chain by Wormhole

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
BroadcastRegistry
https://docs.wormhole.com/wormhole/explore-wormhole/relayer#specialized-relayers
https://docs.wormhole.com/wormhole/blockchain-environments/contracts