-
Notifications
You must be signed in to change notification settings - Fork 74
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
J2 mrl #707
J2 mrl #707
Conversation
thanks @jboetticher !! |
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.
just had a few questions on this!
--8<-- 'code/mrl/transfer-multiassets.js' | ||
``` | ||
|
||
To generate the second end of the transaction (remote EVM call), you need both the EVM transaction and the XCM instructions that executes said EVM transaction. The EVM transaction can be constructed as a transaction that interacts with the [batch precompile](/builders/pallets-precompiles/precompiles/batch){target=_blank} so that two transactions can happen in one. This is helpful because this EVM transaction has to both approve the xLabs relayer to relay the ERC-20 token as well as relay action itself. |
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.
can this be any relayer?
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.
Yes, any relayer. Relayers are trustless
const moonbeamProvider = new WsProvider(MOONBEAM_CHAIN_WS_ENDPOINT); | ||
const moonbeamAPI = await ApiPromise.create({ provider: moonbeamProvider }); | ||
|
||
const ethereumTx = await batchApproveTransferTx(moonbeamAPI); |
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.
this is calling the function created in the evm-tx.js file, right?
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.
Yes. They're meant to be sequential but combined
{ V3: { parents: new BN(1), interior: { X1: { Parachain: 1000 } } } }, | ||
{ | ||
V3: [ | ||
// Withdraw DEV asset (0.06) from the target account |
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.
why 0.06 DEV? does this number come from somewhere specific?
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.
No, it's a slight overestimation for what is required. It's just enough to pay for EVM tx gas and XCM fees
|
||
If you would like to see an example script that fully implements this, an example is available in a [GitHub repository](https://github.com/jboetticher/mrl-reverse){target=_blank}. | ||
|
||
It’s important to note that not every parachain will have xTokens and the other pallets implemented in a way that will allow this path. Substrate-based chains are very flexible, to the point where a standard doesn’t exist. If you believe your parachain does not support this path, please provide an alternative solution in the Moonbeam forum and to the Wormhole team. |
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 there a preferred contact method for the Wormhole team?
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.
Not sure. You could reach out directly through telegram or discord, but the best way is potentially through us instead of directly to the Wormhole team.
|
||
While Wormhole has the technical capability to bridge any token across chains, relayers will not support every token for fees. The ERC-20 assets that can be bridged through Wormhole's MRL solution are dependent on the tokens that the [xLabs relayer](https://xlabs.xyz/){target=_blank} takes in. The tokens that are available to Moonbeam are listed in the table below: | ||
|
||
| Token Name | Address | |
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.
these are just addresses for Moonbeam, right? what about Moonriver and Moonbase?
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 believe Moonriver is supported. Unsure of what is supported for Moonbase Alpha, as their relayer doesn't necessarily do testnet transactions in my experience. I have asked.
const WrappedFTM = new ethers.utils.Interface(abi.IERC20); | ||
// https://github.com/wormhole-foundation/example-token-bridge-relayer/blob/main/evm/src/token-bridge-relayer/TokenBridgeRelayer.sol | ||
const TokenRelayer = new ethers.Contract( | ||
XLABS_RELAYER_ADDRESS, |
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.
what is the xLabs relayer address?
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.
Moonbase Alpha: 0x9563a59c15842a6f322b10f69d1dd88b41f2e97b
Moonbeam: 0xcafd2f0a35a4459fa40c0517e17e6fa2939441ca
Description
Adds documentation on MRL for parachains who want to start an integration.
Checklist
moonbeam-docs-cn
repo, I have created a ticket for the translations in JiraCorresponding PRs
Please link to any corresponding PRs here.
After Translation Requirements
moonbeam-docs
repo to remove imagesmoonbeam-docs
repo to remove variablesmoonbeam-mkdocs
repo to add redirects for Chinese siteItems to be Updated
Please list any of the items that will need to be added or deleted after the translations are done here.