Controller Structure
The Controller is a Program Derived Account (PDA) that serves as the central management unit for creating and closing airdrops. It enforces controller fees, tracks versioning, and maintains authority relationships. The account structure is optimized for efficient on-chain storage (75 bytes total).
Account Structure
Here's the complete Rust representation of the Controller account:
#[account]
pub struct Controller {
/// The controller authority (32 bytes)
pub authority: Pubkey,
/// Fee vault address derived from authority (32 bytes)
pub fee_vault: Pubkey,
/// Fee (in lamports) required per airdrop action (8 bytes)
pub fee_lamports: u64,
/// Versioning for upgrades (1 byte)
pub version: u8,
/// PDA bump seed (1 byte)
pub bump: u8,
/// Fee vault bump seed (1 byte)
pub fee_vault_bump: u8,
}
Field | Type | Description |
---|---|---|
authority | Pubkey | Wallet that owns and manages this controller |
fee_vault | Pubkey | Vault PDA to receive protocol fees |
fee_lamports | u64 | Amount (in lamports) required per airdrop action |
version | u8 | Used for protocol upgrades (0 = initial version) |
bump | u8 | PDA bump seed for the controller account |
fee_vault_bump | u8 | PDA bump seed for the fee vault account |
Field
authority
Type
Pubkey
Description
Wallet that owns and manages this controller
Field
fee_vault
Type
Pubkey
Description
Vault PDA to receive protocol fees
Field
fee_lamports
Type
u64
Description
Amount (in lamports) required per airdrop action
Field
version
Type
u8
Description
Used for protocol upgrades (0 = initial version)
Field
bump
Type
u8
Description
PDA bump seed for the controller account
Field
fee_vault_bump
Type
u8
Description
PDA bump seed for the fee vault account
🚀 Ready for Action!Now that you understand how Controller data is stored on-chain, let's create your first Controller! Continue to the next section to learn how to initialize a Controller account and start managing airdrops.