open_edition_factory/
error.rs

1use cosmwasm_std::{StdError, Timestamp};
2use cw_utils::PaymentError;
3use thiserror::Error;
4
5use base_factory::ContractError as BaseContractError;
6use sg1::FeeError;
7
8#[derive(Error, Debug, PartialEq)]
9pub enum ContractError {
10    #[error("{0}")]
11    Std(#[from] StdError),
12
13    #[error("{0}")]
14    Fee(#[from] FeeError),
15
16    #[error("{0}")]
17    Payment(#[from] PaymentError),
18
19    #[error("InvalidStartTime {0} < {1}")]
20    InvalidStartTime(Timestamp, Timestamp),
21
22    #[error("InvalidEndTime {0} > {1}")]
23    InvalidEndTime(Timestamp, Timestamp),
24
25    #[error("Unauthorized")]
26    Unauthorized {},
27
28    #[error("LimitOfTimeOrNumTokensRequired")]
29    LimitOfTimeOrNumTokensRequired {},
30
31    #[error("InvalidMintPrice")]
32    InvalidMintPrice {},
33
34    #[error("Open Edition collections should have a non-zero mint price")]
35    NoTokenLimitWithZeroMintPrice {},
36
37    #[error("Open Edition collections should have a non-zero airdrop price")]
38    NoTokenLimitWithZeroAirdropPrice {},
39
40    #[error("InvalidNftDataProvided")]
41    InvalidNftDataProvided {},
42
43    #[error("InvalidMintStartTime")]
44    InvalidMintStartTime {},
45
46    #[error("InvalidMintEndTime")]
47    InvalidMintEndTime {},
48
49    #[error("NftDataAlreadyLoaded")]
50    NftDataAlreadyLoaded {},
51
52    #[error("InvalidNumTokens {max}, min: 1")]
53    InvalidNumTokens { max: u32, min: u32 },
54
55    #[error("Invalid minting limit per address. max: {max}, min: 1, got: {got}")]
56    InvalidPerAddressLimit { max: u32, min: u32, got: u32 },
57
58    #[error("Minimum network mint price {expected} got {got}")]
59    InsufficientMintPrice { expected: u128, got: u128 },
60
61    #[error("{0}")]
62    BaseError(#[from] BaseContractError),
63}