In this article we will show you how to emergency withdraw your crypto assets by interacting directly with the MasterChef contract of a decentralized finance farm protocol on the Arbitrum network.
Step 1: Get the MasterChef contract address #
The first step is to find the MasterChef contract address + the pool number in which your assets are deposited. Please read this article to find out which pool number corresponds with the liquidity pool that contains your assets. By reading this article, you can find the MasterChef contract address.
Step 2a: Use Rugdoc’s emergency withdraw tool #
As an alternative for the steps below, we have created a tool that does the emergency withdraws for you! Check it out here: https://rugdoc.io/emergency/
Step 2b: Search for the MasterChef contract #
In this guide, we are using FarmersOnly Layer 3’s Masterchef contract.
Open one of the Arbitrum block explorers and fill in the MasterChef contract address in the top right and hit enter. Select the ‘Contract’ tab and then ‘Write Contract’.
Step 3: Connect your Wallet to the Arbitrum explorer #
Connect your wallet to the Arbitrum explorer. Select the “Connect to Web3” line.
If you have multiple addresses in your MetaMask wallet choose the right one and click on “Next” in the MetaMask window.
Then connect your wallet by clicking “Connect”.
You are now connected with the MasterChef and you can start with calling the emergencyWithdraw function.
Step 4: Call the emergencyWithdraw function #
Within the “Write Contract” section you’ll find a section called “emergencyWithdraw”.
You need to fill in the pool ID (PID) of the liquidity pool you want to withdraw your assets from. If you don’t know your pool ID please read this article. Please make sure to note down the pool ID in case of an emergency because finding the PID is time consuming.
After filling in the pool ID, click on the ‘Write’ button. You are now prompted to sign the transaction. Once the transaction is executed, you should get a confirmation.
Awesome! You now know how to emergency withdrawn your crypto assets from liquidity pools via the Arbitrum block explorer(s).