openzeppelin_rs/contracts/
IBeacon.rs

1pub use i_beacon::*;
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_beacon {
13    #[rustfmt::skip]
14    const __ABI: &str = "[{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]}]";
15    ///The parsed JSON ABI of the contract.
16    pub static IBEACON_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 IBeacon<M>(::ethers_contract::Contract<M>);
19    impl<M> ::core::clone::Clone for IBeacon<M> {
20        fn clone(&self) -> Self {
21            Self(::core::clone::Clone::clone(&self.0))
22        }
23    }
24    impl<M> ::core::ops::Deref for IBeacon<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 IBeacon<M> {
31        fn deref_mut(&mut self) -> &mut Self::Target {
32            &mut self.0
33        }
34    }
35    impl<M> ::core::fmt::Debug for IBeacon<M> {
36        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37            f.debug_tuple(stringify!(IBeacon)).field(&self.address()).finish()
38        }
39    }
40    impl<M: ::ethers_providers::Middleware> IBeacon<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                    IBEACON_ABI.clone(),
51                    client,
52                ),
53            )
54        }
55        ///Calls the contract's `implementation` (0x5c60da1b) function
56        pub fn implementation(
57            &self,
58        ) -> ::ethers_contract::builders::ContractCall<
59            M,
60            ::ethers_core::types::Address,
61        > {
62            self.0
63                .method_hash([92, 96, 218, 27], ())
64                .expect("method not found (this should never happen)")
65        }
66    }
67    impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
68    for IBeacon<M> {
69        fn from(contract: ::ethers_contract::Contract<M>) -> Self {
70            Self::new(contract.address(), contract.client())
71        }
72    }
73    ///Container type for all input parameters for the `implementation` function with signature `implementation()` and selector `0x5c60da1b`
74    #[derive(
75        Clone,
76        ::ethers_contract::EthCall,
77        ::ethers_contract::EthDisplay,
78        Default,
79        Debug,
80        PartialEq,
81        Eq,
82        Hash
83    )]
84    #[ethcall(name = "implementation", abi = "implementation()")]
85    pub struct ImplementationCall;
86    ///Container type for all return fields from the `implementation` function with signature `implementation()` and selector `0x5c60da1b`
87    #[derive(
88        Clone,
89        ::ethers_contract::EthAbiType,
90        ::ethers_contract::EthAbiCodec,
91        Default,
92        Debug,
93        PartialEq,
94        Eq,
95        Hash
96    )]
97    pub struct ImplementationReturn(pub ::ethers_core::types::Address);
98}