1#[allow(dead_code)]
2pub mod erc20_burnable_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\":\"ERC20BurnableUpgradeable\",\"abi\":[{\"type\":\"function\",\"name\":\"burn\",\"inputs\":[{\"name\":\"amount\",\"type\":\"uint256\"}],\"outputs\":[],\"constant\":false,\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"balanceOf\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"constant\":false,\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"allowance\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"constant\":false,\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"increaseAllowance\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"addedValue\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"constant\":false,\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"totalSupply\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"constant\":false,\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"burnFrom\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"outputs\":[],\"constant\":false,\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"symbol\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"constant\":false,\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"constant\":false,\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferFrom\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"constant\":false,\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"constant\":false,\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decreaseAllowance\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"constant\":false,\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"approve\",\"inputs\":[{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"constant\":false,\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"name\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"constant\":false,\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"Transfer\",\"inputs\":[{\"name\":\"from\",\"type\":\"address\",\"indexed\":true},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Approval\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true},{\"name\":\"spender\",\"type\":\"address\",\"indexed\":true},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false}],\"anonymous\":false}],\"bytecode\":\"\",\"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!(ERC20BurnableUpgradeable))
131        .field(&self.address())
132        .finish()
133    }
134  }
135  impl Contract {
136    #[doc = r" Returns an object that allows accessing typed method signatures."]
137    pub fn signatures() -> Signatures {
138      Signatures
139    }
140    #[doc = r" Retrieves a reference to type containing all the generated"]
141    #[doc = r" contract methods. This can be used for methods where the name"]
142    #[doc = r" would collide with a common method (like `at` or `deployed`)."]
143    pub fn methods(&self) -> &Methods {
144      &self.methods
145    }
146  }
147  #[doc = r" Type containing signatures for all methods for generated contract type."]
148  #[derive(Clone, Copy)]
149  pub struct Signatures;
150  impl Signatures {
151    #[doc = "Returns signature for method `burn(uint256)`."]
152    #[allow(clippy::type_complexity)]
153    pub fn burn(&self) -> self::ethcontract::contract::Signature<(self::ethcontract::U256,), ()> {
154      self::ethcontract::contract::Signature::new([66, 150, 108, 104])
155    }
156    #[doc = "Returns signature for method `balanceOf(address):(uint256)`."]
157    #[allow(clippy::type_complexity)]
158    pub fn balance_of(
159      &self,
160    ) -> self::ethcontract::contract::Signature<
161      (self::ethcontract::Address,),
162      self::ethcontract::U256,
163    > {
164      self::ethcontract::contract::Signature::new([112, 160, 130, 49])
165    }
166    #[doc = "Returns signature for method `allowance(address,address):(uint256)`."]
167    #[allow(clippy::type_complexity)]
168    pub fn allowance(
169      &self,
170    ) -> self::ethcontract::contract::Signature<
171      (self::ethcontract::Address, self::ethcontract::Address),
172      self::ethcontract::U256,
173    > {
174      self::ethcontract::contract::Signature::new([221, 98, 237, 62])
175    }
176    #[doc = "Returns signature for method `increaseAllowance(address,uint256):(bool)`."]
177    #[allow(clippy::type_complexity)]
178    pub fn increase_allowance(
179      &self,
180    ) -> self::ethcontract::contract::Signature<
181      (self::ethcontract::Address, self::ethcontract::U256),
182      bool,
183    > {
184      self::ethcontract::contract::Signature::new([57, 80, 147, 81])
185    }
186    #[doc = "Returns signature for method `totalSupply():(uint256)`."]
187    #[allow(clippy::type_complexity)]
188    pub fn total_supply(
189      &self,
190    ) -> self::ethcontract::contract::Signature<(), self::ethcontract::U256> {
191      self::ethcontract::contract::Signature::new([24, 22, 13, 221])
192    }
193    #[doc = "Returns signature for method `burnFrom(address,uint256)`."]
194    #[allow(clippy::type_complexity)]
195    pub fn burn_from(
196      &self,
197    ) -> self::ethcontract::contract::Signature<
198      (self::ethcontract::Address, self::ethcontract::U256),
199      (),
200    > {
201      self::ethcontract::contract::Signature::new([121, 204, 103, 144])
202    }
203    #[doc = "Returns signature for method `symbol():(string)`."]
204    #[allow(clippy::type_complexity)]
205    pub fn symbol(&self) -> self::ethcontract::contract::Signature<(), String> {
206      self::ethcontract::contract::Signature::new([149, 216, 155, 65])
207    }
208    #[doc = "Returns signature for method `transfer(address,uint256):(bool)`."]
209    #[allow(clippy::type_complexity)]
210    pub fn transfer(
211      &self,
212    ) -> self::ethcontract::contract::Signature<
213      (self::ethcontract::Address, self::ethcontract::U256),
214      bool,
215    > {
216      self::ethcontract::contract::Signature::new([169, 5, 156, 187])
217    }
218    #[doc = "Returns signature for method `transferFrom(address,address,uint256):(bool)`."]
219    #[allow(clippy::type_complexity)]
220    pub fn transfer_from(
221      &self,
222    ) -> self::ethcontract::contract::Signature<
223      (
224        self::ethcontract::Address,
225        self::ethcontract::Address,
226        self::ethcontract::U256,
227      ),
228      bool,
229    > {
230      self::ethcontract::contract::Signature::new([35, 184, 114, 221])
231    }
232    #[doc = "Returns signature for method `decimals():(uint8)`."]
233    #[allow(clippy::type_complexity)]
234    pub fn decimals(&self) -> self::ethcontract::contract::Signature<(), u8> {
235      self::ethcontract::contract::Signature::new([49, 60, 229, 103])
236    }
237    #[doc = "Returns signature for method `decreaseAllowance(address,uint256):(bool)`."]
238    #[allow(clippy::type_complexity)]
239    pub fn decrease_allowance(
240      &self,
241    ) -> self::ethcontract::contract::Signature<
242      (self::ethcontract::Address, self::ethcontract::U256),
243      bool,
244    > {
245      self::ethcontract::contract::Signature::new([164, 87, 194, 215])
246    }
247    #[doc = "Returns signature for method `approve(address,uint256):(bool)`."]
248    #[allow(clippy::type_complexity)]
249    pub fn approve(
250      &self,
251    ) -> self::ethcontract::contract::Signature<
252      (self::ethcontract::Address, self::ethcontract::U256),
253      bool,
254    > {
255      self::ethcontract::contract::Signature::new([9, 94, 167, 179])
256    }
257    #[doc = "Returns signature for method `name():(string)`."]
258    #[allow(clippy::type_complexity)]
259    pub fn name(&self) -> self::ethcontract::contract::Signature<(), String> {
260      self::ethcontract::contract::Signature::new([6, 253, 222, 3])
261    }
262  }
263  #[doc = r" Type containing all contract methods for generated contract type."]
264  #[derive(Clone)]
265  pub struct Methods {
266    instance: self::ethcontract::dyns::DynInstance,
267  }
268  #[allow(clippy::too_many_arguments, clippy::type_complexity)]
269  impl Methods {
270    #[doc = "Generated by `ethcontract`"]
271    pub fn burn(
272      &self,
273      amount: self::ethcontract::U256,
274    ) -> self::ethcontract::dyns::DynMethodBuilder<()> {
275      self
276        .instance
277        .method([66, 150, 108, 104], (amount,))
278        .expect("generated call")
279    }
280    #[doc = "Generated by `ethcontract`"]
281    pub fn balance_of(
282      &self,
283      account: self::ethcontract::Address,
284    ) -> self::ethcontract::dyns::DynViewMethodBuilder<self::ethcontract::U256> {
285      self
286        .instance
287        .view_method([112, 160, 130, 49], (account,))
288        .expect("generated call")
289    }
290    #[doc = "Generated by `ethcontract`"]
291    pub fn allowance(
292      &self,
293      owner: self::ethcontract::Address,
294      spender: self::ethcontract::Address,
295    ) -> self::ethcontract::dyns::DynViewMethodBuilder<self::ethcontract::U256> {
296      self
297        .instance
298        .view_method([221, 98, 237, 62], (owner, spender))
299        .expect("generated call")
300    }
301    #[doc = "Generated by `ethcontract`"]
302    pub fn increase_allowance(
303      &self,
304      spender: self::ethcontract::Address,
305      added_value: self::ethcontract::U256,
306    ) -> self::ethcontract::dyns::DynMethodBuilder<bool> {
307      self
308        .instance
309        .method([57, 80, 147, 81], (spender, added_value))
310        .expect("generated call")
311    }
312    #[doc = "Generated by `ethcontract`"]
313    pub fn total_supply(
314      &self,
315    ) -> self::ethcontract::dyns::DynViewMethodBuilder<self::ethcontract::U256> {
316      self
317        .instance
318        .view_method([24, 22, 13, 221], ())
319        .expect("generated call")
320    }
321    #[doc = "Generated by `ethcontract`"]
322    pub fn burn_from(
323      &self,
324      account: self::ethcontract::Address,
325      amount: self::ethcontract::U256,
326    ) -> self::ethcontract::dyns::DynMethodBuilder<()> {
327      self
328        .instance
329        .method([121, 204, 103, 144], (account, amount))
330        .expect("generated call")
331    }
332    #[doc = "Generated by `ethcontract`"]
333    pub fn symbol(&self) -> self::ethcontract::dyns::DynViewMethodBuilder<String> {
334      self
335        .instance
336        .view_method([149, 216, 155, 65], ())
337        .expect("generated call")
338    }
339    #[doc = "Generated by `ethcontract`"]
340    pub fn transfer(
341      &self,
342      recipient: self::ethcontract::Address,
343      amount: self::ethcontract::U256,
344    ) -> self::ethcontract::dyns::DynMethodBuilder<bool> {
345      self
346        .instance
347        .method([169, 5, 156, 187], (recipient, amount))
348        .expect("generated call")
349    }
350    #[doc = "Generated by `ethcontract`"]
351    pub fn transfer_from(
352      &self,
353      sender: self::ethcontract::Address,
354      recipient: self::ethcontract::Address,
355      amount: self::ethcontract::U256,
356    ) -> self::ethcontract::dyns::DynMethodBuilder<bool> {
357      self
358        .instance
359        .method([35, 184, 114, 221], (sender, recipient, amount))
360        .expect("generated call")
361    }
362    #[doc = "Generated by `ethcontract`"]
363    pub fn decimals(&self) -> self::ethcontract::dyns::DynViewMethodBuilder<u8> {
364      self
365        .instance
366        .view_method([49, 60, 229, 103], ())
367        .expect("generated call")
368    }
369    #[doc = "Generated by `ethcontract`"]
370    pub fn decrease_allowance(
371      &self,
372      spender: self::ethcontract::Address,
373      subtracted_value: self::ethcontract::U256,
374    ) -> self::ethcontract::dyns::DynMethodBuilder<bool> {
375      self
376        .instance
377        .method([164, 87, 194, 215], (spender, subtracted_value))
378        .expect("generated call")
379    }
380    #[doc = "Generated by `ethcontract`"]
381    pub fn approve(
382      &self,
383      spender: self::ethcontract::Address,
384      amount: self::ethcontract::U256,
385    ) -> self::ethcontract::dyns::DynMethodBuilder<bool> {
386      self
387        .instance
388        .method([9, 94, 167, 179], (spender, amount))
389        .expect("generated call")
390    }
391    #[doc = "Generated by `ethcontract`"]
392    pub fn name(&self) -> self::ethcontract::dyns::DynViewMethodBuilder<String> {
393      self
394        .instance
395        .view_method([6, 253, 222, 3], ())
396        .expect("generated call")
397    }
398  }
399  impl std::ops::Deref for Contract {
400    type Target = Methods;
401    fn deref(&self) -> &Self::Target {
402      &self.methods
403    }
404  }
405  #[doc = r" Module containing all generated data models for this contract's"]
406  #[doc = r" events."]
407  pub mod event_data {
408    use super::ethcontract;
409    #[derive(Clone, Debug, Default, Eq, PartialEq, serde :: Deserialize, serde :: Serialize)]
410    pub struct Transfer {
411      pub from: self::ethcontract::Address,
412      pub to: self::ethcontract::Address,
413      pub value: self::ethcontract::U256,
414    }
415    impl Transfer {
416      #[doc = r" Retrieves the signature for the event this data corresponds to."]
417      #[doc = r" This signature is the Keccak-256 hash of the ABI signature of"]
418      #[doc = r" this event."]
419      pub fn signature() -> self::ethcontract::H256 {
420        self::ethcontract::H256([
421          221, 242, 82, 173, 27, 226, 200, 155, 105, 194, 176, 104, 252, 55, 141, 170, 149, 43,
422          167, 241, 99, 196, 161, 22, 40, 245, 90, 77, 245, 35, 179, 239,
423        ])
424      }
425      #[doc = r" Retrieves the ABI signature for the event this data corresponds"]
426      #[doc = r" to. For this event the value should always be:"]
427      #[doc = r""]
428      #[doc = "`Transfer(address,address,uint256)`"]
429      pub fn abi_signature() -> &'static str {
430        "Transfer(address,address,uint256)"
431      }
432    }
433    impl self::ethcontract::tokens::Tokenize for Transfer {
434      fn from_token(
435        token: self::ethcontract::common::abi::Token,
436      ) -> Result<Self, self::ethcontract::tokens::Error> {
437        let (from, to, value) = self::ethcontract::tokens::Tokenize::from_token(token)?;
438        Ok(Transfer { from, to, value })
439      }
440      fn into_token(self) -> self::ethcontract::common::abi::Token {
441        unimplemented!("events are only decoded, not encoded")
442      }
443    }
444    #[derive(Clone, Debug, Default, Eq, PartialEq, serde :: Deserialize, serde :: Serialize)]
445    pub struct Approval {
446      pub owner: self::ethcontract::Address,
447      pub spender: self::ethcontract::Address,
448      pub value: self::ethcontract::U256,
449    }
450    impl Approval {
451      #[doc = r" Retrieves the signature for the event this data corresponds to."]
452      #[doc = r" This signature is the Keccak-256 hash of the ABI signature of"]
453      #[doc = r" this event."]
454      pub fn signature() -> self::ethcontract::H256 {
455        self::ethcontract::H256([
456          140, 91, 225, 229, 235, 236, 125, 91, 209, 79, 113, 66, 125, 30, 132, 243, 221, 3, 20,
457          192, 247, 178, 41, 30, 91, 32, 10, 200, 199, 195, 185, 37,
458        ])
459      }
460      #[doc = r" Retrieves the ABI signature for the event this data corresponds"]
461      #[doc = r" to. For this event the value should always be:"]
462      #[doc = r""]
463      #[doc = "`Approval(address,address,uint256)`"]
464      pub fn abi_signature() -> &'static str {
465        "Approval(address,address,uint256)"
466      }
467    }
468    impl self::ethcontract::tokens::Tokenize for Approval {
469      fn from_token(
470        token: self::ethcontract::common::abi::Token,
471      ) -> Result<Self, self::ethcontract::tokens::Error> {
472        let (owner, spender, value) = self::ethcontract::tokens::Tokenize::from_token(token)?;
473        Ok(Approval {
474          owner,
475          spender,
476          value,
477        })
478      }
479      fn into_token(self) -> self::ethcontract::common::abi::Token {
480        unimplemented!("events are only decoded, not encoded")
481      }
482    }
483  }
484  impl Contract {
485    #[doc = r" Retrieves a handle to a type containing for creating event"]
486    #[doc = r" streams for all the contract events."]
487    pub fn events(&self) -> Events<'_> {
488      Events {
489        instance: self.raw_instance(),
490      }
491    }
492  }
493  pub struct Events<'a> {
494    instance: &'a self::ethcontract::dyns::DynInstance,
495  }
496  impl Events<'_> {
497    #[doc = r" Generated by `ethcontract`."]
498    pub fn transfer(&self) -> self::event_builders::TransferBuilder {
499      self::event_builders::TransferBuilder(
500        self
501          .instance
502          .event(self::ethcontract::H256([
503            221, 242, 82, 173, 27, 226, 200, 155, 105, 194, 176, 104, 252, 55, 141, 170, 149, 43,
504            167, 241, 99, 196, 161, 22, 40, 245, 90, 77, 245, 35, 179, 239,
505          ]))
506          .expect("generated event filter"),
507      )
508    }
509    #[doc = r" Generated by `ethcontract`."]
510    pub fn approval(&self) -> self::event_builders::ApprovalBuilder {
511      self::event_builders::ApprovalBuilder(
512        self
513          .instance
514          .event(self::ethcontract::H256([
515            140, 91, 225, 229, 235, 236, 125, 91, 209, 79, 113, 66, 125, 30, 132, 243, 221, 3, 20,
516            192, 247, 178, 41, 30, 91, 32, 10, 200, 199, 195, 185, 37,
517          ]))
518          .expect("generated event filter"),
519      )
520    }
521  }
522  #[doc = r" Module containing the generated event stream builders with type safe"]
523  #[doc = r" filter methods for this contract's events."]
524  pub mod event_builders {
525    use super::ethcontract;
526    use super::event_data;
527    #[doc = "A builder for creating a filtered stream of `Transfer` events."]
528    pub struct TransferBuilder(
529      #[doc = r" The inner event builder."]
530      pub  self::ethcontract::dyns::DynEventBuilder<self::event_data::Transfer>,
531    );
532    impl TransferBuilder {
533      #[doc = r" Sets the starting block from which to stream logs for."]
534      #[doc = r""]
535      #[doc = r" If left unset defaults to the latest block."]
536      #[allow(clippy::wrong_self_convention)]
537      pub fn from_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
538        self.0 = (self.0).from_block(block);
539        self
540      }
541      #[doc = r" Sets the last block from which to stream logs for."]
542      #[doc = r""]
543      #[doc = r" If left unset defaults to the streaming until the end of days."]
544      #[allow(clippy::wrong_self_convention)]
545      pub fn to_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
546        self.0 = (self.0).to_block(block);
547        self
548      }
549      #[doc = r" Limits the number of events that can be retrieved by this filter."]
550      #[doc = r""]
551      #[doc = r" Note that this parameter is non-standard."]
552      pub fn limit(mut self, value: usize) -> Self {
553        self.0 = (self.0).limit(value);
554        self
555      }
556      #[doc = r" Sets the polling interval. This is used as the interval between"]
557      #[doc = r" consecutive `eth_getFilterChanges` calls to get filter updates."]
558      pub fn poll_interval(mut self, value: std::time::Duration) -> Self {
559        self.0 = (self.0).poll_interval(value);
560        self
561      }
562      #[doc = "Adds a filter for the from event parameter."]
563      pub fn from(mut self, topic: self::ethcontract::Topic<self::ethcontract::Address>) -> Self {
564        self.0 = (self.0).topic0(topic);
565        self
566      }
567      #[doc = "Adds a filter for the to event parameter."]
568      pub fn to(mut self, topic: self::ethcontract::Topic<self::ethcontract::Address>) -> Self {
569        self.0 = (self.0).topic1(topic);
570        self
571      }
572      #[doc = r" Returns a future that resolves with a collection of all existing"]
573      #[doc = r" logs matching the builder parameters."]
574      pub async fn query(
575        self,
576      ) -> std::result::Result<
577        std::vec::Vec<self::ethcontract::Event<self::event_data::Transfer>>,
578        self::ethcontract::errors::EventError,
579      > {
580        (self.0).query().await
581      }
582      #[doc = r" Creates an event stream from the current event builder."]
583      pub fn stream(
584        self,
585      ) -> impl self::ethcontract::futures::stream::Stream<
586        Item = std::result::Result<
587          self::ethcontract::StreamEvent<self::event_data::Transfer>,
588          self::ethcontract::errors::EventError,
589        >,
590      > {
591        (self.0).stream()
592      }
593    }
594    #[doc = "A builder for creating a filtered stream of `Approval` events."]
595    pub struct ApprovalBuilder(
596      #[doc = r" The inner event builder."]
597      pub  self::ethcontract::dyns::DynEventBuilder<self::event_data::Approval>,
598    );
599    impl ApprovalBuilder {
600      #[doc = r" Sets the starting block from which to stream logs for."]
601      #[doc = r""]
602      #[doc = r" If left unset defaults to the latest block."]
603      #[allow(clippy::wrong_self_convention)]
604      pub fn from_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
605        self.0 = (self.0).from_block(block);
606        self
607      }
608      #[doc = r" Sets the last block from which to stream logs for."]
609      #[doc = r""]
610      #[doc = r" If left unset defaults to the streaming until the end of days."]
611      #[allow(clippy::wrong_self_convention)]
612      pub fn to_block(mut self, block: self::ethcontract::BlockNumber) -> Self {
613        self.0 = (self.0).to_block(block);
614        self
615      }
616      #[doc = r" Limits the number of events that can be retrieved by this filter."]
617      #[doc = r""]
618      #[doc = r" Note that this parameter is non-standard."]
619      pub fn limit(mut self, value: usize) -> Self {
620        self.0 = (self.0).limit(value);
621        self
622      }
623      #[doc = r" Sets the polling interval. This is used as the interval between"]
624      #[doc = r" consecutive `eth_getFilterChanges` calls to get filter updates."]
625      pub fn poll_interval(mut self, value: std::time::Duration) -> Self {
626        self.0 = (self.0).poll_interval(value);
627        self
628      }
629      #[doc = "Adds a filter for the owner event parameter."]
630      pub fn owner(mut self, topic: self::ethcontract::Topic<self::ethcontract::Address>) -> Self {
631        self.0 = (self.0).topic0(topic);
632        self
633      }
634      #[doc = "Adds a filter for the spender event parameter."]
635      pub fn spender(
636        mut self,
637        topic: self::ethcontract::Topic<self::ethcontract::Address>,
638      ) -> Self {
639        self.0 = (self.0).topic1(topic);
640        self
641      }
642      #[doc = r" Returns a future that resolves with a collection of all existing"]
643      #[doc = r" logs matching the builder parameters."]
644      pub async fn query(
645        self,
646      ) -> std::result::Result<
647        std::vec::Vec<self::ethcontract::Event<self::event_data::Approval>>,
648        self::ethcontract::errors::EventError,
649      > {
650        (self.0).query().await
651      }
652      #[doc = r" Creates an event stream from the current event builder."]
653      pub fn stream(
654        self,
655      ) -> impl self::ethcontract::futures::stream::Stream<
656        Item = std::result::Result<
657          self::ethcontract::StreamEvent<self::event_data::Approval>,
658          self::ethcontract::errors::EventError,
659        >,
660      > {
661        (self.0).stream()
662      }
663    }
664  }
665  impl Contract {
666    #[doc = r" Returns a log stream with all events."]
667    pub fn all_events(&self) -> self::ethcontract::dyns::DynAllEventsBuilder<Event> {
668      self::ethcontract::dyns::DynAllEventsBuilder::new(
669        self.raw_instance().web3(),
670        self.address(),
671        self.deployment_information(),
672      )
673    }
674  }
675  #[doc = r" A contract event."]
676  #[derive(Clone, Debug, Eq, PartialEq, serde :: Deserialize, serde :: Serialize)]
677  pub enum Event {
678    Approval(self::event_data::Approval),
679    Transfer(self::event_data::Transfer),
680  }
681  impl self::ethcontract::contract::ParseLog for Event {
682    fn parse_log(
683      log: self::ethcontract::RawLog,
684    ) -> Result<Self, self::ethcontract::errors::ExecutionError> {
685      let standard_event = log . topics . get (0) . copied () . map (| topic | match topic { self :: ethcontract :: H256 ([140 , 91 , 225 , 229 , 235 , 236 , 125 , 91 , 209 , 79 , 113 , 66 , 125 , 30 , 132 , 243 , 221 , 3 , 20 , 192 , 247 , 178 , 41 , 30 , 91 , 32 , 10 , 200 , 199 , 195 , 185 , 37]) => Ok (Event :: Approval (log . clone () . decode (Contract :: raw_contract () . abi . event ("Approval") . expect ("generated event decode")) ?)) , self :: ethcontract :: H256 ([221 , 242 , 82 , 173 , 27 , 226 , 200 , 155 , 105 , 194 , 176 , 104 , 252 , 55 , 141 , 170 , 149 , 43 , 167 , 241 , 99 , 196 , 161 , 22 , 40 , 245 , 90 , 77 , 245 , 35 , 179 , 239]) => Ok (Event :: Transfer (log . clone () . decode (Contract :: raw_contract () . abi . event ("Transfer") . expect ("generated event decode")) ?)) , _ => Err (self :: ethcontract :: errors :: ExecutionError :: from (self :: ethcontract :: common :: abi :: Error :: InvalidData)) , }) ;
686      if let Some(Ok(data)) = standard_event {
687        return Ok(data);
688      }
689      Err(self::ethcontract::errors::ExecutionError::from(
690        self::ethcontract::common::abi::Error::InvalidData,
691      ))
692    }
693  }
694}
695pub use self::erc20_burnable_upgradeable::Contract as ERC20BurnableUpgradeable;