Solution For Omniwithdraw
Step 1: Preparation and Route Selection
The user selects Blast vaults to withdraw from, a target token, and the amount to withdraw from each vault.
Routes are requested from the
Allspark API
.A route is selected by the user.
The user approves the Allspark voucher contract to burn selected vouchers if necessary.
Step 2: Burning Allspark Vouchers and Sending Data
The user calls the
blastChainVaultWithdraw
function to burn the designated amount of Allspark vouchers.Allspark Router generates a payload and proof containing
blastVaultSFData
and callsdispatchPayload
to send them via the specified AMBs.The Allspark Router sends the cross-chain payment to the
allsparkPay
contract on the source chain.
Step 3: Receiving Data and Token Withdrawal
Payload and payload proof are received by the
blastStateRegistry
on the destination chain.The processor keeper calls
processPayload
to trigger the withdrawal of underlying tokens from the target vault.At this point, underlying tokens can be swapped into the target token if it's not the underlying token.
If the target token is on another chain, the tokens will be bridged to the target chain; otherwise, they'll be sent to the user's address on the Blast chain.
Step 4: Receiving Tokens on the Target Chain
If the target chain is different from the blast chain, tokens will be received by the user directly from the bridge contract after bridging completes.
Last updated