Skip to content

Abstract contract for exchange native tokens to ERC20 token #292

@minghinmatthewlam

Description

@minghinmatthewlam

Context and scope
Teleporter takes in erc20 tokens as fees, but there are apps that interact primarily with the native token of the subnet. We shouldn't require users to hold other erc20 tokens, or need to figure out which tokens to pay relayers with.

Discussion and alternatives
Idea is to create an abstract contract that Teleporter apps can inherit from, and exchanges the native tokens held for a passed in erc20 token. For example WETH's deposit that has a 1:1 exchange. Then the Teleporter app can use the exchanged erc20 token to pay Teleporter fees.

Open questions

  • The abstract contract should be fixed to one erc20 token, likely passed in from constructor
  • How do we check if the erc20 has a deposit function?
  • Does deposit need to be 1:1
  • Should the abstract call Teleporter directly after exchange the tokens?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog 🧊

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions