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
use cosmwasm_std::{StdError, Uint128};
use cw_denom::DenomError;
use cw_utils::PaymentError;
use thiserror::Error;
use wynd_utils::CurveError;

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

    #[error(transparent)]
    Curve(#[from] CurveError),

    #[error(transparent)]
    Denom(#[from] DenomError),

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

    #[error("vesting curve values be in [0, total]`. got [{min}, {max}]")]
    VestRange { min: Uint128, max: Uint128 },

    #[error("vesting contract vests ({expected}) tokens, funded with ({sent})")]
    WrongFundAmount { sent: Uint128, expected: Uint128 },

    #[error("total amount to vest must be non-zero")]
    ZeroVest,

    #[error("this vesting contract would complete instantly")]
    Instavest,

    #[error("cannot vest a constant amount, specify two or more points")]
    ConstantVest,

    #[error("payment is cancelled")]
    Cancelled,

    #[error("payment is not cancelled")]
    NotCancelled,

    #[error("vesting contract is not distributing funds")]
    NotFunded,

    #[error("vesting contract has already been funded")]
    Funded,

    #[error("only the vest receiver may perform this action")]
    NotReceiver,

    #[error("no delegation to validator {0}")]
    NoDelegation(String),

    #[error("can't set withdraw address to vesting contract")]
    SelfWithdraw,

    #[error("request must be <= claimable and > 0. !(0 < {request} <= {claimable})")]
    InvalidWithdrawal { request: Uint128, claimable: Uint128 },

    #[error("cant select CW20 denom for vesting")]
    Cw20DenomNotSupported,
}