PayloadHelper

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 Subgraphs 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 CoreStateRegistry

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

CoreStateRegistryPayloads

decodeCoreStateRegistryPayload

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

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

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

StateSyncerPayloads

decodePayloadHistory

Decodes basic transaction information for transactions that left SuperformRouter.

TimeLockPayloads

decodeTimeLockPayload

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

decodeTimeLockFailedPayload

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

Last updated

Was this helpful?