openzeppelin_rs/contracts/
ITransparentUpgradeableProxy.rs

1pub use i_transparent_upgradeable_proxy::*;
2/// This module was auto-generated with ethers-rs Abigen.
3/// More information at: <https://github.com/gakonst/ethers-rs>
4#[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 i_transparent_upgradeable_proxy {
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},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"changeAdmin\",\"outputs\":[]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"upgradeTo\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"payable\",\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"outputs\":[]}]";
15    ///The parsed JSON ABI of the contract.
16    pub static ITRANSPARENTUPGRADEABLEPROXY_ABI: ::ethers_contract::Lazy<
17        ::ethers_core::abi::Abi,
18    > = ::ethers_contract::Lazy::new(|| {
19        ::ethers_core::utils::__serde_json::from_str(__ABI).expect("ABI is always valid")
20    });
21    pub struct ITransparentUpgradeableProxy<M>(::ethers_contract::Contract<M>);
22    impl<M> ::core::clone::Clone for ITransparentUpgradeableProxy<M> {
23        fn clone(&self) -> Self {
24            Self(::core::clone::Clone::clone(&self.0))
25        }
26    }
27    impl<M> ::core::ops::Deref for ITransparentUpgradeableProxy<M> {
28        type Target = ::ethers_contract::Contract<M>;
29        fn deref(&self) -> &Self::Target {
30            &self.0
31        }
32    }
33    impl<M> ::core::ops::DerefMut for ITransparentUpgradeableProxy<M> {
34        fn deref_mut(&mut self) -> &mut Self::Target {
35            &mut self.0
36        }
37    }
38    impl<M> ::core::fmt::Debug for ITransparentUpgradeableProxy<M> {
39        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
40            f.debug_tuple(stringify!(ITransparentUpgradeableProxy))
41                .field(&self.address())
42                .finish()
43        }
44    }
45    impl<M: ::ethers_providers::Middleware> ITransparentUpgradeableProxy<M> {
46        /// Creates a new contract instance with the specified `ethers` client at
47        /// `address`. The contract derefs to a `ethers::Contract` object.
48        pub fn new<T: Into<::ethers_core::types::Address>>(
49            address: T,
50            client: ::std::sync::Arc<M>,
51        ) -> Self {
52            Self(
53                ::ethers_contract::Contract::new(
54                    address.into(),
55                    ITRANSPARENTUPGRADEABLEPROXY_ABI.clone(),
56                    client,
57                ),
58            )
59        }
60        ///Calls the contract's `admin` (0xf851a440) function
61        pub fn admin(
62            &self,
63        ) -> ::ethers_contract::builders::ContractCall<
64            M,
65            ::ethers_core::types::Address,
66        > {
67            self.0
68                .method_hash([248, 81, 164, 64], ())
69                .expect("method not found (this should never happen)")
70        }
71        ///Calls the contract's `changeAdmin` (0x8f283970) function
72        pub fn change_admin(
73            &self,
74            p0: ::ethers_core::types::Address,
75        ) -> ::ethers_contract::builders::ContractCall<M, ()> {
76            self.0
77                .method_hash([143, 40, 57, 112], p0)
78                .expect("method not found (this should never happen)")
79        }
80        ///Calls the contract's `implementation` (0x5c60da1b) function
81        pub fn implementation(
82            &self,
83        ) -> ::ethers_contract::builders::ContractCall<
84            M,
85            ::ethers_core::types::Address,
86        > {
87            self.0
88                .method_hash([92, 96, 218, 27], ())
89                .expect("method not found (this should never happen)")
90        }
91        ///Calls the contract's `upgradeTo` (0x3659cfe6) function
92        pub fn upgrade_to(
93            &self,
94            p0: ::ethers_core::types::Address,
95        ) -> ::ethers_contract::builders::ContractCall<M, ()> {
96            self.0
97                .method_hash([54, 89, 207, 230], p0)
98                .expect("method not found (this should never happen)")
99        }
100        ///Calls the contract's `upgradeToAndCall` (0x4f1ef286) function
101        pub fn upgrade_to_and_call(
102            &self,
103            p0: ::ethers_core::types::Address,
104            p1: ::ethers_core::types::Bytes,
105        ) -> ::ethers_contract::builders::ContractCall<M, ()> {
106            self.0
107                .method_hash([79, 30, 242, 134], (p0, p1))
108                .expect("method not found (this should never happen)")
109        }
110        ///Gets the contract's `AdminChanged` event
111        pub fn admin_changed_filter(
112            &self,
113        ) -> ::ethers_contract::builders::Event<
114            ::std::sync::Arc<M>,
115            M,
116            AdminChangedFilter,
117        > {
118            self.0.event()
119        }
120        ///Gets the contract's `BeaconUpgraded` event
121        pub fn beacon_upgraded_filter(
122            &self,
123        ) -> ::ethers_contract::builders::Event<
124            ::std::sync::Arc<M>,
125            M,
126            BeaconUpgradedFilter,
127        > {
128            self.0.event()
129        }
130        ///Gets the contract's `Upgraded` event
131        pub fn upgraded_filter(
132            &self,
133        ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, UpgradedFilter> {
134            self.0.event()
135        }
136        /// Returns an `Event` builder for all the events of this contract.
137        pub fn events(
138            &self,
139        ) -> ::ethers_contract::builders::Event<
140            ::std::sync::Arc<M>,
141            M,
142            ITransparentUpgradeableProxyEvents,
143        > {
144            self.0.event_with_filter(::core::default::Default::default())
145        }
146    }
147    impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
148    for ITransparentUpgradeableProxy<M> {
149        fn from(contract: ::ethers_contract::Contract<M>) -> Self {
150            Self::new(contract.address(), contract.client())
151        }
152    }
153    #[derive(
154        Clone,
155        ::ethers_contract::EthEvent,
156        ::ethers_contract::EthDisplay,
157        Default,
158        Debug,
159        PartialEq,
160        Eq,
161        Hash
162    )]
163    #[ethevent(name = "AdminChanged", abi = "AdminChanged(address,address)")]
164    pub struct AdminChangedFilter {
165        pub previous_admin: ::ethers_core::types::Address,
166        pub new_admin: ::ethers_core::types::Address,
167    }
168    #[derive(
169        Clone,
170        ::ethers_contract::EthEvent,
171        ::ethers_contract::EthDisplay,
172        Default,
173        Debug,
174        PartialEq,
175        Eq,
176        Hash
177    )]
178    #[ethevent(name = "BeaconUpgraded", abi = "BeaconUpgraded(address)")]
179    pub struct BeaconUpgradedFilter {
180        #[ethevent(indexed)]
181        pub beacon: ::ethers_core::types::Address,
182    }
183    #[derive(
184        Clone,
185        ::ethers_contract::EthEvent,
186        ::ethers_contract::EthDisplay,
187        Default,
188        Debug,
189        PartialEq,
190        Eq,
191        Hash
192    )]
193    #[ethevent(name = "Upgraded", abi = "Upgraded(address)")]
194    pub struct UpgradedFilter {
195        #[ethevent(indexed)]
196        pub implementation: ::ethers_core::types::Address,
197    }
198    ///Container type for all of the contract's events
199    #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
200    pub enum ITransparentUpgradeableProxyEvents {
201        AdminChangedFilter(AdminChangedFilter),
202        BeaconUpgradedFilter(BeaconUpgradedFilter),
203        UpgradedFilter(UpgradedFilter),
204    }
205    impl ::ethers_contract::EthLogDecode for ITransparentUpgradeableProxyEvents {
206        fn decode_log(
207            log: &::ethers_core::abi::RawLog,
208        ) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
209            if let Ok(decoded) = AdminChangedFilter::decode_log(log) {
210                return Ok(
211                    ITransparentUpgradeableProxyEvents::AdminChangedFilter(decoded),
212                );
213            }
214            if let Ok(decoded) = BeaconUpgradedFilter::decode_log(log) {
215                return Ok(
216                    ITransparentUpgradeableProxyEvents::BeaconUpgradedFilter(decoded),
217                );
218            }
219            if let Ok(decoded) = UpgradedFilter::decode_log(log) {
220                return Ok(ITransparentUpgradeableProxyEvents::UpgradedFilter(decoded));
221            }
222            Err(::ethers_core::abi::Error::InvalidData)
223        }
224    }
225    impl ::core::fmt::Display for ITransparentUpgradeableProxyEvents {
226        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
227            match self {
228                Self::AdminChangedFilter(element) => {
229                    ::core::fmt::Display::fmt(element, f)
230                }
231                Self::BeaconUpgradedFilter(element) => {
232                    ::core::fmt::Display::fmt(element, f)
233                }
234                Self::UpgradedFilter(element) => ::core::fmt::Display::fmt(element, f),
235            }
236        }
237    }
238    impl ::core::convert::From<AdminChangedFilter>
239    for ITransparentUpgradeableProxyEvents {
240        fn from(value: AdminChangedFilter) -> Self {
241            Self::AdminChangedFilter(value)
242        }
243    }
244    impl ::core::convert::From<BeaconUpgradedFilter>
245    for ITransparentUpgradeableProxyEvents {
246        fn from(value: BeaconUpgradedFilter) -> Self {
247            Self::BeaconUpgradedFilter(value)
248        }
249    }
250    impl ::core::convert::From<UpgradedFilter> for ITransparentUpgradeableProxyEvents {
251        fn from(value: UpgradedFilter) -> Self {
252            Self::UpgradedFilter(value)
253        }
254    }
255    ///Container type for all input parameters for the `admin` function with signature `admin()` and selector `0xf851a440`
256    #[derive(
257        Clone,
258        ::ethers_contract::EthCall,
259        ::ethers_contract::EthDisplay,
260        Default,
261        Debug,
262        PartialEq,
263        Eq,
264        Hash
265    )]
266    #[ethcall(name = "admin", abi = "admin()")]
267    pub struct AdminCall;
268    ///Container type for all input parameters for the `changeAdmin` function with signature `changeAdmin(address)` and selector `0x8f283970`
269    #[derive(
270        Clone,
271        ::ethers_contract::EthCall,
272        ::ethers_contract::EthDisplay,
273        Default,
274        Debug,
275        PartialEq,
276        Eq,
277        Hash
278    )]
279    #[ethcall(name = "changeAdmin", abi = "changeAdmin(address)")]
280    pub struct ChangeAdminCall(pub ::ethers_core::types::Address);
281    ///Container type for all input parameters for the `implementation` function with signature `implementation()` and selector `0x5c60da1b`
282    #[derive(
283        Clone,
284        ::ethers_contract::EthCall,
285        ::ethers_contract::EthDisplay,
286        Default,
287        Debug,
288        PartialEq,
289        Eq,
290        Hash
291    )]
292    #[ethcall(name = "implementation", abi = "implementation()")]
293    pub struct ImplementationCall;
294    ///Container type for all input parameters for the `upgradeTo` function with signature `upgradeTo(address)` and selector `0x3659cfe6`
295    #[derive(
296        Clone,
297        ::ethers_contract::EthCall,
298        ::ethers_contract::EthDisplay,
299        Default,
300        Debug,
301        PartialEq,
302        Eq,
303        Hash
304    )]
305    #[ethcall(name = "upgradeTo", abi = "upgradeTo(address)")]
306    pub struct UpgradeToCall(pub ::ethers_core::types::Address);
307    ///Container type for all input parameters for the `upgradeToAndCall` function with signature `upgradeToAndCall(address,bytes)` and selector `0x4f1ef286`
308    #[derive(
309        Clone,
310        ::ethers_contract::EthCall,
311        ::ethers_contract::EthDisplay,
312        Default,
313        Debug,
314        PartialEq,
315        Eq,
316        Hash
317    )]
318    #[ethcall(name = "upgradeToAndCall", abi = "upgradeToAndCall(address,bytes)")]
319    pub struct UpgradeToAndCallCall(
320        pub ::ethers_core::types::Address,
321        pub ::ethers_core::types::Bytes,
322    );
323    ///Container type for all of the contract's call
324    #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
325    pub enum ITransparentUpgradeableProxyCalls {
326        Admin(AdminCall),
327        ChangeAdmin(ChangeAdminCall),
328        Implementation(ImplementationCall),
329        UpgradeTo(UpgradeToCall),
330        UpgradeToAndCall(UpgradeToAndCallCall),
331    }
332    impl ::ethers_core::abi::AbiDecode for ITransparentUpgradeableProxyCalls {
333        fn decode(
334            data: impl AsRef<[u8]>,
335        ) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
336            let data = data.as_ref();
337            if let Ok(decoded)
338                = <AdminCall as ::ethers_core::abi::AbiDecode>::decode(data) {
339                return Ok(Self::Admin(decoded));
340            }
341            if let Ok(decoded)
342                = <ChangeAdminCall as ::ethers_core::abi::AbiDecode>::decode(data) {
343                return Ok(Self::ChangeAdmin(decoded));
344            }
345            if let Ok(decoded)
346                = <ImplementationCall as ::ethers_core::abi::AbiDecode>::decode(data) {
347                return Ok(Self::Implementation(decoded));
348            }
349            if let Ok(decoded)
350                = <UpgradeToCall as ::ethers_core::abi::AbiDecode>::decode(data) {
351                return Ok(Self::UpgradeTo(decoded));
352            }
353            if let Ok(decoded)
354                = <UpgradeToAndCallCall as ::ethers_core::abi::AbiDecode>::decode(data) {
355                return Ok(Self::UpgradeToAndCall(decoded));
356            }
357            Err(::ethers_core::abi::Error::InvalidData.into())
358        }
359    }
360    impl ::ethers_core::abi::AbiEncode for ITransparentUpgradeableProxyCalls {
361        fn encode(self) -> Vec<u8> {
362            match self {
363                Self::Admin(element) => ::ethers_core::abi::AbiEncode::encode(element),
364                Self::ChangeAdmin(element) => {
365                    ::ethers_core::abi::AbiEncode::encode(element)
366                }
367                Self::Implementation(element) => {
368                    ::ethers_core::abi::AbiEncode::encode(element)
369                }
370                Self::UpgradeTo(element) => {
371                    ::ethers_core::abi::AbiEncode::encode(element)
372                }
373                Self::UpgradeToAndCall(element) => {
374                    ::ethers_core::abi::AbiEncode::encode(element)
375                }
376            }
377        }
378    }
379    impl ::core::fmt::Display for ITransparentUpgradeableProxyCalls {
380        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
381            match self {
382                Self::Admin(element) => ::core::fmt::Display::fmt(element, f),
383                Self::ChangeAdmin(element) => ::core::fmt::Display::fmt(element, f),
384                Self::Implementation(element) => ::core::fmt::Display::fmt(element, f),
385                Self::UpgradeTo(element) => ::core::fmt::Display::fmt(element, f),
386                Self::UpgradeToAndCall(element) => ::core::fmt::Display::fmt(element, f),
387            }
388        }
389    }
390    impl ::core::convert::From<AdminCall> for ITransparentUpgradeableProxyCalls {
391        fn from(value: AdminCall) -> Self {
392            Self::Admin(value)
393        }
394    }
395    impl ::core::convert::From<ChangeAdminCall> for ITransparentUpgradeableProxyCalls {
396        fn from(value: ChangeAdminCall) -> Self {
397            Self::ChangeAdmin(value)
398        }
399    }
400    impl ::core::convert::From<ImplementationCall>
401    for ITransparentUpgradeableProxyCalls {
402        fn from(value: ImplementationCall) -> Self {
403            Self::Implementation(value)
404        }
405    }
406    impl ::core::convert::From<UpgradeToCall> for ITransparentUpgradeableProxyCalls {
407        fn from(value: UpgradeToCall) -> Self {
408            Self::UpgradeTo(value)
409        }
410    }
411    impl ::core::convert::From<UpgradeToAndCallCall>
412    for ITransparentUpgradeableProxyCalls {
413        fn from(value: UpgradeToAndCallCall) -> Self {
414            Self::UpgradeToAndCall(value)
415        }
416    }
417    ///Container type for all return fields from the `admin` function with signature `admin()` and selector `0xf851a440`
418    #[derive(
419        Clone,
420        ::ethers_contract::EthAbiType,
421        ::ethers_contract::EthAbiCodec,
422        Default,
423        Debug,
424        PartialEq,
425        Eq,
426        Hash
427    )]
428    pub struct AdminReturn(pub ::ethers_core::types::Address);
429    ///Container type for all return fields from the `implementation` function with signature `implementation()` and selector `0x5c60da1b`
430    #[derive(
431        Clone,
432        ::ethers_contract::EthAbiType,
433        ::ethers_contract::EthAbiCodec,
434        Default,
435        Debug,
436        PartialEq,
437        Eq,
438        Hash
439    )]
440    pub struct ImplementationReturn(pub ::ethers_core::types::Address);
441}