remove all admin functions

This commit is contained in:
Hardhat Chad
2024-06-24 21:08:33 +00:00
parent dfc24e5c46
commit 4ce510cfa2
10 changed files with 11 additions and 181 deletions

View File

@@ -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(),
}
}