1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use cosmwasm_std::{StdError, Timestamp};
use cw_utils::PaymentError;
use thiserror::Error;

use base_factory::ContractError as BaseContractError;
use sg1::FeeError;

#[derive(Error, Debug, PartialEq)]
pub enum ContractError {
    #[error("{0}")]
    Std(#[from] StdError),

    #[error("{0}")]
    Fee(#[from] FeeError),

    #[error("{0}")]
    Payment(#[from] PaymentError),

    #[error("InvalidStartTime {0} < {1}")]
    InvalidStartTime(Timestamp, Timestamp),

    #[error("InvalidEndTime {0} > {1}")]
    InvalidEndTime(Timestamp, Timestamp),

    #[error("Unauthorized")]
    Unauthorized {},

    #[error("LimitOfTimeOrNumTokensRequired")]
    LimitOfTimeOrNumTokensRequired {},

    #[error("InvalidMintPrice")]
    InvalidMintPrice {},

    #[error("Open Edition collections should have a non-zero mint price")]
    NoTokenLimitWithZeroMintPrice {},

    #[error("Open Edition collections should have a non-zero airdrop price")]
    NoTokenLimitWithZeroAirdropPrice {},

    #[error("InvalidNftDataProvided")]
    InvalidNftDataProvided {},

    #[error("InvalidMintStartTime")]
    InvalidMintStartTime {},

    #[error("InvalidMintEndTime")]
    InvalidMintEndTime {},

    #[error("NftDataAlreadyLoaded")]
    NftDataAlreadyLoaded {},

    #[error("InvalidNumTokens {max}, min: 1")]
    InvalidNumTokens { max: u32, min: u32 },

    #[error("Invalid minting limit per address. max: {max}, min: 1, got: {got}")]
    InvalidPerAddressLimit { max: u32, min: u32, got: u32 },

    #[error("Minimum network mint price {expected} got {got}")]
    InsufficientMintPrice { expected: u128, got: u128 },

    #[error("{0}")]
    BaseError(#[from] BaseContractError),
}