Skip to content
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

Api for moonbeam integration #1367

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Api for moonbeam integration #1367

wants to merge 8 commits into from

Conversation

yrong
Copy link
Contributor

@yrong yrong commented Jan 22, 2025

Resolves: https://linear.app/snowfork/issue/SNO-1265
Just a thin wrapper on top of Moonbeam's xcm precompile

@yrong yrong marked this pull request as ready for review January 23, 2025 04:45
@yrong yrong requested a review from alistair-singh January 23, 2025 05:21
Copy link
Contributor

@alistair-singh alistair-singh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am happy with these changes. Great work. However maybe we can support this transfer with a simple Ethers.js abi interface instead of a separate package.

https://docs.ethers.org/v6/getting-started/#starting-contracts

abi = [
  "function decimals() view returns (string)",
  "function symbol() view returns (string)",
  "function balanceOf(address addr) view returns (uint)"
]

// Create a contract
contract = new Contract("dai.tokens.ethers.eth", abi, provider)

This means that moonbeam can just be a module in the existing API package.

@yrong
Copy link
Contributor Author

yrong commented Jan 23, 2025

Support this transfer with a simple Ethers.js abi interface

Does that imply you prefer to add another high-level precompile on top of the original one into Moombeam's code base?

@alistair-singh
Copy link
Contributor

Support this transfer with a simple Ethers.js abi interface

Does that imply you prefer to add another high-level precompile on top of the original one into Moombeam's code base?

Can we simply use untyped bindings like so?

let abi = [
  "transferAssetsUsingTypeAndThenAddress((uint8,bytes[]),(address,uint256)[],uint8,uint8,uint8,bytes)",
]
const xcmInterfacePrecompile = "0x000000000000000000000000000000000000081A"
let contract = new Contract(xcmInterfacePrecompile, abi, provider)

const tx = await contract[
        "transferAssetsUsingTypeAndThenAddress((uint8,bytes[]),(address,uint256)[],uint8,uint8,uint8,bytes)"
    ](dest, assets, assetTransferType, remoteFeesIdIndex, feesTransferType, customXcmOnDest)

@yrong
Copy link
Contributor Author

yrong commented Jan 24, 2025

@alistair-singh Move the api into the existing API package in
9cbcf5e

@yrong yrong force-pushed the ron/moonbeam-integration branch from 7253bb0 to 9cbcf5e Compare January 25, 2025 02:15
@yrong yrong requested a review from alistair-singh January 25, 2025 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants