mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-22 07:26:52 +00:00
sol
This commit is contained in:
@@ -25,13 +25,16 @@ pub struct Board {
|
||||
/// The hash of the end slot, provided by solana, used for random number generation.
|
||||
pub slot_hash: [u8; 32],
|
||||
|
||||
/// The total amount of ORE burned for the round.
|
||||
pub total_burned: u64,
|
||||
/// The top winner of the round.
|
||||
pub top_winner: Pubkey,
|
||||
|
||||
/// The total amount of ORE committed for the round.
|
||||
pub total_commits: u64,
|
||||
/// The total amount of SOL prospected in the round.
|
||||
pub total_prospects: u64,
|
||||
|
||||
/// The total amount of ORE won by miners for the round.
|
||||
/// The total amount of SOL put in the ORE vault.
|
||||
pub total_vaulted: u64,
|
||||
|
||||
/// The total amount of SOL won by miners for the round.
|
||||
pub total_winnings: u64,
|
||||
}
|
||||
|
||||
|
||||
@@ -13,14 +13,20 @@ pub struct Miner {
|
||||
/// The miner's committed square in the current round round.
|
||||
pub commits: [u64; 25],
|
||||
|
||||
/// The amount of SOL this miner can claim.
|
||||
pub rewards_sol: u64,
|
||||
|
||||
/// The amount of ORE this miner can claim.
|
||||
pub rewards: u64,
|
||||
pub rewards_ore: u64,
|
||||
|
||||
/// The ID of the round this miner last played in.
|
||||
pub round_id: u64,
|
||||
|
||||
/// The total amount of SOL this miner has mined across all blocks.
|
||||
pub lifetime_rewards_sol: u64,
|
||||
|
||||
/// The total amount of ORE this miner has mined across all blocks.
|
||||
pub total_rewards: u64,
|
||||
pub lifetime_rewards_ore: u64,
|
||||
}
|
||||
|
||||
impl Miner {
|
||||
|
||||
@@ -42,15 +42,15 @@ pub fn square_pda(id: u64) -> (Pubkey, u8) {
|
||||
Pubkey::find_program_address(&[SQUARE, &id.to_le_bytes()], &crate::ID)
|
||||
}
|
||||
|
||||
pub fn vault_address() -> Pubkey {
|
||||
let board_address = board_pda().0;
|
||||
spl_associated_token_account::get_associated_token_address(&board_address, &MINT_ADDRESS)
|
||||
}
|
||||
// pub fn vault_address() -> Pubkey {
|
||||
// let board_address = board_pda().0;
|
||||
// spl_associated_token_account::get_associated_token_address(&board_address, &MINT_ADDRESS)
|
||||
// }
|
||||
|
||||
pub fn treasury_pda() -> (Pubkey, u8) {
|
||||
Pubkey::find_program_address(&[TREASURY], &crate::ID)
|
||||
}
|
||||
|
||||
// pub fn treasury_tokens_address() -> Pubkey {
|
||||
// spl_associated_token_account::get_associated_token_address(&TREASURY_ADDRESS, &MINT_ADDRESS)
|
||||
// }
|
||||
pub fn treasury_tokens_address() -> Pubkey {
|
||||
spl_associated_token_account::get_associated_token_address(&TREASURY_ADDRESS, &MINT_ADDRESS)
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ use super::OreAccount;
|
||||
/// the program's global token account.
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
|
||||
pub struct Treasury {}
|
||||
pub struct Treasury {
|
||||
pub balance: u64,
|
||||
}
|
||||
|
||||
impl Treasury {
|
||||
pub fn pda() -> (Pubkey, u8) {
|
||||
|
||||
Reference in New Issue
Block a user