openzeppelin_rs/contracts/
IERC1820Implementer.rs

1pub use ierc1820_implementer::*;
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 ierc1820_implementer {
13    #[rustfmt::skip]
14    const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"interfaceHash\",\"type\":\"bytes32\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"canImplementInterfaceForAddress\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\",\"components\":[]}]}]";
15    ///The parsed JSON ABI of the contract.
16    pub static IERC1820IMPLEMENTER_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 IERC1820Implementer<M>(::ethers_contract::Contract<M>);
22    impl<M> ::core::clone::Clone for IERC1820Implementer<M> {
23        fn clone(&self) -> Self {
24            Self(::core::clone::Clone::clone(&self.0))
25        }
26    }
27    impl<M> ::core::ops::Deref for IERC1820Implementer<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 IERC1820Implementer<M> {
34        fn deref_mut(&mut self) -> &mut Self::Target {
35            &mut self.0
36        }
37    }
38    impl<M> ::core::fmt::Debug for IERC1820Implementer<M> {
39        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
40            f.debug_tuple(stringify!(IERC1820Implementer))
41                .field(&self.address())
42                .finish()
43        }
44    }
45    impl<M: ::ethers_providers::Middleware> IERC1820Implementer<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                    IERC1820IMPLEMENTER_ABI.clone(),
56                    client,
57                ),
58            )
59        }
60        ///Calls the contract's `canImplementInterfaceForAddress` (0x249cb3fa) function
61        pub fn can_implement_interface_for_address(
62            &self,
63            interface_hash: [u8; 32],
64            account: ::ethers_core::types::Address,
65        ) -> ::ethers_contract::builders::ContractCall<M, [u8; 32]> {
66            self.0
67                .method_hash([36, 156, 179, 250], (interface_hash, account))
68                .expect("method not found (this should never happen)")
69        }
70    }
71    impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
72    for IERC1820Implementer<M> {
73        fn from(contract: ::ethers_contract::Contract<M>) -> Self {
74            Self::new(contract.address(), contract.client())
75        }
76    }
77    ///Container type for all input parameters for the `canImplementInterfaceForAddress` function with signature `canImplementInterfaceForAddress(bytes32,address)` and selector `0x249cb3fa`
78    #[derive(
79        Clone,
80        ::ethers_contract::EthCall,
81        ::ethers_contract::EthDisplay,
82        Default,
83        Debug,
84        PartialEq,
85        Eq,
86        Hash
87    )]
88    #[ethcall(
89        name = "canImplementInterfaceForAddress",
90        abi = "canImplementInterfaceForAddress(bytes32,address)"
91    )]
92    pub struct CanImplementInterfaceForAddressCall {
93        pub interface_hash: [u8; 32],
94        pub account: ::ethers_core::types::Address,
95    }
96    ///Container type for all return fields from the `canImplementInterfaceForAddress` function with signature `canImplementInterfaceForAddress(bytes32,address)` and selector `0x249cb3fa`
97    #[derive(
98        Clone,
99        ::ethers_contract::EthAbiType,
100        ::ethers_contract::EthAbiCodec,
101        Default,
102        Debug,
103        PartialEq,
104        Eq,
105        Hash
106    )]
107    pub struct CanImplementInterfaceForAddressReturn(pub [u8; 32]);
108}