Skip to main content

📦 Airdrop

This page documents the Airdrop PDA Account.

📘 Overview

The Airdrop Account defines a token distribution event within the Dropsy protocol.
It stores configuration, timing rules, supply, Merkle-based whitelisting, delegation permissions, and links to related accounts such as the Affiliate, Bitmap, and Vesting Accounts.

This account is a zero-copy PDA, enabling highly efficient on-chain reads.


🔐 PDA Derivation

The AirdropMaster PDA is derived using the following seeds:

  • airdrop → constant seed identifying the airdrop namespace
  • authority → the wallet (or program) that owns & manages the airdrop
  • mint → the mint address (airdropped token)

Derive Airdrop Pda Example

import {
Address,
getAddressEncoder,
getProgramDerivedAddress,
ProgramDerivedAddressBump,
ReadonlyUint8Array,
} from "@solana/kit";

export type DropsyPda = readonly [Address<string>, ProgramDerivedAddressBump];
type Seed = ReadonlyUint8Array | string;

export async function getAirdropDerivedAddress(
authority: Address,
mint: Address
): Promise<DropsyPda> {
const seeds = [
Buffer.from("airdrop"),
getAddressEncoder().encode(mint),
getAddressEncoder().encode(authority),
];
return await getProgramDerivedAddress({
seeds,
programAddress: DROPSY_PROGRAM_ADDRESS,
});
}

🧱 Account Structure

FieldTypeDescription
discriminatorReadonlyUint8ArrayAnchor 8-byte account discriminator.
masterAddressParent AirdropMaster PDA.
authorityAddressWallet allowed to update/close this airdrop.
mintAddressToken mint being distributed.
delegateAuthorityAddressOptional delegated authority for claim map operations.
presaleAddressAddress used for presale or restricted access logic.
merkleRootReadonlyUint8ArrayMerkle root for WL / eligibility validation.
supplybigintTotal token supply allocated to this airdrop.
boostbigintBoost multiplier applied for boosted claim mechanics.
startsAtbigintUnix timestamp for when the airdrop becomes claimable.
endsAtbigintUnix timestamp when the airdrop ends (claims disabled).
bitmapCountnumberNumber of Bitmap (claim maps) created under this airdrop.
delegatePermissionsnumberBitmask defining what permissions delegates have.
mutablenumberWhether this airdrop can be updated (0 = immutable, 1 = mutable).
statenumberCurrent airdrop state (Active, Closed, Drained, etc.).
versionnumberVersion of the Airdrop layout.
bumpnumberPDA bump seed.
paddingReadonlyUint8ArrayReserved space for future upgrades.

📥 Fetch Airdrop Account

import { address } from "@solana/kit";
import { fetchAirdrop } from "@dropsy/sdk";

// The AirdropMaster PDA you want to fetch
const airdrop_address = address("12354.....abndks");

(async () => {
try {
const airdrop = await fetchAirdrop(rpc, airdrop_address);

console.log("Airdrop Loaded:");
console.log("Authority:", airdrop.authority.toString());
} catch (err) {
console.error("Failed to fetch Airdrop:", err);
}
})();