Migrate $BIT to $MNT on Goerli for Developers
07/06/234 min read
by Mantle
Developers
Tutorials
Web3

As you probably already know, Mantle Network Testnet completed its v0.4.0 update on June 9, 2023, and we have created a new MNT.
On Goerli Testnet, the token contract for BIT contract. Here’s a list of contract addresses on Goerli, that we’ll interact with in this guide:
- MantleTokenMigrator address: 0x144D9B7F34a4e3133C6F347886fBe2700c4cb268
- Mantle Token (MNT) address: 0xc1dC2d65A2243c22344E725677A3E3BEBD26E604
- BitDAO Token (BIT) address: 0x5a94Dc6cc85fdA49d8E9A8b85DDE8629025C42be
In this short guide, we’ll walk you through how to migrate testnet MNT on Goerli. This is for developers and teams with existing dApps on Goerli Testnet that utilize $BIT.
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.
-
Follow this link to install foundry: https://book.getfoundry.sh/getting-started/installation
-
To confirm cast is correctly installed, run this command:
cast --version
If you have it installed correctly, it will print out the current version of cast, like this:
cast 0.2.0 (6cd6618 2022-08-11T00:05:44.416299Z)
Step 2: Get an API Key
Once we’ve installed Foundry, it’s time to get ourselves a Goerli Testnet API Key from any node provider you’re comfortable with, for this guide we’ll be using Infura.
-
Click this link to login or create an Infura account: https://app.infura.io/login
-
Create an API Key by clicking the “Create new API Key” button, then select “Web3 API” under the Network dropdown menu.
- After entering the name of your key, move to the “Endpoints” tab where you’ll see your API Key!
Save it! You’ll need it in the next step.
Step 3: Approve the migration contract to spend $BIT
Now, this part is a little bit tricky because we are going to manually approve $BIT via the CLI (Command Line Interface) using Cast. We recommend users without developer experience to wait for the official migration tool to be live!
Here is the command we’ll be using to approve $BIT. The text in quotes and highlighted red is not part of the command, you will have to replace those with the corresponding values for this to function.
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"
-
Replace “your address” with the address of the wallet you want to use for $BIT migration. Make sure it has a sufficient amount of GoerliETH to make this transaction.
-
Replace “your private key” with the private key of the address you want to use for $BIT migration. Make sure you don’t share your key with others!
-
Replace “amount” with the amount of $BIT you want to approve/migrate.
Note that the $BIT token has 18 decimal places, which means that you would need to multiply the amount you want to approve by 10 ** 18 (e.g., 1 BIT = 1000000000000000000 BIT).
For an accurate conversion, use this tool: https://eth-converter.com/.
- Replace “your api key” with the API Key you’ve created from the last step.
The only thing left is to copy-paste the modified command into the CLI and run it!
For confirmation that your transaction has been published, you should get a response in your terminal, similar to this one:
Step 4: Migrate
MNT
Looks like you’ve approved your $BIT tokens. For the final step, we’ll need to move to etherscan to call the migration function.
-
Follow the link to our migration contract on Etherscan: https://goerli.etherscan.io/address/0x144D9B7F34a4e3133C6F347886fBe2700c4cb268#writeContract
-
Connect your wallet to the web page.
-
There are two main functions we can use – “migrateBIT” and “migrateAllBIT” functions.
- For the “migrateBIT” function you’ll need to enter the amount of tokens you want to be migrated and click on “Write” to call the function.
Note that the $BIT token has 18 decimal places, which means that you would need to multiply the amount you want to approve by 10 ** 18 (e.g.,1 BIT = 1000000000000000000 BIT).
For an accurate conversion, use this tool: https://eth-converter.com/.
- For the “migrateAllBIT” function all you need is to make sure that you’ve approved the right amount of $BIT and click on “Write” to call the function.
Conclusion
In this step-by-step guide we’ve walked through the MNT migration process on Goerli Testnet. We do encourage users without a developer background to wait for the official conversion web page to be live or try following the steps in this guide!