Migrating $BIT to $MNT on Goerli

With the v0.4.0 update on June 9, 2023, we have created a new $MNT token contract on Goerli, since $MNT will serve as the native token of the Mantle ecosystem moving forward. The $BIT contract remains unchanged.

Here’s a list of contract addresses on Goerli that we’ll interact with in this guide:

In this short guide, we’ll go over how to migrate your test $BIT to $MNT on Goerli. This is to enable access to $MNT for developers and teams with existing dApps on Goerli testnet that utilize $BIT.

We recommend users without developer experience to wait for the official migration tool to go live and use that to migrate tokens instead!

Step 1: Install Foundry and Cast

The first step would be to install Foundry, since we’re going to be using a command line tool, which is part of the foundry developer toolkit, called cast to initiate $BIT approval transactions.

  1. Follow this link to install Foundry: https://book.getfoundry.sh/getting-started/installation

  2. To confirm cast is correctly installed, run this command:

cast --version

If cast was installed correctly, it will print out the current version, like this:

cast 0.2.0 (6cd6618 2022-08-11T00:05:44.416299Z)

Step 2: Get an API Key

Once we've installed Foundry, we need to obtain an API key for a Goerli RPC node provider. For this guide, we'll use Infura.

  1. Click this link and login to the Infura dashboard: https://app.infura.io/login

  2. Create an API Key by clicking the “Create new API Key” button, then select “Web3 API” from the Network dropdown menu.

  1. After entering the name of your key, move to the “Endpoints” tab where you’ll see your API Key!

Copy and save it somewhere! You'll need it for the next step.

Step 3: Approve $BIT Spending for Migration Contract

Now, use the following command to send a transaction to approve $BIT spending for the migration contract. You'll need to replace the arguments with your wallet address containing the $BIT tokens, private key, the amount of $BIT you want to approve, and your API key.

Note that the amount of $BIT needs to be specified in wei, which means 1 $BIT will need to be specified as 10^18, or 1 followed by 18 zeroes. You can use this tool for an accurate conversion.

The amount you pass here is important because this is the maximum amount of $BIT the migration contract will be able to migrate.

Make sure your wallet has sufficient $gETH to send this transaction

cast send --from "your address" --private-key "your private key" 0x5a94dc6cc85fda49d8e9a8b85dde8629025c42be "approve(address,uint256)" 0x144D9B7F34a4e3133C6F347886fBe2700c4cb268 “amount” --rpc-url https://goerli.infura.io/v3/"your api key"

Upon running the command, you'll see a response like the following:

Step 4: Migrate $BIT to $MNT

We can call the migration contract from Etherscan.

  1. Follow the link below to navigate to the migration contract on Etherscan.

  1. Connect your wallet to the webpage.

  2. You can now use the migrateAllBIT function is you've approved all the available $BIT in your wallet. To specify an amount, use the migrateBIT function and enter the amount in wei. This means 1 $BIT will be denoted as 10^18, or 1 followed by 18 zeroes. You can use this tool for an accurate conversion. Use the "+" button to select and enter an initial value automatically.

  3. Click on the write button to send the transaction.

Once the transaction is sent out successfully, you'll see the $MNT balance update in your wallet.

If you don't see the balance updates, make sure you're connected to Goerli and have imported the $MNT token to your wallet. If you haven't, you can do so using the $MNT token contract address: 0xc1dC2d65A2243c22344E725677A3E3BEBD26E604

Last updated