CoreStateRegistry
Last updated
Last updated
CoreStateRegistry
implements and extends BaseStateRegistry
and is used by core contracts to fulfill cross-chain deposits to all Forms and cross-chain withdrawals from vaults contained in ERC4626Form
.
This function allows the core contracts to send messages (payloads) to state registries on other chains. The entire message is sent to the first ambId
in the index via _dispatchPayload
and for chains that support more than one AMB, the proof of the message is sent to the other ambIds
in the index via _dispatchProof
. The user must supply at least 1 + the Quorum (typically 1) required ambIds
.
name | description |
---|---|
receivePayload
This function allows state registries to receive messages (payloads) from AMB implementations on other chains. Depending on the size of the message, this is handled differently as either a full payload or a proof.
processPayload
This function allows any appropriately permissioned actor to process payloads on the state registry.
There are multiple gated functions in the CoreStateRegistry contract.
CORE_STATE_REGISTRY_UPDATER_ROLE
may update parameters within pre-defined ranges by the user on deposits and withdrawals in updateDepositPayload
and updateWithdrawPayload
CORE_STATE_REGISTRY_PROCESSOR_ROLE
may process payloads in processPayload
CORE_STATE_REGISTRY_RESCUER_ROLE
may propose the amount of tokens that can be rescued in proposeRescueFailedDeposits
CORE_STATE_REGISTRY_DISPUTER_ROLE
may, in addition to the user whose tokens were in question, dispute the amount of funds proposed to be rescued during the time window in disputeRescueFailedDeposits
At this time, both of these roles are executed by Superform infrastructure but will be removed as the protocol decentralizes.
On deposits, the amount of token being received on the destination chain can only be updated within a certain range. The range is determined by what the caller specified they intended to receive in submitting the Superform Request.
Updates a payload once transactions are confirmed to finalize the amount of tokens received on the destination chain before processing the deposit.
Updates a payload that corresponds to a multi-vault withdrawal with liquidity data if the user didn't submit any liquidity data. This increases the chance of successful withdrawals and still maintains security validations on-chain to ensure the correct tokens are received back to the user.
There are 4 steps involved in rescuing funds from stuck payloads.
View all failed deposits for a given payload id
CoreStateRegistryRescuer
must propose the amount of tokens to be rescued for a user for a payload id
There is a set amount of time to dispute this number
If not disputed in that timeframe by user or CoreStateRegistryDisputer
, anybody can rescue the payload, sending funds back to the dstRefundAddress
.
Allows anyone to see which deposits in a payload have failed.
Allows RESCUER
to propose the amount of tokens that should be rescued for a given payloadId.
Allows the initial user and DISPUTER
to challenge the final receiving token amounts on failed deposits if within the challenge time window.
Allows anyone to finalize the amount of tokens to be received after the challenge period is over.
name | description |
---|---|
name | description |
---|---|
name | description |
---|---|
name | description |
---|---|
name | description |
---|---|
name | description |
---|---|
name | description |
---|---|
name | description |
---|---|
srcSender_
address to be refunded if overpaid
ambIds_
uint8[] array of the AMB ids
dstChainId_
uint64 EVM chainId
message_
bytes payload to be sent
extraData_
bytes extraData
if override is needed
srcChainId_
uint64 is the EVM chainId
from which the payload is dispatched/sent
message_
bytes payload to receive
payloadId_
uint256 of the payloadId
to process
payloadId_
uint256 payloadId
assigned on the dstChain
that needs to be updated
finalTokens_
address[] array of the final tokens received to deposit into the vault (should match vault token)
finalAmounts_
uint256[] array of the amounts of the tokens that were received that should be deposited into the vault. For single vault payloads the array must contain only one value.
payloadId_
uint256 payloadId
assigned on the dstChain
that needs to be updated
txData_
bytes[] of transaction data that the payload must be updated with. For single vault payloads the array must contain only one value.
payloadId_
uint256 payloadId
in question
payloadId_
uint256 payloadId in question
proposedAmounts_
uint256 array of proposed amount of tokens to be withdrawn
payloadId_
uint256 payloadId in question
payloadId_
uint256 payloadId in question