spl_token_interface/
lib.rs

1#![allow(clippy::arithmetic_side_effects)]
2#![deny(missing_docs)]
3#![cfg_attr(not(test), warn(unsafe_code))]
4
5//! An ERC20-like Token program for the Solana blockchain
6
7use {
8    solana_program_error::{ProgramError, ProgramResult},
9    solana_pubkey::Pubkey,
10};
11
12pub mod error;
13pub mod instruction;
14pub mod native_mint;
15pub mod state;
16
17solana_pubkey::declare_id!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
18
19/// Checks that the supplied program ID is the correct one for SPL-token
20pub fn check_program_account(spl_token_program_id: &Pubkey) -> ProgramResult {
21    if spl_token_program_id != &id() {
22        return Err(ProgramError::IncorrectProgramId);
23    }
24    Ok(())
25}