mpl_candy_guard/
errors.rs

1use anchor_lang::error_code;
2
3#[error_code]
4pub enum CandyGuardError {
5    #[msg("Could not save guard to account")]
6    InvalidAccountSize,
7
8    #[msg("Could not deserialize guard")]
9    DeserializationError,
10
11    #[msg("Public key mismatch")]
12    PublicKeyMismatch,
13
14    #[msg("Exceeded account increase limit")]
15    DataIncrementLimitExceeded,
16
17    #[msg("Account does not have correct owner")]
18    IncorrectOwner,
19
20    #[msg("Account is not initialized")]
21    Uninitialized,
22
23    #[msg("Missing expected remaining account")]
24    MissingRemainingAccount,
25
26    #[msg("Numerical overflow error")]
27    NumericalOverflowError,
28
29    #[msg("Missing required group label")]
30    RequiredGroupLabelNotFound,
31
32    #[msg("Group not found")]
33    GroupNotFound,
34
35    #[msg("Value exceeded maximum length")]
36    ExceededLength,
37
38    #[msg("Candy machine is empty")]
39    CandyMachineEmpty,
40
41    #[msg("No instruction was found")]
42    InstructionNotFound,
43
44    #[msg("Collection public key mismatch")]
45    CollectionKeyMismatch,
46
47    #[msg("Missing collection accounts")]
48    MissingCollectionAccounts,
49
50    #[msg("Collection update authority public key mismatch")]
51    CollectionUpdateAuthorityKeyMismatch,
52
53    #[msg("Mint must be the last instructions of the transaction")]
54    MintNotLastTransaction,
55
56    #[msg("Mint is not live")]
57    MintNotLive,
58
59    #[msg("Not enough SOL to pay for the mint")]
60    NotEnoughSOL,
61
62    #[msg("Token burn failed")]
63    TokenBurnFailed,
64
65    #[msg("Not enough tokens on the account")]
66    NotEnoughTokens,
67
68    #[msg("Token transfer failed")]
69    TokenTransferFailed,
70
71    #[msg("A signature was required but not found")]
72    MissingRequiredSignature,
73
74    #[msg("Gateway token is not valid")]
75    GatewayTokenInvalid,
76
77    #[msg("Current time is after the set end date")]
78    AfterEndDate,
79
80    #[msg("Current time is not within the allowed mint time")]
81    InvalidMintTime,
82
83    #[msg("Address not found on the allowed list")]
84    AddressNotFoundInAllowedList,
85
86    #[msg("Missing allowed list proof")]
87    MissingAllowedListProof,
88
89    #[msg("Allow list guard is not enabled")]
90    AllowedListNotEnabled,
91
92    #[msg("The maximum number of allowed mints was reached")]
93    AllowedMintLimitReached,
94
95    #[msg("Invalid NFT collection")]
96    InvalidNftCollection,
97
98    #[msg("Missing NFT on the account")]
99    MissingNft,
100
101    #[msg("Current redemeed items is at the set maximum amount")]
102    MaximumRedeemedAmount,
103
104    #[msg("Address not authorized")]
105    AddressNotAuthorized,
106
107    #[msg("Missing freeze instruction data")]
108    MissingFreezeInstruction,
109
110    #[msg("Freeze guard must be enabled")]
111    FreezeGuardNotEnabled,
112
113    #[msg("Freeze must be initialized")]
114    FreezeNotInitialized,
115
116    #[msg("Missing freeze period")]
117    MissingFreezePeriod,
118
119    #[msg("The freeze escrow account already exists")]
120    FreezeEscrowAlreadyExists,
121
122    #[msg("Maximum freeze period exceeded")]
123    ExceededMaximumFreezePeriod,
124
125    #[msg("Thaw is not enabled")]
126    ThawNotEnabled,
127
128    #[msg("Unlock is not enabled (not all NFTs are thawed)")]
129    UnlockNotEnabled,
130
131    #[msg("Duplicated group label")]
132    DuplicatedGroupLabel,
133
134    #[msg("Duplicated mint limit id")]
135    DuplicatedMintLimitId,
136
137    #[msg("An unauthorized program was found in the transaction")]
138    UnauthorizedProgramFound,
139
140    #[msg("Exceeded the maximum number of programs in the additional list")]
141    ExceededProgramListSize,
142
143    #[msg("Allocation PDA not initialized")]
144    AllocationNotInitialized,
145
146    #[msg("Allocation limit was reached")]
147    AllocationLimitReached,
148
149    #[msg("Allocation guard must be enabled")]
150    AllocationGuardNotEnabled,
151
152    #[msg("Candy machine has an invalid mint authority")]
153    InvalidMintAuthority,
154
155    #[msg("Instruction could not be created")]
156    InstructionBuilderFailed,
157
158    #[msg("Invalid account version")]
159    InvalidAccountVersion,
160}