Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Make spl-program-ids crate and move declare_id usage in there #6989

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ members = [
"memo/program",
"name-service/program",
"managed-token/program",
"program-ids",
"record/program",
"shared-memory/program",
"single-pool/cli",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ spl-concurrent-merkle-tree = { version = "0.3.0", path = "../../../libraries/con
"sol-log",
] }
spl-noop = { version = "0.2.0", path = "../noop", features = ["no-entrypoint"] }
spl-program-ids = { version = "1.0.0", path = "../../../program-ids" }

[profile.release]
overflow-checks = true
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub use spl_concurrent_merkle_tree::{
node::Node,
};

declare_id!("cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK");
pub use spl_program_ids::spl_account_compression::*;

/// Context for initializing a new SPL ConcurrentMerkleTree
#[derive(Accounts)]
Expand Down
1 change: 1 addition & 0 deletions account-compression/programs/noop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ default = []

[dependencies]
solana-program = ">=1.18.11,<=2"
spl-program-ids = { version = "1.0.0", path = "../../../program-ids" }
2 changes: 1 addition & 1 deletion account-compression/programs/noop/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use solana_program::{
pubkey::Pubkey,
};

declare_id!("noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV");
pub use spl_program_ids::spl_noop::*;

#[cfg(not(feature = "no-entrypoint"))]
solana_program::entrypoint!(noop);
Expand Down
1 change: 1 addition & 0 deletions associated-token-account/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ borsh = "1.5.1"
num-derive = "0.4"
num-traits = "0.2"
solana-program = "2.0.0"
spl-program-ids = { version = "1.0.0", path = "../../program-ids" }
spl-token = { version = "6.0", path = "../../token/program", features = [
"no-entrypoint",
] }
Expand Down
8 changes: 3 additions & 5 deletions associated-token-account/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ pub mod instruction;
pub mod processor;
pub mod tools;

// Export current SDK types for downstream users building with a different SDK
// version
pub use solana_program;
use solana_program::{
instruction::{AccountMeta, Instruction},
pubkey::Pubkey,
sysvar,
};

solana_program::declare_id!("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
// Export current SDK types for downstream users building with a different SDK
// version
pub use {solana_program, spl_program_ids::spl_associated_token_account::*};

pub(crate) fn get_associated_token_address_and_bump_seed(
wallet_address: &Pubkey,
Expand Down
1 change: 1 addition & 0 deletions binary-option/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ test-sbf = []

[dependencies]
solana-program = "2.0.0"
spl-program-ids = { version = "1.0.0", path = "../../program-ids" }
thiserror = "1.0"
spl-token = { version = "6.0", path = "../../token/program", features = [
"no-entrypoint",
Expand Down
4 changes: 1 addition & 3 deletions binary-option/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ pub mod system_utils;
pub mod validation_utils;
// Export current sdk types for downstream users building with a different sdk
// version
pub use solana_program;

solana_program::declare_id!("betw959P4WToez4DkuXwNsJszqbpe3HuY56AcG5yevx");
pub use {solana_program, spl_program_ids::spl_binary_option::*};
1 change: 1 addition & 0 deletions binary-oracle-pair/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ test-sbf = []
num-derive = "0.4"
num-traits = "0.2"
solana-program = "2.0.0"
spl-program-ids = { version = "1.0.0", path = "../../program-ids" }
spl-token = { version = "6.0", path = "../../token/program", features = [
"no-entrypoint",
] }
Expand Down
3 changes: 1 addition & 2 deletions binary-oracle-pair/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ mod entrypoint;
// Export current sdk types for downstream users building with a different sdk
// version
pub use solana_program;

// Binary Oracle Pair id
solana_program::declare_id!("Fd7btgySsrjuo25CJCj7oE7VPMyezDhnx7pZkj2v69Nk");
pub use spl_program_ids::spl_bianry_oracle_pair::*;
1 change: 1 addition & 0 deletions feature-proposal/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ test-sbf = []
[dependencies]
borsh = "1.5.1"
solana-program = "2.0.0"
spl-program-ids = { version = "1.0.0", path = "../../program-ids" }
spl-token = { version = "6.0", path = "../../token/program", features = [
"no-entrypoint",
] }
Expand Down
6 changes: 2 additions & 4 deletions feature-proposal/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ pub mod instruction;
pub mod processor;
pub mod state;

use solana_program::{program_pack::Pack, pubkey::Pubkey};
// Export current SDK types for downstream users building with a different SDK
// version
pub use solana_program;
use solana_program::{program_pack::Pack, pubkey::Pubkey};

solana_program::declare_id!("Feat1YXHhH6t1juaWF74WLcfv4XoNocjXA6sPWHNgAse");
pub use {solana_program, spl_program_ids::spl_feature_proposal::*};

pub(crate) fn get_mint_address_with_seed(feature_proposal_address: &Pubkey) -> (Pubkey, u8) {
Pubkey::find_program_address(&[&feature_proposal_address.to_bytes(), br"mint"], &id())
Expand Down
1 change: 1 addition & 0 deletions instruction-padding/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ test-sbf = []
[dependencies]
num_enum = "0.7.2"
solana-program = "2.0.0"
spl-program-ids = { version = "1.0.0", path = "../../program-ids" }

[dev-dependencies]
solana-program-test = "2.0.0"
Expand Down
3 changes: 1 addition & 2 deletions instruction-padding/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ mod entrypoint;
pub mod instruction;
pub mod processor;

pub use solana_program;
solana_program::declare_id!("iXpADd6AW1k5FaaXum5qHbSqyd7TtoN6AD7suVa83MF");
pub use {solana_program, spl_program_ids::spl_instruction_padding::*};
1 change: 1 addition & 0 deletions libraries/math/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ borsh = "1.5.1"
num-derive = "0.4"
num-traits = "0.2"
solana-program = "2.0.0"
spl-program-ids = { version = "1.0.0", path = "../../program-ids" }
thiserror = "1.0"
uint = "0.9"

Expand Down
2 changes: 1 addition & 1 deletion libraries/math/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ pub mod precise_number;
pub mod processor;
pub mod uint;

solana_program::declare_id!("Math111111111111111111111111111111111111111");
pub use spl_program_ids::spl_math::*;
1 change: 1 addition & 0 deletions managed-token/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ solana-program = "2.0.0"
spl-associated-token-account = { version = "4.0.0", path = "../../associated-token-account/program", features = [
"no-entrypoint",
] }
spl-program-ids = { version = "1.0.0", path = "../../program-ids" }
spl-token = { version = "6.0", path = "../../token/program", features = [
"no-entrypoint",
] }
Expand Down
3 changes: 1 addition & 2 deletions managed-token/program/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
solana_program::declare_id!("mTok58Lg4YfcmwqyrDHpf7ogp599WRhzb6PxjaBqAxS");

pub use spl_program_ids::spl_managed_token::*;
use {
borsh::BorshDeserialize,
solana_program::{
Expand Down
1 change: 1 addition & 0 deletions memo/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ test-sbf = []

[dependencies]
solana-program = "2.0.0"
spl-program-ids = { version = "1.0.0", path = "../../program-ids" }

[dev-dependencies]
solana-program-test = "2.0.0"
Expand Down
13 changes: 3 additions & 10 deletions memo/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,13 @@
mod entrypoint;
pub mod processor;

// Export current sdk types for downstream users building with a different sdk
// version
pub use solana_program;
use solana_program::{
instruction::{AccountMeta, Instruction},
pubkey::Pubkey,
};

/// Legacy symbols from Memo v1
pub mod v1 {
solana_program::declare_id!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo");
}

solana_program::declare_id!("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr");
// Export current sdk types for downstream users building with a different sdk
// version
pub use {solana_program, spl_program_ids::spl_memo::*};

/// Build a memo instruction, possibly signed
///
Expand Down
1 change: 1 addition & 0 deletions name-service/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ test-sbf = []

[dependencies]
solana-program = "2.0.0"
spl-program-ids = { version = "1.0.0", path = "../../program-ids" }
num-traits = "0.2"
borsh = "1.5.1"
num-derive = "0.4.2"
Expand Down
4 changes: 1 addition & 3 deletions name-service/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ pub mod state;

// Export current sdk types for downstream users building with a different sdk
// version
pub use solana_program;

solana_program::declare_id!("namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX");
pub use {solana_program, spl_program_ids::spl_name_service::*};
12 changes: 12 additions & 0 deletions program-ids/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "spl-program-ids"
version = "1.0.0"
description = "Solana Program Library Program IDs"
authors = ["Solana Labs Maintainers <[email protected]>"]
repository = "https://github.com/solana-labs/solana-program-library"
license = "Apache-2.0"
edition = "2021"


[dependencies]
solana-program = "2.0.0"
Loading