diff --git a/Cargo.lock b/Cargo.lock index 704f64a..34e15e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1287,7 +1287,7 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "ore-api" -version = "2.0.0-beta.5" +version = "2.0.0-beta.6" dependencies = [ "array-const-fn-init", "bytemuck", @@ -1305,7 +1305,7 @@ dependencies = [ [[package]] name = "ore-program" -version = "2.0.0-beta.5" +version = "2.0.0-beta.6" dependencies = [ "drillx", "mpl-token-metadata", @@ -1319,7 +1319,7 @@ dependencies = [ [[package]] name = "ore-utils" -version = "2.0.0-beta.5" +version = "2.0.0-beta.6" dependencies = [ "bytemuck", "solana-program", diff --git a/Cargo.toml b/Cargo.toml index 19933db..f87ad9f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["api", "program", "utils"] [workspace.package] -version = "2.0.0-beta.5" +version = "2.0.0-beta.6" edition = "2021" license = "Apache-2.0" homepage = "https://ore.supply" diff --git a/api/src/consts.rs b/api/src/consts.rs index c4e23c0..1b31e4f 100644 --- a/api/src/consts.rs +++ b/api/src/consts.rs @@ -151,10 +151,5 @@ pub const TREASURY_TOKENS_ADDRESS: Pubkey = Pubkey::new_from_array( .0, ); -/// The address of the Solana compute budget program. -pub const COMPUTE_BUDGET_PROGRAM_ID: Pubkey = - pubkey!("ComputeBudget111111111111111111111111111111"); - /// The address of the CU-optimized Solana noop program. -// pub const NOOP_PROGRAM_ID: Pubkey = pubkey!("noop8ytexvkpCuqbf6FB89BSuNemHtPRqaNC31GWivW"); -pub const NOOP_PROGRAM_ID: Pubkey = pubkey!("noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV"); +pub const NOOP_PROGRAM_ID: Pubkey = pubkey!("noop8ytexvkpCuqbf6FB89BSuNemHtPRqaNC31GWivW"); diff --git a/program/src/mine.rs b/program/src/mine.rs index bc8f50a..74c5f11 100644 --- a/program/src/mine.rs +++ b/program/src/mine.rs @@ -208,23 +208,26 @@ fn authenticate(data: &[u8]) -> Result, SanitizeError> { // Iterate through the transaction instructions for i in 0..num_instructions as usize { - // Get byte counter + // Shift pointer to correct positition curr = pc + i * 2; curr = read_u16(&mut curr, data)? as usize; - // Read the instruction program id + // Skip accounts let num_accounts = read_u16(&mut curr, data)? as usize; curr += num_accounts * 33; + + // Read the instruction program id let program_id = read_pubkey(&mut curr, data)?; - // Introspect on the first non compute budget instruction - if program_id.ne(&COMPUTE_BUDGET_PROGRAM_ID) { - // Read address from ix data + // Introspect on the first noop instruction + if program_id.eq(&NOOP_PROGRAM_ID) { + // Retrun address read from instruction data curr += 2; let address = read_pubkey(&mut curr, data)?; return Ok(Some(address)); } } + // Default return none Ok(None) }