diff --git a/program/src/claim.rs b/program/src/claim.rs index 8668190..7fa8c48 100644 --- a/program/src/claim.rs +++ b/program/src/claim.rs @@ -1,7 +1,4 @@ use ore_api::{consts::*, error::OreError, instruction::*, loaders::*, state::Proof}; -use solana_program::{ - account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, -}; use steel::*; /// Claim distributes claimable ORE from the treasury to a miner. diff --git a/program/src/close.rs b/program/src/close.rs index 94e63e4..6737ade 100644 --- a/program/src/close.rs +++ b/program/src/close.rs @@ -1,8 +1,5 @@ use ore_api::state::Proof; -use solana_program::{ - account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, - system_program, -}; +use solana_program::system_program; use steel::*; /// Close closes a proof account and returns the rent to the owner. diff --git a/program/src/mine.rs b/program/src/mine.rs index 1fb35e6..1cdadb7 100644 --- a/program/src/mine.rs +++ b/program/src/mine.rs @@ -11,12 +11,7 @@ use ore_api::{ use solana_program::program::set_return_data; #[allow(deprecated)] use solana_program::{ - account_info::AccountInfo, - clock::Clock, - entrypoint::ProgramResult, keccak::hashv, - program_error::ProgramError, - pubkey::Pubkey, sanitize::SanitizeError, serialize_utils::{read_pubkey, read_u16}, slot_hashes::SlotHash, diff --git a/program/src/open.rs b/program/src/open.rs index ceee168..94c7dec 100644 --- a/program/src/open.rs +++ b/program/src/open.rs @@ -2,11 +2,7 @@ use std::mem::size_of; use ore_api::{consts::*, instruction::Open, state::Proof}; use solana_program::{ - account_info::AccountInfo, - clock::Clock, - entrypoint::ProgramResult, keccak::hashv, - program_error::ProgramError, slot_hashes::SlotHash, system_program, sysvar::{self, Sysvar}, diff --git a/program/src/reset.rs b/program/src/reset.rs index fccb2f3..2800139 100644 --- a/program/src/reset.rs +++ b/program/src/reset.rs @@ -4,7 +4,6 @@ use ore_api::{ loaders::*, state::{Bus, Config}, }; -use solana_program::clock::Clock; use steel::*; /// Reset tops up the bus balances, updates the base reward rate, and sets up the ORE program for the next epoch. diff --git a/program/src/stake.rs b/program/src/stake.rs index 9a4ac41..1e495dd 100644 --- a/program/src/stake.rs +++ b/program/src/stake.rs @@ -1,8 +1,4 @@ use ore_api::{consts::*, instruction::Stake, loaders::*, state::Proof}; -use solana_program::{ - account_info::AccountInfo, clock::Clock, entrypoint::ProgramResult, - program_error::ProgramError, sysvar::Sysvar, -}; use steel::*; /// Stake deposits ORE into a proof account to earn multiplier. diff --git a/program/src/update.rs b/program/src/update.rs index b101a3e..6bf6f74 100644 --- a/program/src/update.rs +++ b/program/src/update.rs @@ -1,7 +1,4 @@ use ore_api::state::Proof; -use solana_program::{ - account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, -}; use steel::*; /// Update changes the miner authority on a proof account. diff --git a/program/src/upgrade.rs b/program/src/upgrade.rs index 202eb53..058c400 100644 --- a/program/src/upgrade.rs +++ b/program/src/upgrade.rs @@ -1,9 +1,4 @@ use ore_api::{consts::*, error::OreError, instruction::Stake}; -use solana_program::{ - account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError, - program_pack::Pack, -}; -use spl_token::state::Mint; use steel::*; /// Upgrade allows a user to migrate a v1 token to a v2 token at a 1:1 exchange rate. @@ -24,7 +19,7 @@ pub fn process_upgrade(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResu .to_token_account()? .check(|t| t.owner == *signer_info.key)? .check(|t| t.mint == MINT_ADDRESS)?; - mint_info + let mint = mint_info .is_writable()? .has_address(&MINT_ADDRESS)? .to_mint()?; @@ -62,14 +57,11 @@ pub fn process_upgrade(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResu let amount_to_mint = amount.saturating_mul(100); // Cap at max supply. - let mint_data = mint_info.data.borrow(); - let mint = Mint::unpack(&mint_data)?; if mint.supply.saturating_add(amount_to_mint).gt(&MAX_SUPPLY) { return Err(OreError::MaxSupply.into()); } // Mint to the beneficiary account - drop(mint_data); mint_to_signed( mint_info, beneficiary_info,