mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-13 23:16:52 +00:00
cleanup
This commit is contained in:
@@ -113,6 +113,27 @@ pub fn claim_ore(signer: Pubkey, amount: u64) -> Instruction {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn redeem(signer: Pubkey, amount: u64) -> Instruction {
|
||||
let mint_address = MINT_ADDRESS;
|
||||
let sender_address = get_associated_token_address(&signer, &MINT_ADDRESS);
|
||||
let treasury_address = TREASURY_ADDRESS;
|
||||
Instruction {
|
||||
program_id: crate::ID,
|
||||
accounts: vec![
|
||||
AccountMeta::new(signer, true),
|
||||
AccountMeta::new(mint_address, false),
|
||||
AccountMeta::new(sender_address, false),
|
||||
AccountMeta::new(treasury_address, false),
|
||||
AccountMeta::new_readonly(system_program::ID, false),
|
||||
AccountMeta::new_readonly(spl_token::ID, false),
|
||||
],
|
||||
data: Redeem {
|
||||
amount: amount.to_le_bytes(),
|
||||
}
|
||||
.to_bytes(),
|
||||
}
|
||||
}
|
||||
|
||||
// let [signer_info, board_info, mint_info, treasury_info, reserve_tokens_info, vault_info, system_program, token_program, slot_hashes_sysvar] =
|
||||
|
||||
pub fn reset(signer: Pubkey, miners: Vec<Pubkey>) -> Instruction {
|
||||
|
||||
@@ -7,12 +7,12 @@ use super::OreAccount;
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
|
||||
pub struct Board {
|
||||
/// The commits for the round.
|
||||
pub commits: [u64; 25],
|
||||
|
||||
/// The round number.
|
||||
pub id: u64,
|
||||
|
||||
/// The prospects for the round.
|
||||
pub prospects: [u64; 25],
|
||||
|
||||
/// The timestamp at which the block starts mining.
|
||||
pub start_at: i64,
|
||||
|
||||
@@ -25,8 +25,8 @@ pub struct Board {
|
||||
/// The hash of the end slot, provided by solana, used for random number generation.
|
||||
pub slot_hash: [u8; 32],
|
||||
|
||||
/// The top winner of the round.
|
||||
pub top_winner: Pubkey,
|
||||
/// The top miner of the round.
|
||||
pub top_miner: Pubkey,
|
||||
|
||||
/// The total amount of SOL prospected in the round.
|
||||
pub total_prospects: u64,
|
||||
|
||||
@@ -10,8 +10,8 @@ pub struct Miner {
|
||||
/// The authority of this miner account.
|
||||
pub authority: Pubkey,
|
||||
|
||||
/// The miner's committed square in the current round round.
|
||||
pub commits: [u64; 25],
|
||||
/// The miner's prospects in the current round.
|
||||
pub prospects: [u64; 25],
|
||||
|
||||
/// The amount of SOL this miner can claim.
|
||||
pub rewards_sol: u64,
|
||||
|
||||
Reference in New Issue
Block a user