Skip to content

docs: add ERC-20 token bridge guide#35

Merged
Troublor merged 4 commits intomainfrom
silas/doc/erc20-bridge-guide
Apr 8, 2026
Merged

docs: add ERC-20 token bridge guide#35
Troublor merged 4 commits intomainfrom
silas/doc/erc20-bridge-guide

Conversation

@SilasZhr
Copy link
Copy Markdown
Contributor

@SilasZhr SilasZhr commented Apr 8, 2026

Summary

  • Adds docs/dev/bridge-erc20.md — a step-by-step developer guide for bridging ERC-20 tokens from Ethereum to MegaETH using the OP Stack Standard Bridge
  • Covers: deploy L1 token, register L2 counterpart via OptimismMintableERC20Factory, approve bridge, call bridgeERC20, verify L2 balance
  • Includes contract addresses for both mainnet and Sepolia testnet in a {% tabs %} block
  • Updates docs/SUMMARY.md to list the new page
  • Adds a cross-link from docs/dev/overview.md's canonical bridge section

Based on the completed implementation in ~/workspace/bridge.

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 8, 2026

Two blocking issues in the code samples — the rest looks good.

Blocking

  1. Broken bash line continuations (inline comment on line 67) — \ followed by spaces and # comment breaks line continuation in all three cast send blocks (steps 2, 3, and 4). The commands won't run as written. Fix: move inline explanations to prose above each block.

  2. Invalid event topic hash (inline comment on line 78) — 0x52fe89dd5930f343d25650b62fd367bae47ef185 is 20 bytes (an address), not 32 bytes. The jq filter will never match. Replace with the correct keccak256 of OptimismMintableERC20Created(address,address,address).

Minor

  • ## Contract Addresses## Contract addresses (sentence case per docs convention — only proper nouns capitalized).
  • Testnet L1 addresses are lowercase hex; mainnet L1 addresses are EIP-55 checksummed. Use a consistent format throughout the table.

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 8, 2026

Review: LGTM — previous threads were incorrect

I've resolved all 5 prior review threads; the concerns they raised don't apply to the current code:

  • ABI signature (uint32 thread): bridgeERC20(address,address,uint256,uint32,bytes) is correct. Position 4 is _minGasLimit, which is uint32 in the OP Stack Standard Bridge — not _amount.
  • Event selector (two threads): The code uses 0x52fe89dd5930f343d25650b62fd367bae47088bcddffd2a88350a6ecdd620cdb — 64 hex chars (32 bytes), correct length for a keccak256 topic. The threads referenced a 20-byte hash that never appeared in this diff.
  • Bash line continuation (two threads): There are no inline # comments after \ in any code block. Clean line continuations throughout.

The guide is structurally correct and ready to merge.

Copy link
Copy Markdown
Collaborator

@Troublor Troublor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SilasZhr shouldn't the bridge ERC20 doc belong to the user doc instead of dev doc? Similar to "Getting Ethers on Mainnet", which is essentially bridging ETH.

Copy link
Copy Markdown
Collaborator

@Troublor Troublor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. It is meant for the dapp developers who wants to bring their token on mainnet to MegaETH.

@Troublor Troublor merged commit 5b62d61 into main Apr 8, 2026
9 checks passed
@Troublor Troublor deleted the silas/doc/erc20-bridge-guide branch April 8, 2026 14:50
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

Successfully merging this pull request may close these issues.

2 participants