polytope-labs / hyperbridge

Hyperbridge is a hyper-scalable coprocessor for cryptographically secure, cross-chain interoperability

Home Page:https://docs.hyperbridge.network/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gateway `ERC20` support

seunlanlege opened this issue · comments

Gateway should be able to support the ERC6160 standard as well as the ERC20 standard through token swaps. If a user bridges an ERC20 token that has no ERC20 counterpart on the destination chain, they should get an ERC6160 token. On the other hand if a counterpart exists, the relayers should double as liquidity providers and facilitate the token swap. Relayers after providing liquidity should get the ERC6160 counterpart that they can use to withdraw the ERC20 token locked on the source chain.

onRequestTimeout we should either refund the custodied ERC20 or mint the ERC6160 asset back to the user. Allowing them retry the cross-chain teleportation.

Because ISMP charges protocol fees in it's configured feeToken, Gateway should allow users swap either the native asset or an ERC20 for the feeToken asset through some local AMM required to cover their fees.

Mostly implemented, just needs tests

Finalized in #153