MasterChef v2

Migrate to MasterChef v2

SMBSwap MasterChef v2 is a new main staking contract for Farms while providing more flexibility for adjusting the $SELF emissions, including SELF pool, burn and other SMBSwap products.

Do I need to migrate?

If you are currently using SMBSwap MasterChef (0x3d03d12F95Bdc4509804f9Bcee4139b7789DC516), you will need to migrate to the new contract (0xb1c2C30b339C8666530d7E1dbef2F2ba20295Ec2).

Overview

Deposit

If you are currently using the enterStaking(uint256 _amount) on the current SMBSwap MasterChef, you need to migrate to the new SELF pool contract. Check out the related documentation here.

The deposit function for the farm pools is unchanged. However, you will need to upgrade the MasterChef address and the pid , check out the list of farms for the list of new pids on MasterChef v2.

Pool types

MasterChef v2 have 2 types of pool: Regular farm pools and Special farm pools, which you can use poolInfo(_pid).isRegular to 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 SELF-BNB, BNB-BUSD, etc.

Withdraw

If you are currently using the leaveStaking(uint256 _amount) on the current SMBSwap MasterChef, you need to migrate to the new SELF pool contract. Check out the related documentation here.

The withdraw function for the farm pools is unchanged. However, you will need to update the MasterChef address and the pid , check out the list of farms for the list of new pids on MasterChef v2.

Staking Balance

Use userInfo[_pid][_user].amount to query the staking balance.

Staking Token

Note that the new PoolInfo struct does not contain the lp token address field, you will need to use lpToken(_pid) to query any given pool's staking token.

Total Staking Shares/Amount

Use 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 totalBoostedShare field in PoolInfo as each pool’s total shares. For example, if pool 0 has 2 users, user1 stake 100 LPs (without boost), user2 stake 100 (with boostMultiplier being 1.05), then the totalBoostedShare will become 205. Resulting in user2 gaining more rewards.

SelfPerBlock

You can use selfPerBlock(bool _isRegular) to query the SELF reward per block that goes to all the SMBSwap farms.

Mainnet Contract Address

Contract name: MasterChef v2 Contract address: 0xb1c2C30b339C8666530d7E1dbef2F2ba20295Ec2

​View the SMBSwap Main Staking Contract v2 on BscScan.​

Last updated