This commit is contained in:
Hardhat Chad
2024-07-29 23:27:58 +00:00
parent e143ea0876
commit accab7e0e8
8 changed files with 30 additions and 112 deletions

View File

@@ -18,24 +18,7 @@ use spl_token::state::Mint;
use crate::utils::{create_pda, AccountDeserialize, Discriminator};
/// Initialize sets up the Ore program. Its responsibilities include:
/// 1. Initialize the 8 bus accounts.
/// 2. Initialize the treasury account.
/// 3. Initialize the Ore mint account.
/// 4. Initialize the mint metadata account.
/// 5. Initialize the treasury token account.
/// 6. Set the signer as the program admin.
///
/// Safety requirements:
/// - Initialize is a permissionless instruction and can be called by anyone.
/// - Can only succeed once for the entire lifetime of the program.
/// - Can only succeed if all provided PDAs match their expected values.
/// - Can only succeed if provided system program, token program,
/// associated token program, metadata program, and rent sysvar are valid.
///
/// Discussion
/// - The signer of this instruction is set as the program admin and the
/// upgrade authority of the mint metadata account.
/// Initialize sets up the ORE program to begin mining.
pub fn process_initialize<'a, 'info>(
accounts: &'a [AccountInfo<'info>],
data: &[u8],