github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/dev/wasm/erc20/src/error.rs (about)

     1  use cosmwasm_std::StdError;
     2  use thiserror::Error;
     3  
     4  #[derive(Error, Debug)]
     5  pub enum ContractError {
     6      #[error("{0}")]
     7      Std(#[from] StdError),
     8  
     9      #[error("Name is not in the expected format (3-30 UTF-8 bytes)")]
    10      NameWrongFormat {},
    11  
    12      #[error("Ticker symbol is not in expected format [A-Z]{{3,6}}")]
    13      TickerWrongSymbolFormat {},
    14  
    15      #[error("Decimals must not exceed 18")]
    16      DecimalsExceeded {},
    17  
    18      #[error("Insufficient allowance (allowance {allowance}, required={required})")]
    19      InsufficientAllowance { allowance: u128, required: u128 },
    20  
    21      #[error("Insufficient funds (balance {balance}, required={required})")]
    22      InsufficientFunds { balance: u128, required: u128 },
    23  
    24      #[error("Corrupted data found (16 byte expected)")]
    25      CorruptedDataFound {},
    26  
    27      #[error("The Contract addr is not expect)")]
    28      ContractERC20Err {addr:String},
    29  }