Migrate to MasterChef v2
PancakeSwap MasterChef v2 is a new main staking contract for Farms while providing more flexibility for adjusting the $CAKE emissions, including CAKE pool, burn and other PancakeSwap products.
MasterChef v2 have 2 types of pool: Regular farm pools and Special farm pools, which you can use
poolInfo(_pid).isRegularto query the pool type. They share a different
totalAllocPoint, making them two sets of independent pools.
Special farm pools: only whitelisted addresses can deposit. They are usually utilized by internal PancakeSwap products for rewards distributions.
Regular farm pools: the regular LP tokens farms. For example CAKE-BNB, BNB-BUSD, etc…
userInfo[_pid][_user].amountto query the staking balance.
Note that the new
PoolInfostruct does not contain the lp token address field, you will need to use
lpToken(_pid)to query any given pool's staking token.
lpToken.balanceOf(MasterChef.address)to get the total staking amount for any given farm pool.
However, In MasterChef v2, the users' share can be boosted (coming soon). Therefore, rewards are calculated using a new
PoolInfoas each pool’s total shares. For example, if pool 0 has 2 users, user1 stake 100 LPs (without boost), user2 stake 100 (with
boostMultiplierbeing 1.05), then the
totalBoostedSharewill become 205. Resulting in user2 gaining more rewards.
You can use
cakePerBlock(bool _isRegular)to query the CAKE reward per block that goes to all the PancakeSwap farms.
Contract name: MasterChef v2 Contract address:
You can use the following testnet environment to test the integration of your project with the new PancakeSwap MasterChef v2. If you have any questions, please contact our team via the existing channels, or reach out to [email protected] via Email.
0xFa60D973F7642B748046464e165A65B7323b0DEE(mintable by using
mint(address _to, uint256 _amount) public)
0x8516Fc284AEEaa0374E66037BD2309349FF728eA(mintable by using
mint(uint256 amount) public)
- Factory v2:
- Router v2:
- pid0: Manual CAKE
- pid4: Dummy Pool for MasterChef v2
- pid5: CAKE-BUSD:
- pid6: CAKE-WBNB:
- pid3: CAKE-BUSD:
- pid4: CAKE-WBNB: