Skip to content

feat: determine function to bridge back #9

@thomas779

Description

@thomas779

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    MPMedium Priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions