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

Missing ERC20 Functionality #124

Open
6 tasks
roninjin10 opened this issue Oct 3, 2023 · 0 comments
Open
6 tasks

Missing ERC20 Functionality #124

roninjin10 opened this issue Oct 3, 2023 · 0 comments
Labels
state: backlog This is pending further review type: enhancement New feature or request

Comments

@roninjin10
Copy link
Contributor

roninjin10 commented Oct 3, 2023

Context

The following functionality is missing from the ERC20 story

Major missing functionality

  • Add native l2 tokens support- Native l2 tokens require using one of the bridgeERC20 methods rather than a withdraw. Withdraw is only for mintable tokens not native tokens
  • Deposit token is unsafe - It's easy to lose tokens depositing with the current method because no validation is happening to validate the token is bridgable. At a minimum we should documenting this. Note this is kinda tricky. Validating a mintable token withdrawal is simple since it's all done on l2. Validating an l1 deposit matches l2 is less simple as it requires an l2 public client. The correct solution for now is to document it until higher level multiclient aware abstractions are made
  • No legacy withdrawal support - Prebedrock withdrawals on OP mainnet do not have any support. Pre bedrock withdrawals are not 1559 therefore require extra work to get working encoding and decoding.

Minor missing functionality

  • Add documentation about how to reliably get the bridge and token info from a token address - To use the erc20 bridge well one should be getting the l1 and l2 token info and the bridge info from the l2 token or from the tokenlist
// example
const l2BridgeAddress = l2MintableToken.l2Bridge()
const l1TokenAddress = l2MintableToken.l1Token()

client.withdrawERC20({
  ...sameOptionsAsBefore,
  address: l2BridgeAddress,
  • Add action for getting token info - It would be nice if viem had a native way of getting stuff like the bridge address and matching token too

  • No preregensis support - preregenisis are before the version of optimism that was before bedrock. My suggestion is to not support this completely but simply add a single sentence to the docs about this not being supported.

@wbnns wbnns added state: backlog This is pending further review type: enhancement New feature or request labels Oct 4, 2023
@zencephalon zencephalon removed their assignment Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: backlog This is pending further review type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants