MasterChef
BNB Smart Chain0x73feaa1ee314f8c655e354234017be2193c9e24e
Solidity v0.6.12+commit.27d51765
Overview
Read Functions
Block #100,286,868 · just nowReturns the current bonus multiplier used to calculate pool reward emissions.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | Current bonus multiplier value (uint256) used to scale distributed rewards.✨ AI |
Returns the CAKE token contract address.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | address | The CAKE token contract address.✨ AI |
Returns the amount of CAKE tokens minted per block by the MasterChef contract.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | The number of CAKE tokens minted each block, expressed in the token's smallest unit (uint256).✨ AI |
Returns the address that receives developer rewards.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | address | The current developer wallet address that receives the protocol's developer allocation.✨ AI |
Calculate the reward multiplier for the given block range.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| _from | uint256 | Start block number.✨ AI |
| _to | uint256 | End block number.✨ AI |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | Total multiplier to apply to rewards between the two block numbers.✨ AI |
Returns the address of the current migrator contract used to migrate liquidity provider tokens.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | address | Address of the migrator contract; returns zero address 0x0000000000000000000000000000000000000000 if none is set.✨ AI |
Returns the address of the contract owner.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | address | The address that holds contract ownership and has privileged permissions.✨ AI |
Shows the currently pending CAKE rewards for a user in the given pool.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| _pid | uint256 | Pool ID to check pending rewards for.✨ AI |
| _user | address | Address of the user to query.✨ AI |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | Amount of pending CAKE tokens the user can claim from the pool.✨ AI |
Return information about a liquidity pool given its index.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| lpToken | address | lpToken: address of the pool's LP token contract.✨ AI |
| allocPoint | uint256 | allocPoint: allocation points assigned to this pool used to calculate its share of rewards.✨ AI |
| lastRewardBlock | uint256 | lastRewardBlock: last block number when rewards were distributed for this pool.✨ AI |
| accCakePerShare | uint256 | accCakePerShare: accumulated reward per share for this pool, scaled by the contract's precision factor.✨ AI |
Returns the current number of pools in the MasterChef contract.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | Total number of pools registered in the contract (uint256).✨ AI |
Returns the block number when reward distribution starts.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | The start block number (uint256) when staking rewards begin to be distributed.✨ AI |
Returns the address of the Syrup contract that MasterChef uses for staking and rewards.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | address | The Syrup contract address used by MasterChef (the contract that holds staking/reward tokens).✨ AI |
Returns the total allocation points across all pools, used to calculate each pool's share of rewards.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | Total allocation points for all pools, used to compute each pool's portion of reward emissions.✨ AI |
Returns a user's staked token amount and reward accounting for a specific pool.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| — | uint256 | |
| — | address |
Returns
| Name | Type | Description |
|---|---|---|
| amount | uint256 | amount: The number of LP tokens the user has deposited in the pool.✨ AI |
| rewardDebt | uint256 | rewardDebt: The amount subtracted from user's pending rewards for accounting.✨ AI |
Write Functions
Add a new liquidity pool and assign allocation points, optionally updating all pools first.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| _allocPoint | uint256 | Allocation points for the new pool, determining its share of emitted rewards.✨ AI |
| _lpToken | address | Address of the liquidity pool (LP) token contract to add.✨ AI |
| _withUpdate | bool | If true, update all existing pools' reward variables before adding this pool.✨ AI |
Deposit LP tokens into a specific pool to start earning rewards and update the caller's reward state.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| _pid | uint256 | Identifier of the target pool.✨ AI |
| _amount | uint256 | Number of LP tokens to deposit.✨ AI |
Update the developer address used to receive the developer reward.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| _devaddr | address | New developer address that will receive developer rewards.✨ AI |
Allows a user to withdraw their staked tokens from a pool immediately without claiming rewards.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| _pid | uint256 | ID of the pool to withdraw from.✨ AI |
Stake tokens in the MasterChef contract to begin earning staking rewards.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| _amount | uint256 | Number of tokens to deposit into the staking pool.✨ AI |
Withdraw a specified amount of staked tokens from the staking pool and update the caller's staking balance.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| _amount | uint256 | Amount of staked tokens to withdraw, expressed in the token's smallest unit.✨ AI |
Update all pools' reward variables to the latest block.✨ AI
Migrate LP tokens for the pool identified by _pid using the configured migrator.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| _pid | uint256 | Pool identifier whose LP tokens and accounting are migrated.✨ AI |
Renounce contract ownership, leaving the contract without an owner.✨ AI
Set allocation points for a pool and optionally update all pools' reward states.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| _pid | uint256 | Index of the pool to update.✨ AI |
| _allocPoint | uint256 | New allocation points determining the pool's share of rewards.✨ AI |
| _withUpdate | bool | If true, call massUpdatePools to refresh every pool before applying the change.✨ AI |
Set the migrator contract address used to migrate pools and LP tokens.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| _migrator | address | Migrator contract address to enable token and pool migrations.✨ AI |
Transfers ownership of the contract to the specified new owner address.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| newOwner | address | Address that will become the new owner of the contract.✨ AI |
Update the global reward multiplier used by the contract to adjust reward emission calculations.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| multiplierNumber | uint256 | New multiplier value to apply in reward calculation (uint256).✨ AI |
Update the specified pool's reward variables to the latest values.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| _pid | uint256 | ID of the pool to update.✨ AI |
Withdraw staked tokens from the specified pool and transfer any pending rewards to the caller.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| _pid | uint256 | Pool id to withdraw from.✨ AI |
| _amount | uint256 | Amount of staked tokens to withdraw.✨ AI |
Events
| Name | Type | Indexed | Description |
|---|---|---|---|
| user | address | ✓ | |
| pid | uint256 | ✓ | |
| amount | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| user | address | ✓ | |
| pid | uint256 | ✓ | |
| amount | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| previousOwner | address | ✓ | |
| newOwner | address | ✓ |
| Name | Type | Indexed | Description |
|---|---|---|---|
| user | address | ✓ | |
| pid | uint256 | ✓ | |
| amount | uint256 |