mantle-tutorial

Bridging your Standard ERC20 token to L2 using the Standard Bridge

This is a practical guide to getting your ERC20 token deployed on L2 and bridging it using the Standard Bridge implementation.

For an L1/L2 token pair to work on the Standard Bridge the L2 token contract has to implement IL2StandardERC20.

Deploying a standard token

If there is no need for custom logic on Mantle, it’s easiest to use the standard token, available as the L2StandardERC20 contract as part of the @mantleio/contracts package.

Configuration

  1. Install the necessary packages.

    yarn
    

    Running the deploy script

  2. Run the script:

    yarn local
    

The script uses our token factory contract OVM_L2StandardTokenFactory available as a predeploy at 0x4200000000000000000000000000000000000012 to deploy a standard token on L2.

Deploying a Custom Token

When the L2StandardERC20 implementation does not satisfy your requirements, we can consider allowing a custom implementation. See this tutorial on getting a custom token implemented and deployed

Testing

For testing your token, see tutorial on depositing and withdrawing between L1 and L2.