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
use serde_json::Error as JsonError;
use std::io::Error as IoError;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum ArtifactError {
#[error("failed to open contract artifact file: {0}")]
Io(#[from] IoError),
#[error("failed to parse contract artifact JSON: {0}")]
Json(#[from] JsonError),
}
#[derive(Debug, Error)]
pub enum BytecodeError {
#[error("missing 0x hex prefix at start of bytecode")]
MissingHexPrefix,
#[error("invalid bytecode length")]
InvalidLength,
#[error("placeholder at end of bytecode is too short")]
PlaceholderTooShort,
#[error("invalid hex digit '{0}'")]
InvalidHexDigit(char),
}
#[derive(Debug, Error)]
pub enum LinkError {
#[error("unable to link library: can't find link placeholder for {0}")]
NotFound(String),
#[error("undefined library {0}")]
UndefinedLibrary(String),
}
#[derive(Clone, Debug, Error)]
#[error("'{0}' is not a valid Solidity type")]
pub struct ParseParamTypeError(pub String);