lib.rs 676 B

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