-
Notifications
You must be signed in to change notification settings - Fork 3
Add final settlement phase for onramps. #1026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for vortex-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vortexfi ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ebma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far 👍
|
|
||
| const txData: EvmTransactionData = { | ||
| data: transferCallData as `0x${string}`, | ||
| gas: "100000", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this always the right amount we need?
| unsignedTxs.push({ | ||
| meta: {}, | ||
| network: toNetwork, | ||
| nonce: 0, // TODO nonce is NOT 0 if destination is Moonbeam itself, fix this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But Moonbeam can never be the final destination so it doesn't matter or am I misunderstanding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, dismiss the comment then.
| const multiSignedTxs = await signMultipleEvmTransactions(tx, client, tx.nonce); | ||
| const primaryTx = multiSignedTxs[0]; | ||
| const txWithMeta = addAdditionalTransactionsToMeta(primaryTx, multiSignedTxs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this part, why are we only adding the first transaction to the meta?
| phaseRegistry.registerHandler(pendulumToHydrationXcmPhaseHandler); | ||
| phaseRegistry.registerHandler(hydrationToAssethubXcmPhaseHandler); | ||
| phaseRegistry.registerHandler(hydrationSwapHandler); | ||
| phaseRegistry.registerHandler(finalSettlementSubsidy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are missing the registration of the other handler.
| [EvmToken.AXLUSDC]: { | ||
| assetSymbol: "axlUSDC", | ||
| decimals: 6, | ||
| erc20AddressSourceChain: "0x....", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not have a proper address here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't find one yet! Must exist.
| amountRaw: finalAmountRaw.toString(), | ||
| destinationNetwork: toNetwork as EvmNetworks, | ||
| toAddress: evmEphemeralEntry.address, | ||
| toAddress: destinationAddress, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep the evmEphemeralEntry.address as the destination of this backup transfer. If we do, we can try the squidrouter backup an infinite number of times (or at least as many times as we have backups with higher nonces). If we send it to the destination, we risk the swap failing again and then the funds are stuck on the destination instead of the ephemeral again.
No description provided.