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

feat: begin integration of IBC with transfer module #1162

Merged
merged 17 commits into from
Oct 16, 2024

Conversation

emccorson
Copy link
Collaborator

@emccorson emccorson commented Oct 4, 2024

This is the first attempt at integration the prototype IBC form with the transfer module.

Some caveats:

  • Only transparent transfers are working
  • We still need to set the channel ID manually for now
  • Assets will take some time to load after the chain has been selected

Testing

Namadillo settings

Indexer: https://indexer.public.heliax.work/internal-devnet-44a.1bd3e6ca62
RPC: https://proxy.public.heliax.work/internal-devnet-44a.1bd3e6ca62

IBC transfer to Namada settings

Source channel: channel-4353
Destination channel: channel-0
(Note: destination channel is only needed for transfers to shielded accounts)

Instructions

  1. Go to Namadillo settings -> advanced, and make sure "Enable Testnets" is checked
  2. Go to /settings/features and check "IBC Transfers"
  3. Make sure you have ATOM for the Cosmos testnet (theta-testnet-001) in Keplr
  4. Go to the Namadillo IBC Transfer page
    a. Enter the source and destination channel IDs as above
    b. Select the Cosmos testnet (the one called "[DEPRECATED] Cosmos Hub...")
    c. Wait for assets to load and then select "Cosmos"
    d. Enter an amount
    e. Select "Transparent" for the Namada account
    f. Click "Submit" and approve the Keplr popup
  5. After a few seconds, check your ATOM was received in Namada with:
namadac balance \
    --owner <your address> \
    --token transfer/channel-0/uatom \
    --node https://proxy.public.heliax.work/internal-devnet-44a.1bd3e6ca62

const asset = assetList.assets.find(
(asset) => asset.base === current.denom
);
if (!asset) return prev;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we'll still want to display an asset even if we don't have information for it in the asset list. For example, NAM isn't going to show up in the asset list (although actually maybe we could add it), but we still want to support transferring NAM over IBC.

The easiest thing to do here might be to change TransferModule to specify the properties it needs for assets e.g. instead of Asset, use Pick<Asset, "name" | "base"> or something like that. Then we can more easily construct what the TransferModule needs in these cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this might be a bigger problem, because if the asset is not known in the asset list, maybe we will need to query some of its info from somewhere. Can we separate this into a new issue?


type QueryFn<T> = (rpc: string) => Promise<T>;

export const queryAndStoreRpc = async <T>(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is cool! I think you're right about using the RPCs sequentially instead of randomly. Just from brief testing, it seems hit or miss whether an RPC will actually work (and I'm hoping they are ordered roughly by reliability).

Copy link
Contributor

@euharrison euharrison left a comment

Choose a reason for hiding this comment

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

I'm able to do an IBC transfer 🚀
https://explorer.polypore.xyz/theta-testnet-001/tx/495021E251E23B3B9C619F91383114DFBE654185106FBDF1142F1AEB93BDF416

I believe we can do more upgrades on future PRs

@pedrorezende pedrorezende merged commit 08c7e2d into main Oct 16, 2024
10 checks passed
@pedrorezende pedrorezende deleted the ibc-integration-2 branch October 16, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants