use cosmwasm_schema::cw_serde;
use cosmwasm_std::{Addr, Uint128, Uint256};
use cw_storage_plus::{Item, Map};
#[cw_serde]
pub struct StakeConfig {
pub core_contract: Addr,
pub mine_contract: Addr,
pub token_contract: Addr,
pub unbonding_period_seconds: u64,
pub admin: Addr,
pub paused: bool,
}
#[cw_serde]
pub struct UnbondingBatch {
pub amount: Uint128,
pub unlock_at: u64,
}
#[cw_serde]
pub struct StakerInfo {
pub staked_amount: Uint128,
pub unbonding_batches: Vec<UnbondingBatch>,
pub claimable_rewards: Uint128,
pub reward_index_snapshot: Uint256,
}
pub const CONFIG: Item<StakeConfig> = Item::new("config");
pub const STAKING_RESERVE: Item<Uint128> = Item::new("staking_reserve");
pub const STAKING_TOTAL_STAKED: Item<Uint128> = Item::new("staking_total_staked");
pub const STAKING_REWARD_INDEX: Item<Uint256> = Item::new("staking_reward_index");
pub const TOTAL_ACCRUED_REWARDS: Item<Uint128> = Item::new("total_accrued_rewards");
pub const TOTAL_CLAIMED_REWARDS: Item<Uint128> = Item::new("total_claimed_rewards");
pub const STAKERS: Map<&Addr, StakerInfo> = Map::new("stakers");