Skip to main content

airdrop_api/state/
campaign.rs

1use solana_program::pubkey::Pubkey;
2use steel::*;
3
4/// Campaign account stores metadata for an airdrop campaign
5#[repr(C)]
6#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
7pub struct Campaign {
8    /// Campaign owner (can allocate and manage campaign)
9    pub owner: Pubkey,
10
11    /// SPL Token mint for this campaign (created by CreateMint, can be shared)
12    pub mint: Pubkey,
13
14    /// Campaign treasury (token account holding airdrop tokens for distribution)
15    pub treasury: Pubkey,
16
17    /// Merkle root for this campaign (single merkle tree per campaign)
18    /// Zero = not initialized (on-chain allocation mode)
19    pub merkle_root: [u8; 32],
20
21    /// Total allocated tokens (for tracking)
22    pub total_allocated: u64,
23
24    /// Total claimed tokens (for tracking)
25    pub total_claimed: u64,
26
27    /// Maximum supply cap for this campaign (0 = unlimited)
28    /// Note: Tokens are already minted in mint treasury, this is for tracking/documentation
29    pub max_supply: u64,
30
31    /// Creation timestamp
32    pub created_at: i64,
33
34    /// Campaign status: 0=Active, 1=Paused, 2=Closed
35    pub status: u8,
36
37    /// Padding for alignment
38    pub _padding: [u8; 7],
39}
40
41use crate::consts::AirdropAccount;
42account!(AirdropAccount, Campaign);