Bridge ERC-20 Tokens
How to deploy and bridge an ERC-20 token from Ethereum to MegaETH using the OP Stack Standard Bridge.
Prerequisites
Contract Addresses
Contract
Chain
Address
Contract
Chain
Address
Steps
1
2
Register the L2 counterpart
cast send $L2_MINTABLE_FACTORY \
"createOptimismMintableERC20(address,string,string)" \
$L1_TOKEN "MyToken" "MTK" \
--rpc-url $L2_RPC \
--private-key $PRIVATE_KEY# Extract the L2 token address from the event logs
# topics[0] is keccak256("OptimismMintableERC20Created(address,address,address)")
# topics[1] is the L2 token address ABI-encoded as a 32-byte padded value; [26:] strips the leading zeros
cast receipt $TX_HASH --rpc-url $L2_RPC --json \
| jq -r '.logs[] | select(.topics[0] == "0x52fe89dd5930f343d25650b62fd367bae47088bcddffd2a88350a6ecdd620cdb") | "0x" + .topics[1][26:]'3
4
Withdrawals (L2 → L1)
Last updated