macro_rules! declare_id {
( $literal:expr ) => { ... };
}Expand description
Declare a program’s on-chain id, mirroring the declare_id! convention
every other Solana framework ships (Anchor, Pinocchio, Quasar).
Expands to a pub const ID: Address decoded at compile time, a
pub const fn id() -> Address accessor, and a pub fn check_id(&Address) -> bool guard. Programs that pin their own id for self-PDA derivation,
CPI-guard checks, or require_keys_eq!(program.key(), &crate::ID) use this
instead of hand-rolling an address! constant.
ⓘ
hopper::declare_id!("D8UGWDX5QRwEkKs2J9Sweabf4zd6hzdLqv7CB11SF91F");
assert!(crate::check_id(&crate::ID));