spl_token_2022_interface/
native_mint.rs

1//! The Mint that represents the native token
2
3/// There are `10^9` lamports in one SOL
4pub const DECIMALS: u8 = 9;
5
6// The Mint for native SOL Token accounts
7solana_pubkey::declare_id!("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");
8
9/// Seed for the native mint's program-derived address
10pub const PROGRAM_ADDRESS_SEEDS: &[&[u8]] = &["native-mint".as_bytes(), &[255]];
11
12#[cfg(test)]
13mod tests {
14    use {super::*, solana_pubkey::Pubkey};
15
16    #[test]
17    fn expected_native_mint_id() {
18        let native_mint_id =
19            Pubkey::create_program_address(PROGRAM_ADDRESS_SEEDS, &crate::id()).unwrap();
20        assert_eq!(id(), native_mint_id);
21    }
22}