mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-14 15:10:13 +00:00
cleanup imports
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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},
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user