MasterChef

Contract info

Contract name: pancake::masterchef Contract address:

7968a225eba6c99f5f1070aeec1b405757dee939eabcfda43ba91588bf5fccf3::masterchef

Admin multi sig address: eef8788f3eaa34b936d0bc5897fc40fa3782b1e663bf04edf2cd22fcd18329ff

Aptos Explorer

Resources

MasterChef

Th metadata of the masterchef.

struct MasterChef has key {
    signer_cap: account::SignerCapability,
    admin: address,
    upkeep_admin: address,
    lp_to_pid: TableWithLength<string::String, u64>,
    lps: vector<string::String>,
    pool_info: vector<PoolInfo>,
    total_regular_alloc_point: u64,
    total_special_alloc_point: u64,
    cake_per_second: u64,
    cake_rate_to_regular: u64,
    cake_rate_to_special: u64,
    last_upkeep_timestamp: u64,
    end_timestamp: u64
}

PoolUserInfo

All pool informations.

struct PoolUserInfo has key {
    pid_to_user_info: TableWithLength<u64, UserInfo>,
    pids: vector<u64>,
}

UserInfo

The user information in each pool.

struct UserInfo has store {
    amount: u128,
    reward_debt: u128
}

PoolInfo

The information of each pool

struct PoolInfo has store {
    total_amount: u128,
    acc_cake_per_share: u128,
    last_reward_timestamp: u64,
    alloc_point: u64,
    is_regular: bool
}

Entry Functions

Deposit

Deposit the stake token into the pool. It will also transfer reward token to the user if there's any.

public entry fun deposit<CoinType>(
    sender: &signer,
    amount: u64
)

Withdraw

Withdraw the stake token from the pool. It will also transfer reward token to the user if there's any.

public entry fun withdraw<CoinType>(
    sender: &signer,
    amount: u64
)

Emergency Withdraw

Withdraw the stake token from the pool regardless of any rewards.

public entry fun emergency_withdraw<CoinType>(sender: &signer)

Mass Update Pools

Update all the pool information.

public entry fun mass_update_pools()

Update Pool

Update a specific pool information.

public entry fun update_pool(pid: u64)

Public Function

Pending Cake

The pending cake reward of the user.

public fun pending_cake(
    pid: u64,
    user: address
): u64 

Input Values

Return Values

Pool Length

The total number of pools.

public fun pool_length():u64

Return Values

Audit

OtterSec's PancakeSwap Aptos MasterChef security audit:

Last updated