PayMaster
Last updated
Last updated
PayMaster
handles payment and relayer cost management for crosschain transactions. Callers pay in native tokens on the source chain directly through SuperformRouter entry functions (_forwardPayment
) and this payment is used to fund Keepers making cross-chain transactions including retrying of messages. To rebalance funds across chains when they get low, PayMaster
integrates LiquidityHandler
.
While estimations try to estimate the amount paid in SuperformRouter as accurately as possible, it is possible that transactions are underpaid, especially in custom integrations not using the Superform API. Underpaid transactions will become stuck. Users can pay more native tokens to PayMaster
on any chain Superform supports through the makePayment()
function by specifying which address the payments should be used for. Once completed, Superform Keepers will recognize this and attempt to retry the action.
user_
Address of the user to make a payment for
Payments can only be withdrawn by the Superform PaymentAdmin
and tokens can only be sent to core infrastructure in the Superform ecosystem, associated with a hashed superRegistryId.
This function is utilized to withdraw native tokens from PayMaster
to the appropriate contract on the same chain.
superRegistryId_
bytes hash of the superRegistryId
nativeAmount_
Amount of the native token to withdraw
These functions are used to withdraw and bridge native tokens from PayMaster to the appropriate contract on other chains. Bridge Validators ensure that bridged data sends funds to the intended contract.
superRegistryId_
bytes id of the superRegistryId
liqRequest
dstChainId_
uint64 EVM chain ID of where the funds are going
The retrying of messages, either payloads or proofs, is specific to the AMB implementation and can be triggered by users directly in AMB Implementations.
This function allows PaymentAdmin
to use funds in PayMaster
to retry messages automatically.
ambId_
nativeValue_
uint256 native tokens to send in the transaction
data_
struct
uint8 AMBid
of the
bytes data specific to the required to retry the message