Comment on page
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!
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
castto initiate $BIT approval transactions.
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)
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.
- 2.Create an API Key by clicking the “Create new API Key” button, then select “Web3 API” from the Network dropdown menu.
- 3.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.
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.
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:
We can call the migration contract from Etherscan.
- 1.Follow the link below to navigate to the migration contract on Etherscan.
- 2.Connect your wallet to the webpage.
- 3.You can now use the
migrateAllBITfunction is you've approved all the available $BIT in your wallet. To specify an amount, use the
migrateBITfunction 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.
- 4.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: