solana_sysvar_id

Macro declare_id

Source
macro_rules! declare_id {
    ($address:expr) => { ... };
}
Expand description

Re-export types required for macros 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_pubkey::{declare_id, Pubkey};

declare_id!("My11111111111111111111111111111111111111111");

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