#![deny(rustdoc::all)]
#![allow(rustdoc::missing_doc_code_examples)]
#![deny(clippy::unwrap_used)]
use anchor_lang::prelude::*;
use vipers::prelude::*;
mod instructions;
mod state;
pub use snapshots_math::*;
pub use state::*;
use instructions::*;
declare_id!("StakeSSzfxn391k3LvdKbZP5WVwWd6AsY1DNiXHjQfK");
#[program]
pub mod snapshots {
use super::*;
#[access_control(ctx.accounts.validate())]
pub fn create_escrow_history(ctx: Context<CreateEscrowHistory>, era: u16) -> Result<()> {
create_escrow_history::handler(ctx, era)
}
#[access_control(ctx.accounts.validate())]
pub fn create_locker_history(ctx: Context<CreateLockerHistory>, era: u16) -> Result<()> {
create_locker_history::handler(ctx, era)
}
#[access_control(ctx.accounts.validate())]
pub fn sync(ctx: Context<Sync>) -> Result<()> {
sync::handler(ctx)
}
}
#[error_code]
pub enum ErrorCode {
#[msg("Locker/escrow mismatch.")]
LockerEscrowMismatch,
#[msg("Era mismatch.")]
EraMismatch,
#[msg("Escrow balances cannot decrease.")]
EscrowBalanceDecreased,
}