ore-legacy-api 0.1.0

Solana native store of value.
Documentation
use const_crypto::ed25519;
use solana_program::{pubkey, pubkey::Pubkey};

/// The seed of the board account PDA.
pub const PROOF: &[u8] = b"proof";

/// The seed of the share account PDA.
pub const SHARE: &[u8] = b"share";

/// The seed of the config account PDA.
pub const CONFIG: &[u8] = b"config";

/// The seed of the member account PDA.
pub const MEMBER: &[u8] = b"member";

/// The seed of the boost account PDA.
pub const BOOST: &[u8] = b"boost";

/// The seed of the stake account PDA.
pub const STAKE: &[u8] = b"stake";

/// The address of the legacy ORE pool program.
pub const POOL_PROGRAM_ID: Pubkey = pubkey!("poo1sKMYsZtDDS7og73L68etJQYyn6KXhXTLz1hizJc");

/// The address of the legacy ORE program.
pub const ORE_V2_PROGRAM_ID: Pubkey = pubkey!("oreV2ZymfyeXgNgBdqMkumTqqAprVqgBWQfoYkrtKWQ");

/// The address of the pool program.
pub const BOOST_V1_PROGRAM_ID: Pubkey = pubkey!("boostmPwypNUQu8qZ8RoWt5DXyYSVYxnBXqbbrGjecc");

/// The address of the boost program.
pub const BOOST_V2_PROGRAM_ID: Pubkey = pubkey!("BoostzzkNfCA9D1qNuN5xZxB5ErbK4zQuBeTHGDpXT1");

/// The address of the ORE mint.
pub const MINT_ADDRESS: Pubkey = pubkey!("oreoU2P8bN6jkk3jbaiVxYnG1dCXcYxwhwyK9jSybcp");

/// The seed of the treasury account PDA.
pub const TREASURY: &[u8] = b"treasury";

/// The address of the treasury account.
pub const ORE_V2_TREASURY_ADDRESS: Pubkey = Pubkey::new_from_array(
    ed25519::derive_program_address(&[TREASURY], &ORE_V2_PROGRAM_ID.to_bytes()).0,
);

/// The bump of the treasury account, for cpis.
pub const ORE_V2_TREASURY_BUMP: u8 =
    ed25519::derive_program_address(&[TREASURY], &ORE_V2_PROGRAM_ID.to_bytes()).1;

/// The address of the treasury token account.
pub const ORE_V2_TREASURY_TOKENS_ADDRESS: Pubkey = Pubkey::new_from_array(
    ed25519::derive_program_address(
        &[
            unsafe { &*(&ORE_V2_TREASURY_ADDRESS as *const Pubkey as *const [u8; 32]) },
            unsafe { &*(&spl_token::id() as *const Pubkey as *const [u8; 32]) },
            unsafe { &*(&MINT_ADDRESS as *const Pubkey as *const [u8; 32]) },
        ],
        unsafe { &*(&spl_associated_token_account::id() as *const Pubkey as *const [u8; 32]) },
    )
    .0,
);