2022-02-24 12:07:34 +00:00
|
|
|
use ethers_core::types::{Address, Chain};
|
2021-10-17 10:01:20 +00:00
|
|
|
use std::env::VarError;
|
|
|
|
|
|
|
|
#[derive(Debug, thiserror::Error)]
|
|
|
|
pub enum EtherscanError {
|
2021-10-24 18:41:50 +00:00
|
|
|
#[error("chain {0} not supported")]
|
|
|
|
ChainNotSupported(Chain),
|
2021-10-17 10:01:20 +00:00
|
|
|
#[error("contract execution call failed: {0}")]
|
|
|
|
ExecutionFailed(String),
|
2022-02-26 14:35:43 +00:00
|
|
|
#[error("balance failed")]
|
|
|
|
BalanceFailed,
|
2021-10-17 10:01:20 +00:00
|
|
|
#[error("tx receipt failed")]
|
|
|
|
TransactionReceiptFailed,
|
2021-11-27 07:54:20 +00:00
|
|
|
#[error("gas estimation failed")]
|
|
|
|
GasEstimationFailed,
|
2021-10-17 10:01:20 +00:00
|
|
|
#[error("bad status code {0}")]
|
|
|
|
BadStatusCode(String),
|
|
|
|
#[error(transparent)]
|
|
|
|
EnvVarNotFound(#[from] VarError),
|
|
|
|
#[error(transparent)]
|
|
|
|
Reqwest(#[from] reqwest::Error),
|
|
|
|
#[error(transparent)]
|
|
|
|
Serde(#[from] serde_json::Error),
|
2022-02-24 12:07:34 +00:00
|
|
|
#[error("Contract source code not verified: {0}")]
|
|
|
|
ContractCodeNotVerified(Address),
|
2022-03-06 15:21:19 +00:00
|
|
|
#[error(transparent)]
|
|
|
|
IO(#[from] std::io::Error),
|
2021-10-17 10:01:20 +00:00
|
|
|
}
|