糖浆池

Syrup Pools

Contract info

Contract name: pancake::smart_chef Contract address:

fd1d8a523f1be89277ac0787ae3469312667e3d0b3f75a5f01bfc95530a2dc91::smart_chef

Admin multi sig address: 0xd97268666bad31a7299cc80c1bca26face32718630c5498544fe8e9bcc593d74

Aptos Explorer

Types

Resources

SmartChefMetadata

The metadata of the module.

struct SmartChefMetadata has key {
    signer_cap: account::SignerCapability,
    admin: address,
    uid: u64,
    create_pool_event: EventHandle<CreatePoolEvent>
}

PoolInfo

The information of each pool.

struct PoolInfo<phantom StakeToken, phantom RewardToken, phantom UID> has key {
    total_staked_token: coin::Coin<StakeToken>,
    total_reward_token: coin::Coin<RewardToken>,
    reward_per_second: u64,
    start_timestamp: u64,
    end_timestamp: u64,
    last_reward_timestamp: u64,
    seconds_for_user_limit: u64,
    pool_limit_per_user: u64,
    acc_token_per_share: u128,
    precision_factor: u128,
    emergency_withdraw_reward_event: EventHandle<EmergencyWithdrawRewardEvent<StakeToken, RewardToken, UID>>,
    stop_reward_event: EventHandle<StopRewardEvent<StakeToken, RewardToken, UID>>,
    new_pool_limit_event: EventHandle<NewPoolLimitEvent<StakeToken, RewardToken, UID>>,
    new_reward_per_second_event: EventHandle<NewRewardPerSecondEvent<StakeToken, RewardToken, UID>>,
    new_start_and_end_timestamp_event: EventHandle<NewStartAndEndTimestampEvent<StakeToken, RewardToken, UID>>,
}

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<StakeToken, RewardToken, UID>(
    account: &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<StakeToken, RewardToken, UID>(
    account: &signer,
    amount: u64,
)

Emergency Withdraw

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

public entry fun emergency_withdraw<StakeToken, RewardToken, UID>(account: &signer)

Public Functions

Get Pool Info

Get the pool informations.

public fun get_pool_info<StakeToken, RewardToken, UID>(): (u64, u64, u64, u64, u64, u64, u64)

Return Values

Get User Stake Amount

Get the user stake amount in the pool.

public fun get_user_stake_amount<StakeToken, RewardToken, UID>(account: address)

Input Values

Return Values

Get Pending Reward

Get the pending reward of the depositor in the pool.

public fun get_pending_reward<StakeToken, RewardToken, UID>(account: address): u64 

Input Values

Return Values

Audit

Zellic's PancakeSwap Aptos Syrup Pool security audit

最后更新于