resolve diffs

This commit is contained in:
alex
2024-07-12 15:21:30 -07:00
12 changed files with 323 additions and 3787 deletions

View File

@@ -79,7 +79,7 @@ pub const TREASURY: &[u8] = b"treasury";
/// Noise for deriving the mint pda
pub const MINT_NOISE: [u8; 16] = [
166, 199, 85, 221, 225, 119, 21, 185, 160, 82, 242, 237, 194, 84, 250, 252,
89, 157, 88, 232, 243, 249, 197, 132, 199, 49, 19, 234, 91, 94, 150, 41,
];
/// The name for token metadata.

View File

@@ -50,8 +50,11 @@ pub enum OreInstruction {
#[account(0, name = "ore_program", desc = "Ore program")]
#[account(1, name = "signer", desc = "Signer", signer)]
#[account(2, name = "proof", desc = "Ore proof account", writable)]
#[account(3, name = "system_program", desc = "Solana system program")]
#[account(2, name = "miner", desc = "Address to be initialized as the miner")]
#[account(3, name = "payer", desc = "Account to pay for account creation", writable, signer)]
#[account(4, name = "proof", desc = "Ore proof account", writable)]
#[account(5, name = "system_program", desc = "Solana system program")]
#[account(6, name = "slot_hashes", desc = "Solana slot hashes sysvar")]
Open = 4,
#[account(0, name = "ore_program", desc = "Ore program")]
@@ -228,6 +231,21 @@ pub fn close(signer: Pubkey) -> Instruction {
}
}
/// Builds a crown instruction.
pub fn crown(signer: Pubkey, current_top_staker: Pubkey) -> Instruction {
let proof_pda = Pubkey::find_program_address(&[PROOF, signer.as_ref()], &crate::id());
Instruction {
program_id: crate::id(),
accounts: vec![
AccountMeta::new(signer, true),
AccountMeta::new(CONFIG_ADDRESS, false),
AccountMeta::new_readonly(current_top_staker, false),
AccountMeta::new_readonly(proof_pda.0, false),
],
data: OreInstruction::Crown.to_vec(),
}
}
/// Builds a mine instruction.
pub fn mine(
miner: Pubkey,

View File

@@ -9,5 +9,4 @@ pub(crate) use ore_utils as utils;
use solana_program::declare_id;
// declare_id!("mineRHF5r6S7HyD9SppBfVMXMavDkJsxwGesEvxZr2A");
declare_id!("Fb9XVEimYj5KzVL6mLdbah3CGYmGP881uddBahui5RHt");
declare_id!("oreV2ZymfyeXgNgBdqMkumTqqAprVqgBWQfoYkrtKWQ");

View File

@@ -10,7 +10,7 @@ use super::AccountDiscriminator;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, ShankAccount, Zeroable)]
pub struct Config {
/// The admin authority with permission to update the difficulty.
// TODO Remove this
pub admin: Pubkey,
/// The base reward rate paid out for a hash of minimum difficulty.