odra_modules/cep18/
errors.rs

1use odra::prelude::OdraError;
2
3/// Error enum for the CEP-18 contract.
4#[odra::odra_error]
5pub enum Error {
6    /// CEP-18 contract called from within an invalid context.
7    InvalidContext = 60000,
8    /// Spender does not have enough balance.
9    InsufficientBalance = 60001,
10    /// Spender does not have enough allowance approved.
11    InsufficientAllowance = 60002,
12    /// Operation would cause an integer overflow.
13    Overflow = 60003,
14    /// A required package hash was not specified.
15    PackageHashMissing = 60004,
16    /// The package hash specified does not represent a package.
17    PackageHashNotPackage = 60005,
18    /// An invalid event mode was specified.
19    InvalidEventsMode = 60006,
20    /// The event mode required was not specified.
21    MissingEventsMode = 60007,
22    /// An unknown error occurred.
23    Phantom = 60008,
24    /// Failed to read the runtime arguments provided.
25    FailedToGetArgBytes = 60009,
26    /// The caller does not have sufficient security access.
27    InsufficientRights = 60010,
28    /// The list of Admin accounts provided is invalid.
29    InvalidAdminList = 60011,
30    /// The list of accounts that can mint tokens is invalid.
31    InvalidMinterList = 60012,
32    /// The list of accounts with no access rights is invalid.
33    InvalidNoneList = 60013,
34    /// The flag to enable the mint and burn mode is invalid.
35    InvalidEnableMBFlag = 60014,
36    /// This contract instance cannot be initialized again.
37    AlreadyInitialized = 60015,
38    ///  The mint and burn mode is disabled.
39    MintBurnDisabled = 60016,
40    /// The user cannot target themselves.
41    CannotTargetSelfUser = 60017,
42    /// The burn target is invalid.
43    InvalidBurnTarget = 60018,
44    /// The package hash for the upgrade is missing.
45    /// This error is not used by Odra implementation yet.
46    _MissingPackageHashForUpgrade = 60019,
47    /// The contract is in an invalid state. This error should never happen.
48    InvalidState = 60100
49}