niftygate_bindings/openzeppelin/contracts_upgradeable/generated/
erc1820_implementer_upgradeable.rs1#[allow(dead_code)]
2pub mod erc1820_implementer_upgradeable {
3 # [rustfmt :: skip] use ethcontract as ethcontract ;
4 #[doc = "Generated by `ethcontract`"]
5 #[derive(Clone)]
6 pub struct Contract {
7 methods: Methods,
8 }
9 impl Contract {
10 #[doc = r" Retrieves the raw contract instance used to generate the type safe"]
11 #[doc = r" API for this contract."]
12 pub fn raw_contract() -> &'static self::ethcontract::Contract {
13 use self::ethcontract::common::artifact::truffle::TruffleLoader;
14 use self::ethcontract::private::lazy_static;
15 use self::ethcontract::Contract;
16 lazy_static! {
17 pub static ref CONTRACT: Contract = {
18 # [allow (unused_mut)] let mut contract = TruffleLoader :: new () . load_contract_from_str ("{\"contractName\":\"ERC1820ImplementerUpgradeable\",\"abi\":[{\"type\":\"function\",\"name\":\"canImplementInterfaceForAddress\",\"inputs\":[{\"name\":\"interfaceHash\",\"type\":\"bytes32\"},{\"name\":\"account\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"constant\":false,\"stateMutability\":\"view\"}],\"bytecode\":\"608060405234801561001057600080fd5b50610114806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063249cb3fa14602d575b600080fd5b603c603836600460a6565b604e565b60405190815260200160405180910390f35b60008281526001602090815260408083206001600160a01b038516845290915281205460ff16607d576000609f565b7fa2ef4600d742022d532d4747cb3547474667d6f13804902513b2ec01c848f4b45b9392505050565b6000806040838503121560b7578182fd5b8235915060208301356001600160a01b038116811460d3578182fd5b80915050925092905056fea264697066735822122073be994e65681e2a2bd23a4d47ad0da12250c2e8d051216bc4cbc492957b296464736f6c63430008030033\",\"networks\":{},\"devdoc\":{\"details\":null,\"methods\":{}},\"userdoc\":{\"details\":null,\"methods\":{}}}") . expect ("valid contract JSON") ;
19 contract
20 };
21 }
22 &CONTRACT
23 }
24 #[doc = r" Creates a new contract instance with the specified `web3`"]
25 #[doc = r" provider at the given `Address`."]
26 #[doc = r""]
27 #[doc = r" Note that this does not verify that a contract with a matching"]
28 #[doc = r" `Abi` is actually deployed at the given address."]
29 pub fn at<F, B, T>(
30 web3: &self::ethcontract::web3::api::Web3<T>,
31 address: self::ethcontract::Address,
32 ) -> Self
33 where
34 F: std::future::Future<
35 Output = Result<self::ethcontract::json::Value, self::ethcontract::web3::Error>,
36 > + Send
37 + 'static,
38 B: std::future::Future<
39 Output = Result<
40 Vec<Result<self::ethcontract::json::Value, self::ethcontract::web3::Error>>,
41 self::ethcontract::web3::Error,
42 >,
43 > + Send
44 + 'static,
45 T: self::ethcontract::web3::Transport<Out = F>
46 + self::ethcontract::web3::BatchTransport<Batch = B>
47 + Send
48 + Sync
49 + 'static,
50 {
51 Contract::with_deployment_info(web3, address, None)
52 }
53 #[doc = r" Creates a new contract instance with the specified `web3` provider with"]
54 #[doc = r" the given `Abi` at the given `Address` and an optional transaction hash."]
55 #[doc = r" This hash is used to retrieve contract related information such as the"]
56 #[doc = r" creation block (which is useful for fetching all historic events)."]
57 #[doc = r""]
58 #[doc = r" Note that this does not verify that a contract with a matching `Abi` is"]
59 #[doc = r" actually deployed at the given address nor that the transaction hash,"]
60 #[doc = r" when provided, is actually for this contract deployment."]
61 pub fn with_deployment_info<F, B, T>(
62 web3: &self::ethcontract::web3::api::Web3<T>,
63 address: self::ethcontract::Address,
64 deployment_information: Option<ethcontract::common::DeploymentInformation>,
65 ) -> Self
66 where
67 F: std::future::Future<
68 Output = Result<self::ethcontract::json::Value, self::ethcontract::web3::Error>,
69 > + Send
70 + 'static,
71 B: std::future::Future<
72 Output = Result<
73 Vec<Result<self::ethcontract::json::Value, self::ethcontract::web3::Error>>,
74 self::ethcontract::web3::Error,
75 >,
76 > + Send
77 + 'static,
78 T: self::ethcontract::web3::Transport<Out = F>
79 + self::ethcontract::web3::BatchTransport<Batch = B>
80 + Send
81 + Sync
82 + 'static,
83 {
84 use self::ethcontract::transport::DynTransport;
85 use self::ethcontract::web3::api::Web3;
86 use self::ethcontract::Instance;
87 let transport = DynTransport::new(web3.transport().clone());
88 let web3 = Web3::new(transport);
89 let abi = Self::raw_contract().abi.clone();
90 let instance = Instance::with_deployment_info(web3, abi, address, deployment_information);
91 Contract::from_raw(instance)
92 }
93 #[doc = r" Creates a contract from a raw instance."]
94 fn from_raw(instance: self::ethcontract::dyns::DynInstance) -> Self {
95 let methods = Methods { instance };
96 Contract { methods }
97 }
98 #[doc = r" Returns the contract address being used by this instance."]
99 pub fn address(&self) -> self::ethcontract::Address {
100 self.raw_instance().address()
101 }
102 #[doc = r" Returns the deployment information of the contract"]
103 #[doc = r" if it is known, `None` otherwise."]
104 pub fn deployment_information(&self) -> Option<ethcontract::common::DeploymentInformation> {
105 self.raw_instance().deployment_information()
106 }
107 #[doc = r" Returns a reference to the default method options used by this"]
108 #[doc = r" contract."]
109 pub fn defaults(&self) -> &self::ethcontract::contract::MethodDefaults {
110 &self.raw_instance().defaults
111 }
112 #[doc = r" Returns a mutable reference to the default method options used"]
113 #[doc = r" by this contract."]
114 pub fn defaults_mut(&mut self) -> &mut self::ethcontract::contract::MethodDefaults {
115 &mut self.raw_instance_mut().defaults
116 }
117 #[doc = r" Returns a reference to the raw runtime instance used by this"]
118 #[doc = r" contract."]
119 pub fn raw_instance(&self) -> &self::ethcontract::dyns::DynInstance {
120 &self.methods.instance
121 }
122 #[doc = r" Returns a mutable reference to the raw runtime instance used by"]
123 #[doc = r" this contract."]
124 fn raw_instance_mut(&mut self) -> &mut self::ethcontract::dyns::DynInstance {
125 &mut self.methods.instance
126 }
127 }
128 impl std::fmt::Debug for Contract {
129 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
130 f.debug_tuple(stringify!(ERC1820ImplementerUpgradeable))
131 .field(&self.address())
132 .finish()
133 }
134 }
135 impl Contract {
136 #[doc = "Generated by `ethcontract`"]
137 #[allow(clippy::too_many_arguments)]
138 pub fn builder<F, B, T>(
139 web3: &self::ethcontract::web3::api::Web3<T>,
140 ) -> self::ethcontract::dyns::DynDeployBuilder<Self>
141 where
142 F: std::future::Future<
143 Output = Result<self::ethcontract::json::Value, self::ethcontract::web3::Error>,
144 > + Send
145 + 'static,
146 B: std::future::Future<
147 Output = Result<
148 Vec<Result<self::ethcontract::json::Value, self::ethcontract::web3::Error>>,
149 self::ethcontract::web3::Error,
150 >,
151 > + Send
152 + 'static,
153 T: self::ethcontract::web3::Transport<Out = F>
154 + self::ethcontract::web3::BatchTransport<Batch = B>
155 + Send
156 + Sync
157 + 'static,
158 {
159 use self::ethcontract::contract::DeployBuilder;
160 use self::ethcontract::dyns::DynTransport;
161 use self::ethcontract::web3::api::Web3;
162 let transport = DynTransport::new(web3.transport().clone());
163 let web3 = Web3::new(transport);
164 let bytecode = Self::raw_contract().bytecode.clone();
165 DeployBuilder::new(web3, bytecode, ()).expect("valid deployment args")
166 }
167 }
168 impl self::ethcontract::contract::Deploy<self::ethcontract::dyns::DynTransport> for Contract {
169 type Context = self::ethcontract::common::Bytecode;
170 fn bytecode(cx: &Self::Context) -> &self::ethcontract::common::Bytecode {
171 cx
172 }
173 fn abi(_: &Self::Context) -> &self::ethcontract::common::Abi {
174 &Self::raw_contract().abi
175 }
176 fn from_deployment(
177 web3: self::ethcontract::dyns::DynWeb3,
178 address: self::ethcontract::Address,
179 transaction_hash: self::ethcontract::H256,
180 _: Self::Context,
181 ) -> Self {
182 Self::with_deployment_info(&web3, address, Some(transaction_hash.into()))
183 }
184 }
185 impl Contract {
186 #[doc = r" Returns an object that allows accessing typed method signatures."]
187 pub fn signatures() -> Signatures {
188 Signatures
189 }
190 #[doc = r" Retrieves a reference to type containing all the generated"]
191 #[doc = r" contract methods. This can be used for methods where the name"]
192 #[doc = r" would collide with a common method (like `at` or `deployed`)."]
193 pub fn methods(&self) -> &Methods {
194 &self.methods
195 }
196 }
197 #[doc = r" Type containing signatures for all methods for generated contract type."]
198 #[derive(Clone, Copy)]
199 pub struct Signatures;
200 impl Signatures {
201 #[doc = "Returns signature for method `canImplementInterfaceForAddress(bytes32,address):(bytes32)`."]
202 #[allow(clippy::type_complexity)]
203 pub fn can_implement_interface_for_address(
204 &self,
205 ) -> self::ethcontract::contract::Signature<
206 (
207 self::ethcontract::tokens::Bytes<[u8; 32]>,
208 self::ethcontract::Address,
209 ),
210 self::ethcontract::tokens::Bytes<[u8; 32]>,
211 > {
212 self::ethcontract::contract::Signature::new([36, 156, 179, 250])
213 }
214 }
215 #[doc = r" Type containing all contract methods for generated contract type."]
216 #[derive(Clone)]
217 pub struct Methods {
218 instance: self::ethcontract::dyns::DynInstance,
219 }
220 #[allow(clippy::too_many_arguments, clippy::type_complexity)]
221 impl Methods {
222 #[doc = "Generated by `ethcontract`"]
223 pub fn can_implement_interface_for_address(
224 &self,
225 interface_hash: self::ethcontract::tokens::Bytes<[u8; 32]>,
226 account: self::ethcontract::Address,
227 ) -> self::ethcontract::dyns::DynViewMethodBuilder<self::ethcontract::tokens::Bytes<[u8; 32]>>
228 {
229 self
230 .instance
231 .view_method([36, 156, 179, 250], (interface_hash, account))
232 .expect("generated call")
233 }
234 }
235 impl std::ops::Deref for Contract {
236 type Target = Methods;
237 fn deref(&self) -> &Self::Target {
238 &self.methods
239 }
240 }
241}
242pub use self::erc1820_implementer_upgradeable::Contract as ERC1820ImplementerUpgradeable;