diff --git a/Cargo.lock b/Cargo.lock index e364c15..67a60eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1266,7 +1266,7 @@ dependencies = [ [[package]] name = "ore-api" -version = "3.2.0" +version = "3.3.0" dependencies = [ "array-const-fn-init", "bytemuck", @@ -1323,11 +1323,11 @@ dependencies = [ [[package]] name = "ore-program" -version = "3.2.0" +version = "3.3.0" dependencies = [ "drillx", "mpl-token-metadata", - "ore-api 3.2.0", + "ore-api 3.3.0", "ore-boost-api 3.0.0", "rand 0.8.5", "solana-program", diff --git a/Cargo.toml b/Cargo.toml index 31e1658..cd575e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["api", "program"] [workspace.package] -version = "3.2.0" +version = "3.3.0" edition = "2021" license = "Apache-2.0" homepage = "https://ore.supply" diff --git a/api/src/consts.rs b/api/src/consts.rs index 4bb36f6..3d1e060 100644 --- a/api/src/consts.rs +++ b/api/src/consts.rs @@ -131,10 +131,6 @@ pub const MINT_ADDRESS: Pubkey = /// The bump of the mint account. pub const MINT_BUMP: u8 = ed25519::derive_program_address(&[MINT, &MINT_NOISE], &PROGRAM_ID).1; -/// The address of the v1 mint account. -#[deprecated(since = "2.6.0", note = "v1 tokens are no longer eligable to upgrade")] -pub const MINT_V1_ADDRESS: Pubkey = pubkey!("oreoN2tQbHXVaZsr3pf66A48miqcBXCDJozganhEJgz"); - /// The address of the treasury account. pub const TREASURY_ADDRESS: Pubkey = Pubkey::new_from_array(ed25519::derive_program_address(&[TREASURY], &PROGRAM_ID).0); diff --git a/api/src/instruction.rs b/api/src/instruction.rs index 9b422af..785dbb3 100644 --- a/api/src/instruction.rs +++ b/api/src/instruction.rs @@ -9,11 +9,7 @@ pub enum OreInstruction { Mine = 2, Open = 3, Reset = 4, - #[deprecated(since = "2.4.0", note = "Please stake with the boost program")] - Stake = 5, - Update = 6, - #[deprecated(since = "2.6.0", note = "v1 tokens are no longer eligable to upgrade")] - Upgrade = 7, + Update = 5, // Admin Initialize = 100, @@ -38,68 +34,24 @@ pub struct Mine { #[repr(C)] #[derive(Clone, Copy, Debug, Pod, Zeroable)] -pub struct Open { - #[deprecated(since = "2.5.0", note = "Bump no longer used")] - pub bump: u8, -} +pub struct Open {} #[repr(C)] #[derive(Clone, Copy, Debug, Pod, Zeroable)] pub struct Reset {} -#[deprecated(since = "2.4.0", note = "Please stake with the boost program")] -#[repr(C)] -#[derive(Clone, Copy, Debug, Pod, Zeroable)] -pub struct Stake { - pub amount: [u8; 8], -} - #[repr(C)] #[derive(Clone, Copy, Debug, Pod, Zeroable)] pub struct Update {} -#[deprecated(since = "2.6.0", note = "v1 tokens are no longer eligable to upgrade")] #[repr(C)] #[derive(Clone, Copy, Debug, Pod, Zeroable)] -pub struct Upgrade { - pub amount: [u8; 8], -} - -#[repr(C)] -#[derive(Clone, Copy, Debug, Pod, Zeroable)] -pub struct Initialize { - #[deprecated(since = "2.5.0", note = "Bump no longer used")] - pub bus_0_bump: u8, - #[deprecated(since = "2.5.0", note = "Bump no longer used")] - pub bus_1_bump: u8, - #[deprecated(since = "2.5.0", note = "Bump no longer used")] - pub bus_2_bump: u8, - #[deprecated(since = "2.5.0", note = "Bump no longer used")] - pub bus_3_bump: u8, - #[deprecated(since = "2.5.0", note = "Bump no longer used")] - pub bus_4_bump: u8, - #[deprecated(since = "2.5.0", note = "Bump no longer used")] - pub bus_5_bump: u8, - #[deprecated(since = "2.5.0", note = "Bump no longer used")] - pub bus_6_bump: u8, - #[deprecated(since = "2.5.0", note = "Bump no longer used")] - pub bus_7_bump: u8, - #[deprecated(since = "2.5.0", note = "Bump no longer used")] - pub config_bump: u8, - #[deprecated(since = "2.5.0", note = "Bump no longer used")] - pub metadata_bump: u8, - #[deprecated(since = "2.5.0", note = "Bump no longer used")] - pub mint_bump: u8, - #[deprecated(since = "2.5.0", note = "Bump no longer used")] - pub treasury_bump: u8, -} +pub struct Initialize {} instruction!(OreInstruction, Claim); instruction!(OreInstruction, Close); instruction!(OreInstruction, Mine); instruction!(OreInstruction, Open); instruction!(OreInstruction, Reset); -instruction!(OreInstruction, Stake); instruction!(OreInstruction, Update); -instruction!(OreInstruction, Upgrade); instruction!(OreInstruction, Initialize); diff --git a/api/src/lib.rs b/api/src/lib.rs index f65af45..c0e78a6 100644 --- a/api/src/lib.rs +++ b/api/src/lib.rs @@ -1,7 +1,6 @@ pub mod consts; pub mod error; pub mod event; -#[allow(deprecated)] pub mod instruction; pub mod loaders; pub mod sdk; diff --git a/api/src/sdk.rs b/api/src/sdk.rs index 2edf88c..728ba74 100644 --- a/api/src/sdk.rs +++ b/api/src/sdk.rs @@ -84,7 +84,6 @@ pub fn mine( } /// Builds an open instruction. -#[allow(deprecated)] pub fn open(signer: Pubkey, miner: Pubkey, payer: Pubkey) -> Instruction { let proof_pda = proof_pda(signer); Instruction { @@ -97,7 +96,7 @@ pub fn open(signer: Pubkey, miner: Pubkey, payer: Pubkey) -> Instruction { AccountMeta::new_readonly(solana_program::system_program::ID, false), AccountMeta::new_readonly(sysvar::slot_hashes::ID, false), ], - data: Open { bump: proof_pda.1 }.to_bytes(), + data: Open {}.to_bytes(), } } @@ -125,27 +124,6 @@ pub fn reset(signer: Pubkey) -> Instruction { } } -/// Build a stake instruction. -#[allow(deprecated)] -#[deprecated(since = "2.4.0", note = "Please stake with the boost program")] -pub fn stake(signer: Pubkey, sender: Pubkey, amount: u64) -> Instruction { - let proof = proof_pda(signer).0; - Instruction { - program_id: crate::ID, - accounts: vec![ - AccountMeta::new(signer, true), - AccountMeta::new(proof, false), - AccountMeta::new(sender, false), - AccountMeta::new(TREASURY_TOKENS_ADDRESS, false), - AccountMeta::new_readonly(spl_token::ID, false), - ], - data: Stake { - amount: amount.to_le_bytes(), - } - .to_bytes(), - } -} - // Build an update instruction. pub fn update(signer: Pubkey, miner: Pubkey) -> Instruction { let proof = proof_pda(signer).0; @@ -160,30 +138,7 @@ pub fn update(signer: Pubkey, miner: Pubkey) -> Instruction { } } -// Build an upgrade instruction. -#[allow(deprecated)] -#[deprecated(since = "2.6.0", note = "v1 tokens are no longer eligable to upgrade")] -pub fn upgrade(signer: Pubkey, beneficiary: Pubkey, sender: Pubkey, amount: u64) -> Instruction { - Instruction { - program_id: crate::ID, - accounts: vec![ - AccountMeta::new(signer, true), - AccountMeta::new(beneficiary, false), - AccountMeta::new(MINT_ADDRESS, false), - AccountMeta::new(MINT_V1_ADDRESS, false), - AccountMeta::new(sender, false), - AccountMeta::new(TREASURY_ADDRESS, false), - AccountMeta::new_readonly(spl_token::ID, false), - ], - data: Upgrade { - amount: amount.to_le_bytes(), - } - .to_bytes(), - } -} - /// Builds an initialize instruction. -#[allow(deprecated)] pub fn initialize(signer: Pubkey) -> Instruction { let bus_pdas = [ bus_pda(0), @@ -229,20 +184,6 @@ pub fn initialize(signer: Pubkey) -> Instruction { AccountMeta::new_readonly(mpl_token_metadata::ID, false), AccountMeta::new_readonly(sysvar::rent::ID, false), ], - data: Initialize { - bus_0_bump: bus_pdas[0].1, - bus_1_bump: bus_pdas[1].1, - bus_2_bump: bus_pdas[2].1, - bus_3_bump: bus_pdas[3].1, - bus_4_bump: bus_pdas[4].1, - bus_5_bump: bus_pdas[5].1, - bus_6_bump: bus_pdas[6].1, - bus_7_bump: bus_pdas[7].1, - config_bump: config_pda.1, - metadata_bump: metadata_pda.1, - mint_bump: mint_pda.1, - treasury_bump: treasury_pda.1, - } - .to_bytes(), + data: Initialize {}.to_bytes(), } } diff --git a/api/src/state/config.rs b/api/src/state/config.rs index 03793ac..9f61c2b 100644 --- a/api/src/state/config.rs +++ b/api/src/state/config.rs @@ -15,9 +15,8 @@ pub struct Config { /// The minimum accepted difficulty. pub min_difficulty: u64, - /// The largest known stake balance on the network from the last epoch. - #[deprecated(since = "2.4.0", note = "Please stake with the boost program")] - pub top_balance: u64, + /// Buffer for possible future use. + pub _buffer: [u8; 8], } account!(OreAccount, Config); diff --git a/api/src/state/proof.rs b/api/src/state/proof.rs index 15bd42d..17f58ed 100644 --- a/api/src/state/proof.rs +++ b/api/src/state/proof.rs @@ -22,9 +22,8 @@ pub struct Proof { /// The last time this account provided a hash. pub last_hash_at: i64, - /// The last time stake was deposited into this account. - #[deprecated(since = "2.4.0", note = "Please stake with the boost program")] - pub last_stake_at: i64, + /// Buffer for possible future use. + pub _buffer: [u8; 8], /// The keypair which has permission to submit hashes for mining. pub miner: Pubkey, diff --git a/program/src/lib.rs b/program/src/lib.rs index 13984d8..ce9d5f0 100644 --- a/program/src/lib.rs +++ b/program/src/lib.rs @@ -4,9 +4,7 @@ mod initialize; mod mine; mod open; mod reset; -mod stake; mod update; -mod upgrade; use claim::*; use close::*; @@ -14,14 +12,11 @@ use initialize::*; use mine::*; use open::*; use reset::*; -use stake::*; use update::*; -use upgrade::*; use ore_api::instruction::*; use steel::*; -#[allow(deprecated)] pub fn process_instruction( program_id: &Pubkey, accounts: &[AccountInfo], @@ -35,9 +30,7 @@ pub fn process_instruction( OreInstruction::Mine => process_mine(accounts, data)?, OreInstruction::Open => process_open(accounts, data)?, OreInstruction::Reset => process_reset(accounts, data)?, - OreInstruction::Stake => process_stake(accounts, data)?, OreInstruction::Update => process_update(accounts, data)?, - OreInstruction::Upgrade => process_upgrade(accounts, data)?, OreInstruction::Initialize => process_initialize(accounts, data)?, } diff --git a/program/src/mine.rs b/program/src/mine.rs index 282b41c..5b94597 100644 --- a/program/src/mine.rs +++ b/program/src/mine.rs @@ -6,7 +6,6 @@ use ore_boost_api::{ consts::{DENOMINATOR_MULTIPLIER, ROTATION_DURATION}, state::{Boost, Config as BoostConfig}, }; -#[allow(deprecated)] use solana_program::{ keccak::hashv, sanitize::SanitizeError, diff --git a/program/src/stake.rs b/program/src/stake.rs deleted file mode 100644 index 9eee05f..0000000 --- a/program/src/stake.rs +++ /dev/null @@ -1,6 +0,0 @@ -use steel::*; - -/// Stake deposits ORE into a proof account to earn multiplier. -pub fn process_stake(_accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult { - panic!("This instruction has been deprecated. Please stake with the boost program instead."); -} diff --git a/program/src/upgrade.rs b/program/src/upgrade.rs deleted file mode 100644 index 8e0786d..0000000 --- a/program/src/upgrade.rs +++ /dev/null @@ -1,6 +0,0 @@ -use steel::*; - -/// Upgrade allows a user to migrate a v1 token to a v2 token at a 1:1 exchange rate. -pub fn process_upgrade(_accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult { - panic!("This instruction has been deprecated. v1 tokens are no longer eligable to upgrade."); -}