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: determine function to bridge back #9

Open
thomas779 opened this issue Nov 22, 2023 · 0 comments
Open

feat: determine function to bridge back #9

thomas779 opened this issue Nov 22, 2023 · 0 comments
Labels
MP Medium Priority

Comments

@thomas779
Copy link
Member

Problem
A user has fungible tokens on both chain A and chain B. This user bridges a token from chain A to chain B, and now they want to bridge it back. How do you determine whether to call bridgeTokens() or bridgeBackTokens() on chain B?

Solution
Given a fungible or non-fungible token, we need to determine whether the token has been bridged or not. This is important so that we don't end up wrapping existing wrapped tokens.

Implementation
Use isWrappedToken() on the origin bridge to prevent fungible tokens from being wrapped. The return response should be Promise<boolean> .

Note
Functions to call
Fungible: bridgeTokens() or bridgeTokensBack()
Non-Fungible: bridgeNonFungibleTokens() or bridgeNonFungibleTokensBack()

@thomas779 thomas779 added the MP Medium Priority label Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MP Medium Priority
Projects
None yet
Development

No branches or pull requests

1 participant