declare_id!() { /* proc-macro */ }
Expand description

Convenience macro to declare a static public key and functions to interact with it

Input: a single literal base58 string representation of a program’s id

Example

use std::str::FromStr;
use solana_sdk::{declare_id, pubkey::Pubkey};

declare_id!("My11111111111111111111111111111111111111111");

let my_id = Pubkey::from_str("My11111111111111111111111111111111111111111").unwrap();
assert_eq!(id(), my_id);