Skip to main content

airdrop_api/
error.rs

1use steel::*;
2
3#[derive(Debug, Error, Clone, Copy, PartialEq, Eq, IntoPrimitive)]
4#[repr(u32)]
5pub enum AirdropError {
6    #[error("Invalid campaign owner")]
7    InvalidOwner = 0,
8    
9    #[error("Invalid program admin")]
10    InvalidProgramAdmin = 1,
11    
12    #[error("Campaign not found")]
13    CampaignNotFound = 2,
14    
15    #[error("Campaign is not active")]
16    CampaignNotActive = 3,
17    
18    #[error("Invalid allocation amount")]
19    InvalidAmount = 4,
20    
21    #[error("Allocation already claimed")]
22    AlreadyClaimed = 5,
23    
24    #[error("Invalid recipient")]
25    InvalidRecipient = 6,
26    
27    #[error("Invalid signature")]
28    InvalidSignature = 7,
29    
30    #[error("Nonce already used")]
31    NonceAlreadyUsed = 8,
32    
33    #[error("Insufficient treasury balance")]
34    InsufficientBalance = 9,
35    
36    #[error("Invalid campaign ID")]
37    InvalidCampaignId = 10,
38    
39    #[error("Invalid mint")]
40    InvalidMint = 11,
41    
42    #[error("Insufficient fee payment")]
43    InsufficientFee = 12,
44    
45    #[error("Config not initialized")]
46    ConfigNotInitialized = 13,
47    
48    #[error("Invalid fee amount")]
49    InvalidFeeAmount = 14,
50    
51    #[error("Invalid mint authority")]
52    InvalidMintAuthority = 15,
53    
54    #[error("Merkle root not set")]
55    MerkleRootNotSet = 16,
56    
57    #[error("Invalid merkle proof")]
58    InvalidMerkleProof = 17,
59    
60    #[error("Max supply exceeded")]
61    MaxSupplyExceeded = 18,
62    
63    #[error("Mint authority has been revoked")]
64    MintAuthorityRevoked = 19,
65}
66
67error!(AirdropError);
68