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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::module_inception)]
#![warn(missing_docs)]
#[cfg_attr(not(feature = "std"), macro_use)]
extern crate alloc;
#[cfg(not(feature = "std"))]
mod no_std_prelude {
pub use alloc::{
borrow::{Cow, ToOwned},
boxed::Box,
string::{self, String, ToString},
vec::Vec,
};
}
#[cfg(feature = "std")]
mod no_std_prelude {
pub use std::borrow::Cow;
}
#[cfg(not(feature = "std"))]
use no_std_prelude::*;
mod constructor;
mod contract;
mod decoder;
mod encoder;
mod error;
mod errors;
mod event;
mod event_param;
mod filter;
mod function;
mod log;
#[cfg(feature = "serde")]
pub mod operation;
mod param;
pub mod param_type;
mod signature;
mod state_mutability;
pub mod token;
#[cfg(feature = "serde")]
mod tuple_param;
mod util;
#[cfg(test)]
mod tests;
pub use ethereum_types;
#[cfg(feature = "serde")]
pub use crate::tuple_param::TupleParam;
pub use crate::{
constructor::Constructor,
contract::{Contract, Events, Functions},
decoder::{decode, decode_validate},
encoder::encode,
error::Error as AbiError,
errors::{Error, Result},
event::Event,
event_param::EventParam,
filter::{RawTopicFilter, Topic, TopicFilter},
function::Function,
log::{Log, LogFilter, LogParam, ParseLog, RawLog},
param::Param,
param_type::ParamType,
signature::{long_signature, short_signature},
state_mutability::StateMutability,
token::Token,
};
pub type Word = [u8; 32];
pub type Address = ethereum_types::Address;
pub type FixedBytes = Vec<u8>;
pub type Bytes = Vec<u8>;
pub type Int = ethereum_types::U256;
pub type Uint = ethereum_types::U256;
pub type Hash = ethereum_types::H256;
pub trait FunctionOutputDecoder {
type Output;
fn decode(&self, _: &[u8]) -> Result<Self::Output>;
}