niftygate_bindings/openzeppelin/contracts_upgradeable/generated/
timers_upgradeable.rs

1#[allow(dead_code)]
2pub mod timers_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\":\"TimersUpgradeable\",\"abi\":[],\"bytecode\":\"60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220531181ce6dd97c9c1cca639fbfe806583652f4eda2e06ece8243efb41a08ea5464736f6c63430008030033\",\"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!(TimersUpgradeable))
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  #[derive(Clone)]
186  struct Methods {
187    instance: self::ethcontract::dyns::DynInstance,
188  }
189  #[derive(Clone, Copy)]
190  struct Signatures;
191}
192pub use self::timers_upgradeable::Contract as TimersUpgradeable;