Acquiring Polygon MATIC
As of October 18th 2021, Forta smart contracts (including the Bot Registry) have been moved to Polygon, a blockchain scaling solution that enables faster and cheaper transactions. You will need MATIC tokens in order to pay gas fees on Polygon when deploying your bot. This guide will walk you through converting your ETH (on Ethereum mainnet) to MATIC (on Polygon mainnet). To learn more about Polygon, visit their website.
If you already have MATIC tokens on Ethereum mainnet, you can transfer them over to Polygon using the bridge in step 3.
1. Import your keyfile into Metamask
- In Metamask, click the Accounts dropdown and then click on Import Account
- Select the JSON File option from the Type dropdown
- Click on Choose File and navigate to your keyfile (in ~/.forta) and select it
- Enter the password for your keyfile in the Password box
- Click the Import button
Your keyfile should now be in Metamask. Make sure there is some ETH in this account.
2. Add Polygon network to your Metamask
- In Metamask, click the Network dropdown and then click on Custom RPC
- Fill in the following fields:
- Network Name:
Polygon Mainnet
- RPC URL:
https://polygon-rpc.com/
- Chain ID:
137
- Currency Symbol:
MATIC
- Explorer URL:
https://polygonscan.com/
- Network Name:
- Click the Save button
You can now interact with the Polygon network using your Metamask.
3. Move ETH to Polygon using the bridge
- Navigate to the Polygon bridge
- Connect your Metamask wallet if needed (you will be prompted to sign a message)
- Select Ether from the dropdown as the token to transfer
- Enter how much ETH you want to transfer (for reference, 1 MATIC will allow you to publish ~80 bots)
- Click the Transfer button, then click Continue on the following dialogs
- In the Metamask transaction dialog, review the gas fees and click Confirm
- Wait for the transaction to complete on Ethereum mainnet
- Verify your account balance on Polygon mainnet using the Polygon block explorer. You should have received WETH as an ERC-20 transfer (may take a few minutes to complete)
You have now transferred ETH from Ethereum mainnet over to Polygon mainnet.
4. Swap ETH for MATIC using the swap tool
- Navigate to the Polygon swap tool
- Connect your Metamask wallet if needed (you will be prompted to sign a message)
- Select how much MATIC you want to receive (for reference, 1 MATIC will allow you to publish ~80 bots)
- Select WETH as the token to swap (will be labelled "Ether (PoS-WETH)")
- Click the Approve button
- Click the Swap button
- Wait for the transaction to complete on Polyon mainnet
- Verify your account balance on Polygon mainnet using the Polygon block explorer. You should have received the specified amount of MATIC
You should now have MATIC tokens on Polygon mainnet in order to pay gas fees! You can now continue deploying your bot.