#![deny(missing_docs)]
#![cfg_attr(not(test), forbid(unsafe_code))]
pub mod error;
pub mod instruction;
pub mod processor;
pub mod state;
#[cfg(all(not(feature = "no-entrypoint"), not(test)))]
mod entrypoint;
use arch_program::{entrypoint::ProgramResult, program_error::ProgramError, pubkey::Pubkey};
pub fn id() -> Pubkey {
Pubkey::from_slice(b"ArchTokenMetadata111111111111111")
}
pub fn check_program_account(program_id: &Pubkey) -> ProgramResult {
if program_id != &id() {
return Err(ProgramError::IncorrectProgramId);
}
Ok(())
}
pub const METADATA_SEED: &[u8] = b"metadata";
pub const ATTRIBUTES_SEED: &[u8] = b"attributes";
pub fn find_metadata_pda_with_program(program_id: &Pubkey, mint: &Pubkey) -> (Pubkey, u8) {
Pubkey::find_program_address(&[METADATA_SEED, mint.as_ref()], program_id)
}
pub fn find_attributes_pda_with_program(program_id: &Pubkey, mint: &Pubkey) -> (Pubkey, u8) {
Pubkey::find_program_address(&[ATTRIBUTES_SEED, mint.as_ref()], program_id)
}