openzeppelin_rs/contracts/
IERC1967.rs1pub use ierc1967::*;
2#[allow(
5 clippy::enum_variant_names,
6 clippy::too_many_arguments,
7 clippy::upper_case_acronyms,
8 clippy::type_complexity,
9 dead_code,
10 non_camel_case_types,
11)]
12pub mod ierc1967 {
13 #[rustfmt::skip]
14 const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\",\"components\":[],\"indexed\":false},{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"AdminChanged\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"BeaconUpgraded\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"Upgraded\",\"outputs\":[],\"anonymous\":false}]";
15 pub static IERC1967_ABI: ::ethers_contract::Lazy<::ethers_core::abi::Abi> = ::ethers_contract::Lazy::new(||
17 ::ethers_core::utils::__serde_json::from_str(__ABI).expect("ABI is always valid"));
18 pub struct IERC1967<M>(::ethers_contract::Contract<M>);
19 impl<M> ::core::clone::Clone for IERC1967<M> {
20 fn clone(&self) -> Self {
21 Self(::core::clone::Clone::clone(&self.0))
22 }
23 }
24 impl<M> ::core::ops::Deref for IERC1967<M> {
25 type Target = ::ethers_contract::Contract<M>;
26 fn deref(&self) -> &Self::Target {
27 &self.0
28 }
29 }
30 impl<M> ::core::ops::DerefMut for IERC1967<M> {
31 fn deref_mut(&mut self) -> &mut Self::Target {
32 &mut self.0
33 }
34 }
35 impl<M> ::core::fmt::Debug for IERC1967<M> {
36 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37 f.debug_tuple(stringify!(IERC1967)).field(&self.address()).finish()
38 }
39 }
40 impl<M: ::ethers_providers::Middleware> IERC1967<M> {
41 pub fn new<T: Into<::ethers_core::types::Address>>(
44 address: T,
45 client: ::std::sync::Arc<M>,
46 ) -> Self {
47 Self(
48 ::ethers_contract::Contract::new(
49 address.into(),
50 IERC1967_ABI.clone(),
51 client,
52 ),
53 )
54 }
55 pub fn admin_changed_filter(
57 &self,
58 ) -> ::ethers_contract::builders::Event<
59 ::std::sync::Arc<M>,
60 M,
61 AdminChangedFilter,
62 > {
63 self.0.event()
64 }
65 pub fn beacon_upgraded_filter(
67 &self,
68 ) -> ::ethers_contract::builders::Event<
69 ::std::sync::Arc<M>,
70 M,
71 BeaconUpgradedFilter,
72 > {
73 self.0.event()
74 }
75 pub fn upgraded_filter(
77 &self,
78 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, UpgradedFilter> {
79 self.0.event()
80 }
81 pub fn events(
83 &self,
84 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, IERC1967Events> {
85 self.0.event_with_filter(::core::default::Default::default())
86 }
87 }
88 impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
89 for IERC1967<M> {
90 fn from(contract: ::ethers_contract::Contract<M>) -> Self {
91 Self::new(contract.address(), contract.client())
92 }
93 }
94 #[derive(
95 Clone,
96 ::ethers_contract::EthEvent,
97 ::ethers_contract::EthDisplay,
98 Default,
99 Debug,
100 PartialEq,
101 Eq,
102 Hash
103 )]
104 #[ethevent(name = "AdminChanged", abi = "AdminChanged(address,address)")]
105 pub struct AdminChangedFilter {
106 pub previous_admin: ::ethers_core::types::Address,
107 pub new_admin: ::ethers_core::types::Address,
108 }
109 #[derive(
110 Clone,
111 ::ethers_contract::EthEvent,
112 ::ethers_contract::EthDisplay,
113 Default,
114 Debug,
115 PartialEq,
116 Eq,
117 Hash
118 )]
119 #[ethevent(name = "BeaconUpgraded", abi = "BeaconUpgraded(address)")]
120 pub struct BeaconUpgradedFilter {
121 #[ethevent(indexed)]
122 pub beacon: ::ethers_core::types::Address,
123 }
124 #[derive(
125 Clone,
126 ::ethers_contract::EthEvent,
127 ::ethers_contract::EthDisplay,
128 Default,
129 Debug,
130 PartialEq,
131 Eq,
132 Hash
133 )]
134 #[ethevent(name = "Upgraded", abi = "Upgraded(address)")]
135 pub struct UpgradedFilter {
136 #[ethevent(indexed)]
137 pub implementation: ::ethers_core::types::Address,
138 }
139 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
141 pub enum IERC1967Events {
142 AdminChangedFilter(AdminChangedFilter),
143 BeaconUpgradedFilter(BeaconUpgradedFilter),
144 UpgradedFilter(UpgradedFilter),
145 }
146 impl ::ethers_contract::EthLogDecode for IERC1967Events {
147 fn decode_log(
148 log: &::ethers_core::abi::RawLog,
149 ) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
150 if let Ok(decoded) = AdminChangedFilter::decode_log(log) {
151 return Ok(IERC1967Events::AdminChangedFilter(decoded));
152 }
153 if let Ok(decoded) = BeaconUpgradedFilter::decode_log(log) {
154 return Ok(IERC1967Events::BeaconUpgradedFilter(decoded));
155 }
156 if let Ok(decoded) = UpgradedFilter::decode_log(log) {
157 return Ok(IERC1967Events::UpgradedFilter(decoded));
158 }
159 Err(::ethers_core::abi::Error::InvalidData)
160 }
161 }
162 impl ::core::fmt::Display for IERC1967Events {
163 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
164 match self {
165 Self::AdminChangedFilter(element) => {
166 ::core::fmt::Display::fmt(element, f)
167 }
168 Self::BeaconUpgradedFilter(element) => {
169 ::core::fmt::Display::fmt(element, f)
170 }
171 Self::UpgradedFilter(element) => ::core::fmt::Display::fmt(element, f),
172 }
173 }
174 }
175 impl ::core::convert::From<AdminChangedFilter> for IERC1967Events {
176 fn from(value: AdminChangedFilter) -> Self {
177 Self::AdminChangedFilter(value)
178 }
179 }
180 impl ::core::convert::From<BeaconUpgradedFilter> for IERC1967Events {
181 fn from(value: BeaconUpgradedFilter) -> Self {
182 Self::BeaconUpgradedFilter(value)
183 }
184 }
185 impl ::core::convert::From<UpgradedFilter> for IERC1967Events {
186 fn from(value: UpgradedFilter) -> Self {
187 Self::UpgradedFilter(value)
188 }
189 }
190}