Smart Contracts
Branches and Versions
Addresses & Networks
0xbaaf53f7b9017ec4be9623c60b6182f2ffba1f01bc67f292295bcfe17f3277010xc4d5cb0e84c7dfc3498d38dcbe1a898b694c2a8c274fbc99696b7773fe75b381Staking contract
// Stake pool, stores stake, reward coins and related info.
struct StakePool<phantom S, phantom R> has key {
reward_per_sec: u64,
// pool reward ((reward_per_sec * time) / total_staked) + accum_reward (previous period)
accum_reward: u128,
// last accum_reward update time
last_updated: u64,
// start timestamp.
start_timestamp: u64,
// when harvest will be finished.
end_timestamp: u64,
stakes: table::Table<address, UserStake>,
stake_coins: Coin<S>,
reward_coins: Coin<R>,
// multiplier to handle decimals
scale: u128,
total_boosted: u128,
/// This field can contain pool boost configuration.
/// Pool creator can give ability for users to increase their stake profitability
/// by staking nft's from specified collection.
nft_boost_config: Option<NFTBoostConfig>,
/// This field set to `true` only in case of emergency:
/// * only `emergency_unstake()` operation is available in the state of emergency
emergency_locked: bool,
stake_events: EventHandle<StakeEvent>,
unstake_events: EventHandle<UnstakeEvent>,
deposit_events: EventHandle<DepositRewardEvent>,
harvest_events: EventHandle<HarvestEvent>,
boost_events: EventHandle<BoostEvent>,
remove_boost_events: EventHandle<RemoveBoostEvent>,
}Generics
Common logic
NFT config
Functions
Scripts
Functions
Config
Last updated