AsyncStateRegistry
Overview
AsyncStateRegistry
is a smart contract that extends BaseStateRegistry
and is used to support two-step cross-chain actions (deposits & withdrawals) in Superform. Vaults implementing the ERC-7540, including Centrifuge, will use this state registry.
Core Concepts
Inheriting from BaseStateRegistry,
this contract contains logic similar to CoreStateRegistry for sending and receiving payloads.
The initial deposit request is handled by the CoreStateRegistry
This state registry handles subsequent actions and has minting rights to mint superpositions corresponding to the ERC7540Form.
This contract has a standard request configuration updated on each incoming deposit / redeem request. For example, suppose there are two transactions where the user requests to deposit to a vault, first with retain4626
and second without retain4626
. In that case, the requested value gets minted to their address on the destination without the retain4626
flag when it is available to deposit.
updateRequestConfig
Updates the request configuration for a user and superform. It sets various parameters such as srcChainId,`requestId`
, etc. This gets updated for every incoming request, and the latest request configuration is considered the final configuration for all the previously requested actions.
name | description |
---|---|
type_ | The |
srcChainId_ | The origin chain of the request |
isDeposit_ | Flag indicating if the request type is deposit / redeem |
requestId_ | The unique ID of the request |
data_ | Request specific data that comes from the form |
claimAvailableDeposits
This function claims the deposits made available for the user to claim.
name | description |
---|---|
user_ | The |
superformId_ | The |
claimAvailableRedeem
This function redeems the shares that are available to redeem after requesting redemption.
name | description |
---|---|
user_ | The |
superformId_ | The |
updatedTxData_ | The |
receiveSyncWithdrawTxDataPayload
This function is used to process the synchronous withdrawal requests of DEPOSIT_ASYNC
form if it requires a txData
update.
Superform allows users to specify only the withdrawal intent, like the final token and final destination chain and allows the processor to generate the txData
on-demand to prevent slippage-related issues. This function is not invoked if the user provides the txData
themselves.
name | description |
---|---|
srcChainId_ | The |
data_ | The cross-chain withdrawal data passed in from the ERC7540 Form. |
processSyncWithdrawWithUpdatedTxData
This function helps the async state registry processor to complete payloads received via the receiveSyncWithdrawTxDataPayload
with an updated txData
.
name | description |
---|---|
payloadId_ | The unique identifier of the received sync withdraw payload |
txData_ | The |
getRequestConfig
It helps retrieve the latest request configuration of a user per performed.
name | description |
---|---|
user_ | The wallet address of the user |
superformId_ | The unique identifier of the superform to query its request config for |
getSyncWithdrawTxDataPayload
It helps retrieve the withdraw tx data payload (for DEPOSIT_ASYNC
7540Form).
name | description |
---|---|
payloadId_ | The unique identifier assigned to every payload upon its delivery. |
syncWithdrawTxDataPayloadCounter
Returns the number of sync withdraw payloads received by the async state registry.
Last updated