openzeppelin_rs/contracts/
Initializable.rs

1pub use initializable::*;
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 initializable {
13    #[rustfmt::skip]
14    const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"Initialized\",\"outputs\":[],\"anonymous\":false}]";
15    ///The parsed JSON ABI of the contract.
16    pub static INITIALIZABLE_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 Initializable<M>(::ethers_contract::Contract<M>);
19    impl<M> ::core::clone::Clone for Initializable<M> {
20        fn clone(&self) -> Self {
21            Self(::core::clone::Clone::clone(&self.0))
22        }
23    }
24    impl<M> ::core::ops::Deref for Initializable<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 Initializable<M> {
31        fn deref_mut(&mut self) -> &mut Self::Target {
32            &mut self.0
33        }
34    }
35    impl<M> ::core::fmt::Debug for Initializable<M> {
36        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37            f.debug_tuple(stringify!(Initializable)).field(&self.address()).finish()
38        }
39    }
40    impl<M: ::ethers_providers::Middleware> Initializable<M> {
41        /// Creates a new contract instance with the specified `ethers` client at
42        /// `address`. The contract derefs to a `ethers::Contract` object.
43        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                    INITIALIZABLE_ABI.clone(),
51                    client,
52                ),
53            )
54        }
55        ///Gets the contract's `Initialized` event
56        pub fn initialized_filter(
57            &self,
58        ) -> ::ethers_contract::builders::Event<
59            ::std::sync::Arc<M>,
60            M,
61            InitializedFilter,
62        > {
63            self.0.event()
64        }
65        /// Returns an `Event` builder for all the events of this contract.
66        pub fn events(
67            &self,
68        ) -> ::ethers_contract::builders::Event<
69            ::std::sync::Arc<M>,
70            M,
71            InitializedFilter,
72        > {
73            self.0.event_with_filter(::core::default::Default::default())
74        }
75    }
76    impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
77    for Initializable<M> {
78        fn from(contract: ::ethers_contract::Contract<M>) -> Self {
79            Self::new(contract.address(), contract.client())
80        }
81    }
82    #[derive(
83        Clone,
84        ::ethers_contract::EthEvent,
85        ::ethers_contract::EthDisplay,
86        Default,
87        Debug,
88        PartialEq,
89        Eq,
90        Hash
91    )]
92    #[ethevent(name = "Initialized", abi = "Initialized(uint8)")]
93    pub struct InitializedFilter {
94        pub version: u8,
95    }
96}