With MasterchefV1 there is no “harvest” function, but users can still harvest their rewards.
To do so we simply "deposit" 0 SLP token, passing the corresponding pool ID:
-
Go to MasterchefV1 address on the block explorer and click "Contract"->“Write Conteract” (https://etherscan.io/address/0xc2EdaD668740f1aA35E4D8f227fB8E17dcA888Cd#writeContract)
-
Connect your wallet (Connect to Web3)
-
Scroll to 2. deposit()
-
Under “_pid (uint256)” input the farm's pool ID*
- * The pool ID is a unique identifier, mapping the pool token to its allotment in the farm contract.
These can be found in the transaction for staking the SLP token.
-
Go to the MasterchefV2 (Minichef) address on the block explorer and click "Contract"->“Write Conteract” (https://arbiscan.io/address/0xf4d73326c13a4fc5fd7a064217e12780e9bd62c3#writeContract) - Arbitrum example
-
Connect your wallet (Connect to Web3)
-
Scroll to 6. harvest()
-
For “pid (uint256)”, input the farms unique identifier (pool ID) In this example: 12
-
In the “to (address)” field, input the user’s address - In this example: 0x54962fb1ba5229413777fbadd4d826319e68c065
-
Go to MasterchefV1 address on the block explorer and click "Contract"->“Read Conteract” (https://etherscan.io/address/0xc2EdaD668740f1aA35E4D8f227fB8E17dcA888Cd#readContract)
-
Scroll down to 14. userInfo()
-
In “ (uint256)” put the pid number * Here, it is 12, in another case it will be different. See above how to obtain PID number
-
In “ (address)” put the user address - 0x7887056691765941ada17fdeb59e41cbe18b340f
-
Click “query”
-
Click on “Write Contract” (https://etherscan.io/address/0xc2EdaD668740f1aA35E4D8f227fB8E17dcA888Cd#writeContract)
-
Connect your wallet (Connect to Web3)
-
Scroll down to 12. withdraw()
-
In “_pid (uint256)” put the farm pid - 12
-
In “_amount (uint256)” put the copied amount - 14134925891883420137
-
Click “Write”
- The transaction will unstake user’s SLP and also will automatically harvest the user’s farm rewards.
NOTE: There is also the “Emergency withdraw” function, that can be found under 4. emergencyWithdraw().
But if this function is called the user will lose the pending farm rewards! To call this function the user must enter just the pid number and click “write”. Should be used only if the user needs to unstake in emergency!
Unlike MasterchefV1, for MasterchefV2 and Minichefs users have the option to select either “Withdraw and harvest”, or just “Withdraw” (unstaking SLP without harvesting the farm rewards. This can be useful if a reward contracts is out of the reward token, and the user still needs to unstake (Note this is not needed for v1 as reward is minted per block and cannot run out there). Where using wthdraw() without "harvest", users can harvest their rewards later, when rewarder contracts are refilled. Inputs are absolutely the same for both functions - Here is an Arbitrum example with calling “Withdraw” function.
NOTE: For MasterchefV2, the functions are under numbers 16. withdraw(), and 17. withdrawAndHarvest(), while for Minichefs, these are under numbers 15 withdraw(), and 16. withdrawAndHarvest() respectively.
-
Navigate to the Minichef address with a block explorer and click "Contract"->“Read Conteract” (https://arbiscan.io/address/0xf4d73326c13a4fc5fd7a064217e12780e9bd62c3#readContract)
-
Scroll down to 12. userInfo() (Note it is 14. userInfo() for MasterchefV2)
-
For the first field “ (uint256)”, enter the pid number - In this example: 17
NOTE: Can see above how to obtain a farms PID
-
For the second “ (address)”, in put the user address - In this example: 0x54962fb1ba5229413777fbadd4d826319e68c065
-
Click “query”
-
Click on “Write Contract” (https://arbiscan.io/address/0xf4d73326c13a4fc5fd7a064217e12780e9bd62c3#writeContract)
-
Connect your wallet (Connect to Web3)
-
Scroll down to 15. withdraw()
-
For “_pid (uint256)” input the farm pid - 17
-
Under “_amount (uint256)” input the copied amount - 110874089890529377
-
In the “to (address)” field, input user’s address - 0x54962fb1ba5229413777fbadd4d826319e68c065