openzeppelin_rs/contracts/
Proxy.rs1pub use proxy::*;
2#[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 proxy {
13 #[rustfmt::skip]
14 const __ABI: &str = "[{\"inputs\":[],\"stateMutability\":\"payable\",\"type\":\"fallback\",\"outputs\":[]},{\"inputs\":[],\"stateMutability\":\"payable\",\"type\":\"receive\",\"outputs\":[]}]";
15 pub static PROXY_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 Proxy<M>(::ethers_contract::Contract<M>);
19 impl<M> ::core::clone::Clone for Proxy<M> {
20 fn clone(&self) -> Self {
21 Self(::core::clone::Clone::clone(&self.0))
22 }
23 }
24 impl<M> ::core::ops::Deref for Proxy<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 Proxy<M> {
31 fn deref_mut(&mut self) -> &mut Self::Target {
32 &mut self.0
33 }
34 }
35 impl<M> ::core::fmt::Debug for Proxy<M> {
36 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37 f.debug_tuple(stringify!(Proxy)).field(&self.address()).finish()
38 }
39 }
40 impl<M: ::ethers_providers::Middleware> Proxy<M> {
41 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 PROXY_ABI.clone(),
51 client,
52 ),
53 )
54 }
55 }
56 impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
57 for Proxy<M> {
58 fn from(contract: ::ethers_contract::Contract<M>) -> Self {
59 Self::new(contract.address(), contract.client())
60 }
61 }
62}