Cross-chain Withdrawal
Last updated
Was this helpful?
Last updated
Was this helpful?
User selects vaults to withdraw from, a target token, and the amount to withdraw from each vault
User requests routes from the Superform API
User selects a route
User approves the contract to burn selected (if needed)
Atomic phase
Transit phase (non-atomic)
In no particular order
Atomic phase
Processor Keeper calls processPayload
to trigger the redemption of vault shares from the target vault for the underlying tokens
Underlying tokens may be swapped at this point into the target token if the target token is not the underlying token
If the target token is on another chain, the tokens will be bridged to the target chain, otherwise the tokens will be sent to the user’s address on the vault chain
Transit phase
If the target chain was different than the vault chain, tokens will be received by the user directly from the bridge contract after bridging completes
User calls singleXChainSingleVaultWithdraw
. The function burns the user designated amount of . The function parameters are complex; therefore, using the Superform API to generate valid function parameters is encouraged
generates a payload and proof that contains singleVaultSFData
and calls dispatchPayload
to send them via the AMBs specified in the route. This payload contains the desired bridge/swap route and end states (chain, vault, amounts, slippage). Sending liqRequest.txData
on withdrawals is optional; if provided, it will reduce reliance on Superform Keepers, but increase the likelihood of the transaction failing requiring to be re-minted
sends the cross-chain payment to the contract on the source chain
Payload is received by on destination
Payload proof is received by on destination
updateWithdrawPayload
is called by the updater Keeper to provide the with the txData
if it wasn't provided in the payload based on the user intent