mirror of
https://github.com/d0zingcat/ore.git
synced 2026-06-03 07:36:49 +00:00
remove all admin functions
This commit is contained in:
@@ -103,16 +103,6 @@ pub enum OreInstruction {
|
||||
#[account(18, name = "mpl_metadata_program", desc = "Metaplex metadata program")]
|
||||
#[account(19, name = "rent", desc = "Solana rent sysvar")]
|
||||
Initialize = 100,
|
||||
|
||||
#[account(0, name = "ore_program", desc = "Ore program")]
|
||||
#[account(1, name = "signer", desc = "Admin signer", signer)]
|
||||
#[account(2, name = "config", desc = "Ore config account", writable)]
|
||||
UpdateAdmin = 101,
|
||||
|
||||
#[account(0, name = "ore_program", desc = "Ore program")]
|
||||
#[account(1, name = "signer", desc = "Admin signer", signer)]
|
||||
#[account(2, name = "config", desc = "Ore config account", writable)]
|
||||
Pause = 103,
|
||||
}
|
||||
|
||||
impl OreInstruction {
|
||||
@@ -187,8 +177,6 @@ impl_to_bytes!(MineArgs);
|
||||
impl_to_bytes!(ClaimArgs);
|
||||
impl_to_bytes!(StakeArgs);
|
||||
impl_to_bytes!(UpgradeArgs);
|
||||
impl_to_bytes!(UpdateAdminArgs);
|
||||
impl_to_bytes!(PauseArgs);
|
||||
|
||||
impl_instruction_from_bytes!(InitializeArgs);
|
||||
impl_instruction_from_bytes!(RegisterArgs);
|
||||
@@ -196,8 +184,6 @@ impl_instruction_from_bytes!(MineArgs);
|
||||
impl_instruction_from_bytes!(ClaimArgs);
|
||||
impl_instruction_from_bytes!(StakeArgs);
|
||||
impl_instruction_from_bytes!(UpgradeArgs);
|
||||
impl_instruction_from_bytes!(UpdateAdminArgs);
|
||||
impl_instruction_from_bytes!(PauseArgs);
|
||||
|
||||
/// Builds a reset instruction.
|
||||
pub fn reset(signer: Pubkey) -> Instruction {
|
||||
@@ -414,39 +400,3 @@ pub fn initialize(signer: Pubkey) -> Instruction {
|
||||
.concat(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Build an update_admin instruction.
|
||||
pub fn update_admin(signer: Pubkey, new_admin: Pubkey) -> Instruction {
|
||||
Instruction {
|
||||
program_id: crate::id(),
|
||||
accounts: vec![
|
||||
AccountMeta::new(signer, true),
|
||||
AccountMeta::new(CONFIG_ADDRESS, false),
|
||||
],
|
||||
data: [
|
||||
OreInstruction::UpdateAdmin.to_vec(),
|
||||
UpdateAdminArgs { new_admin }.to_bytes().to_vec(),
|
||||
]
|
||||
.concat(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Build a pause instruction.
|
||||
pub fn pause(signer: Pubkey, paused: bool) -> Instruction {
|
||||
Instruction {
|
||||
program_id: crate::id(),
|
||||
accounts: vec![
|
||||
AccountMeta::new(signer, true),
|
||||
AccountMeta::new(CONFIG_ADDRESS, false),
|
||||
],
|
||||
data: [
|
||||
OreInstruction::UpdateAdmin.to_vec(),
|
||||
PauseArgs {
|
||||
paused: paused as u8,
|
||||
}
|
||||
.to_bytes()
|
||||
.to_vec(),
|
||||
]
|
||||
.concat(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user