use cosmwasm_std::StdError;
use thiserror::Error;
#[derive(Error, Debug, PartialEq)]
pub enum ContractError {
#[error("{0}")]
Std(#[from] StdError),
#[error("Unauthorized")]
Unauthorized {},
#[error("Contract is paused")]
Paused {},
#[error("Caller is not authorized: {addr}")]
NotAuthorizedCaller { addr: String },
#[error("Total supply cap exceeded")]
SupplyCapExceeded {},
#[error("Invalid transfer amount")]
InvalidTransferAmount {},
#[error("Invalid amount")]
InvalidAmount {},
#[error("Insufficient funds")]
InsufficientFunds {},
#[error("Migration error")]
MigrationError {},
#[error("{0}")]
Cw20Base(String),
}
impl From<cw20_base::ContractError> for ContractError {
fn from(err: cw20_base::ContractError) -> Self {
match err {
cw20_base::ContractError::Std(e) => ContractError::Std(e),
cw20_base::ContractError::Unauthorized {} => ContractError::Unauthorized {},
other => ContractError::Cw20Base(other.to_string()),
}
}
}
cw-cyber/contracts/litium-core/src/error.rs
ฯ 0.0%
use StdError;
use Error;