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

overview of interop ERC20 support #88

Closed
jakim929 opened this issue Aug 8, 2024 · 0 comments
Closed

overview of interop ERC20 support #88

jakim929 opened this issue Aug 8, 2024 · 0 comments

Comments

@jakim929
Copy link
Contributor

jakim929 commented Aug 8, 2024

Context

#82
Goal: provide context / coalesce interop ERC20 efforts so we can decide what features to build into supersim

Different types of tokens

source https://www.notion.so/defi-wonderland/Extending-SuperchainERC20-to-L2-native-tokens-and-custom-e91ca08dd3eb4434834bf74f56237abf

Screenshot 2024-08-08 at 10 19 21 PM
  1. standard L1 bridged: this is the primary focus right now, and has been specced out mostly
  2. standard L2 native
  3. custom L1 bridged: ie. uses a special bridge / escrow
  4. custom L2 native

Overview of specs / implementations so far

SuperchainERC20

  • specs: https://specs.optimism.io/interop/token-bridging.html#interface
  • High level interface for all interoperable ERC20
  • Specified that it should be built on top of the L2ToL2CrossDomainMessenger for messaging capabilities
  • functions
    • sendERC20(address _to, uint256 _amount, uint256 _chainId)
    • relayERC20(address _from, address _to, uint256 _amount)
  • events
    • event SendERC20(address indexed from, address indexed to, uint256 amount, uint256 destination)
    • event RelayERC20(address indexed from, address indexed to, uint256 amount, uint256 source)

OptimismSuperchainERC20

  • impl: OptimismSuperchainERC20
  • implements the SuperchainERC20 interface
  • bridged version of an L1 native token
  • allows the L2StandardBridge to burn / mint tokens on interop
  • also allows burning / minting when sendERC20 / relayERC20 is called
  • post interop, ALL L1 native tokens will have two representations on the L2: OptimismMintableERC20 and OptimismSuperchainERC20

SuperchainERC20 factory

L2StandardBridge upgrade: Liquidity migration

  • specs: interop: liquidity migration specs specs#294
  • Upgrades the L2StandardBridge to support the following function convert(address _from, address _to, uint256 _amount)
    • allows between existing OptimismMintableERC20 <> OptimismSuperchainERC20 using the L2StandardBridge
  • This is how an existing L2 ERC20 based on a L1 native ERC20 will be upgraded to be interoperable

SuperchainWETH

Notes

  • The primary focus currently is support for L1 native, deposited ERC20s
  • We'll need better tooling (CLI?) for handling multi-chain deployments (for ERC20 contracts)
    • the factories will use CREATE3 to create deterministic addresses across chains
    • ideally something like supersim deploy --all MyContract.sol
  • The contracts (OptimismSuperchainERC20, OptimismSuperchainERC20Factory, new L2StandardBridge) are still in development, we should wait until they are finalized before using it
  • We're still unable to import the monorepo contracts and build it inside supersim foundry environment. This will hinder our ability to tweak / build on top of the existing contracts
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

No branches or pull requests

1 participant