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
  • CoreStateRegistryPayloads
  • StateSyncerPayloads
  • TimeLockPayloads

Was this helpful?

  1. Core Contracts
  2. State Registries

PayloadHelper

Last updated 7 months ago

Was this helpful?

Introduction

PayloadHelper facilitates the decoding of various types of payload data Superform sends between chains. This helper is not called in Superform core contracts, and doesn't serve a purpose in the protocol, but it enriches data hosted in and verifies off-chain processing by Keepers. Third party integrators can use PayloadHelper to extract and understanding payload information.

Core Concepts

There are 3 kinds of payloads associated with Superform at the moment:

  1. CoreStateRegistryPayload: payloads that originated from the chain's

  2. StateSyncerPayload: payloads associated with the transaction history on any implementation

CoreStateRegistryPayloads

decodeCoreStateRegistryPayload

This function decodes payloads that arrived to the source chain's .

function decodeCoreStateRegistryPayload(
    uint256 dstPayloadId_
) external view returns (
    uint8 txType,
    uint8 callbackType,
    address srcSender,
    uint64 srcChainId,
    uint256[] memory amounts,
    uint256[] memory slippages,
    uint256[] memory superformIds,
    bytes memory hasDstSwaps,
    bytes memory extraFormData,
    address receiverAddress,
    uint256 srcPayloadId);

decodeCoreStateRegistryPayloadLiqData

function decodeCoreStateRegistryPayloadLiqData(
    uint256 dstPayloadId_
) external view returns (
    uint8[] memory bridgeIds,
    bytes[] memory txDatas,
    address[] memory tokens,
    address[] memory interimTokens,
    uint64[] memory liqDstChainIds,
    uint256[] memory amountsIn,
    uint256[] memory nativeAmounts);

StateSyncerPayloads

decodePayloadHistory

Decodes basic transaction information for transactions that left SuperformRouter.

function decodePayloadHistory(
    uint256 srcPayloadId_,
) external view returns (
    uint8 txType,
    uint8 callbackType,
    uint8 isMulti,
    address srcSender,
    uint64 srcChainId);

TimeLockPayloads

decodeTimeLockPayload

This function decodes payloads where the timelock was successfully sent from source to destination.

function decodeTimeLockPayload(
    uint256 timelockPayloadId_
) external view returns (
    address srcSender,
    uint64 srcChainId,
    uint256 srcPayloadId,
    uint256 superformId,
    uint256 amount);

decodeTimeLockFailedPayload

This function decodes payloads where the timelock failed and was messaged back to the source chain.

function decodeTimeLockFailedPayload(
    uint256 timelockPayloadId_
    ) external view returns (
        address srcSender,
        uint64 srcChainId,
        uint256 srcPayloadId,
        uint256 superformId,
        uint256 amount);

This function decodes the associated associated with any given payload that arrived to the chain's .

Subgraphs
CoreStateRegistry
SuperformRouter
CoreStateRegistry
CoreStateRegistry
Liquidity Request