airdrop-api 0.1.0

Mint and Airdrop Framework on Solana for Sovereign Individuals
Documentation
use const_crypto::ed25519;
use solana_program::{pubkey, pubkey::Pubkey};
use steel::*;

// Test initializer (mac::id.json)
// pub const INITIALIZER_ADDRESS: Pubkey = pubkey!("Ac2ev4ofDx61tuSJCgq9ToSBfVwHD2a1FVJf6p7TAqiB");
// Test initializer (mac&hp::test-id.json)
pub const INITIALIZER_ADDRESS: Pubkey = pubkey!("4ALL9EAVHpv7ioJF95ktDLtrHUEJezPuFxTFFMy3fpSy");

/// The authority allowed to initialize the program.
// pub const INITIALIZER_ADDRESS: Pubkey = pubkey!("staryJacbXodPh4WfwVtgA5jkJhvsMHERtkdttnLEHc");

/// Campaign status codes
pub const CAMPAIGN_STATUS_ACTIVE: u8 = 0;
pub const CAMPAIGN_STATUS_PAUSED: u8 = 1;
pub const CAMPAIGN_STATUS_CLOSED: u8 = 2;

/// Account type discriminators
#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
pub enum AirdropAccount {
    Config = 0,
    Campaign = 1,
    Allocation = 2,
}

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

/// The seed of the fee account PDA.
pub const FEE_ACCOUNT: &[u8] = b"fee_account";

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

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

/// The seed of the mint authority PDA.
pub const MINT_AUTHORITY: &[u8] = b"mint_authority";

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

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

/// Program id for const pda derivations
const PROGRAM_ID: [u8; 32] = unsafe { *(&crate::id() as *const Pubkey as *const [u8; 32]) };

/// The address of the config account.
pub const CONFIG_ADDRESS: Pubkey =
    Pubkey::new_from_array(ed25519::derive_program_address(&[CONFIG], &PROGRAM_ID).0);

/// Maximum merkle proof length (prevents DoS attacks)
/// Supports up to 2^25 = 33M recipients in a single campaign
pub const MAX_MERKLE_PROOF_LENGTH: u8 = 25;