MasterChef V3
Solidity API
MasterChefV3
PoolInfo
UserPositionInfo
poolLength
poolInfo
Info of each MCV3 pool.
userPositionInfos
userPositionInfos[tokenId] => UserPositionInfo
TokenId is unique, and we can query the pid by tokenId.
v3PoolPid
v3PoolPid[token0][token1][fee] => pid
v3PoolAddressPid
v3PoolAddressPid[v3PoolAddress] => pid
CAKE
Address of CAKE contract.
WETH
Address of WETH contract.
receiver
Address of Receiver contract.
nonfungiblePositionManager
LMPoolDeployer
Address of liquidity mining pool deployer contract.
FARM_BOOSTER
Address of farm booster contract.
emergency
Only use for emergency situations.
totalAllocPoint
Total allocation points. Must be the sum of all pools' allocation points.
latestPeriodNumber
latestPeriodStartTime
latestPeriodEndTime
latestPeriodCakePerSecond
operatorAddress
Address of the operator.
PERIOD_DURATION
Default period duration.
MAX_DURATION
MIN_DURATION
PRECISION
BOOST_PRECISION
Basic boost factor, none boosted user's boost factor
MAX_BOOST_PRECISION
Hard limit for maxmium boost factor, it must greater than BOOST_PRECISION
Q128
MAX_U256
cakeAmountBelongToMC
Record the cake amount belong to MasterChefV3.
ZeroAddress
NotOwnerOrOperator
NoBalance
NotPancakeNFT
InvalidNFT
NotOwner
NoLiquidity
InvalidPeriodDuration
NoLMPool
InvalidPid
DuplicatedPool
NotEmpty
WrongReceiver
InconsistentAmount
InsufficientAmount
Init
AddPool
SetPool
Deposit
Withdraw
UpdateLiquidity
NewOperatorAddress
NewLMPoolDeployerAddress
NewReceiver
NewPeriodDuration
Harvest
NewUpkeepPeriod
UpdateUpkeepPeriod
UpdateFarmBoostContract
SetEmergency
onlyOwnerOrOperator
onlyValidPid
onlyReceiver
onlyBoostContract
Throws if caller is not the boost contract.
constructor
Parameters
getLatestPeriodInfoByPid
Returns the cake per second , period end time.
Parameters
getLatestPeriodInfo
Returns the cake per second , period end time. This is for liquidity mining pool.
Parameters
pendingCake
View function for checking pending CAKE rewards.
The pending cake amount is based on the last state in LMPool. The actual amount will happen whenever liquidity changes or harvest.
Parameters
setEmergency
For emergency use only.
setReceiver
setLMPoolDeployer
add
Add a new pool. Can only be called by the owner. One v3 pool can only create one pool.
Parameters
set
Update the given pool's CAKE allocation point. Can only be called by the owner.
Parameters
DepositCache
onERC721Received
Upon receiving a ERC721
harvest
harvest cake from pool.
Parameters
harvestOperation
withdraw
Withdraw LP tokens from pool.
Parameters
updateLiquidity
Update liquidity for the NFT position.
Parameters
updateBoostMultiplier
Update farm boost multiplier for the NFT position.
Parameters
updateLiquidityOperation
increaseLiquidity
Increases the amount of liquidity in a position, with tokens paid by the msg.sender
Parameters
Return Values
pay
Pay.
Parameters
refund
Refund.
Parameters
decreaseLiquidity
Decreases the amount of liquidity in a position and accounts it to the position
Parameters
Return Values
collect
Collects up to a maximum amount of fees owed to a specific position to the recipient
Warning!!! Please make sure to use multicall to call unwrapWETH9 or sweepToken when set recipient address(0), or you will lose your funds. amount0Max The maximum amount of token0 to collect, amount1Max The maximum amount of token1 to collect
Parameters
Return Values
collectTo
Collect fees and refund.
transferToken
Transfer token from MasterChef V3.
Parameters
unwrapWETH9
Unwraps the contract's WETH9 balance and sends it to recipient as ETH.
The amountMinimum parameter prevents malicious contracts from stealing WETH9 from users.
Parameters
sweepToken
Transfers the full amount of a token held by this contract to recipient
The amountMinimum parameter prevents malicious contracts from stealing the token from users
Parameters
burn
Burns a token ID, which deletes it from the NFT contract. The token must have 0 liquidity and all tokens must be collected first.
Parameters
upkeep
Upkeep period.
Parameters
massUpdatePools
Update cake reward for all the liquidity mining pool.
updatePools
Update cake reward for the liquidity mining pool.
Avoid too many pools, and a single transaction cannot be fully executed for all pools.
setOperator
Set operator address.
Callable by owner
Parameters
setPeriodDuration
Set period duration.
Callable by owner
Parameters
updateFarmBoostContract
Update farm boost contract address.
Parameters
safeTransferETH
Transfer ETH in a safe way
Parameters
_safeTransfer
Safe Transfer CAKE.
Parameters
receive
Last updated