Skip to main content

shadow_drive_user_staking/
errors.rs

1use anchor_lang::prelude::*;
2
3#[error_code]
4pub enum ErrorCodes {
5    // New Global Error Codes
6    #[msg("Not enough storage available on this Storage Account")]
7    NotEnoughStorage,
8    #[msg("The length of the file name exceeds the limit of 32 bytes")]
9    FileNameLengthExceedsLimit,
10    #[msg("Invalid sha256 hash")]
11    InvalidSha256Hash,
12    #[msg("User at some point had a bad csam scan")]
13    HasHadBadCsam,
14    #[msg("Storage account is marked as immutable")]
15    StorageAccountMarkedImmutable,
16    #[msg("User has not waited enough time to claim stake")]
17    ClaimingStakeTooSoon,
18    #[msg("The storage account needs to be marked as mutable to update last fee collection epoch")]
19    SolanaStorageAccountNotMutable,
20    #[msg("Attempting to decrease storage by more than is available")]
21    RemovingTooMuchStorage,
22    #[msg("u128 -> u64 cast failed")]
23    UnsignedIntegerCastFailed,
24    #[msg("This storage account still has some file accounts associated with it that have not been deleted")]
25    NonzeroRemainingFileAccounts,
26    #[msg("This account is still within deletion grace period")]
27    AccountStillInGracePeriod,
28    #[msg("This account is not marked to be deleted")]
29    AccountNotMarkedToBeDeleted,
30    #[msg("This file is still within deletion grace period")]
31    FileStillInGracePeriod,
32    #[msg("This file is not marked to be deleted")]
33    FileNotMarkedToBeDeleted,
34    #[msg("File has been marked as immutable and cannot be edited")]
35    FileMarkedImmutable,
36    #[msg("User requested an increase of zero bytes")]
37    NoStorageIncrease,
38    #[msg("Requested a storage account with storage over the limit")]
39    ExceededStorageLimit,
40    #[msg("User does not have enough funds to store requested number of bytes.")]
41    InsufficientFunds,
42    #[msg("There is not available storage on Shadow Drive. Good job!")]
43    NotEnoughStorageOnShadowDrive,
44    #[msg("Requested a storage account with storage under the limit")]
45    AccountTooSmall,
46    #[msg("User did not agree to terms of service")]
47    DidNotAgreeToToS,
48    #[msg("Invalid token transfers. Stake account nonempty.")]
49    InvalidTokenTransferAmounts,
50    #[msg("Failed to close spl token account")]
51    FailedToCloseAccount,
52    #[msg("Failed to transfer to emissions wallet")]
53    FailedToTransferToEmissionsWallet,
54    #[msg("Failed to transfer to emissions wallet from user")]
55    FailedToTransferToEmissionsWalletFromUser,
56    #[msg("Failed to return user funds")]
57    FailedToReturnUserFunds,
58    #[msg("Turning on fees and passing in None for storage cost per epoch")]
59    NeedSomeFees,
60    #[msg("Turning on fees and passing in None for crank bps")]
61    NeedSomeCrankBps,
62    #[msg("This account is already marked to be deleted")]
63    AlreadyMarkedForDeletion,
64    #[msg("User has an empty stake account and must refresh stake account before unmarking account for deletion")]
65    EmptyStakeAccount,
66    #[msg("New identifier exceeds maximum length of 64 bytes")]
67    IdentifierExceededMaxLength,
68    #[msg("Only admin1 can change admins")]
69    OnlyAdmin1CanChangeAdmins,
70    #[msg{("As part of on-chain storage optimizations, only one owner is allowed in Shadow Drive v1.5")}]
71    OnlyOneOwnerAllowedInV1_5,
72}