openzeppelin_rs/contracts/
IERC1363Spender.rs

1pub use ierc1363_spender::*;
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 ierc1363_spender {
13    #[rustfmt::skip]
14    const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"onApprovalReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\",\"components\":[]}]}]";
15    ///The parsed JSON ABI of the contract.
16    pub static IERC1363SPENDER_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 IERC1363Spender<M>(::ethers_contract::Contract<M>);
19    impl<M> ::core::clone::Clone for IERC1363Spender<M> {
20        fn clone(&self) -> Self {
21            Self(::core::clone::Clone::clone(&self.0))
22        }
23    }
24    impl<M> ::core::ops::Deref for IERC1363Spender<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 IERC1363Spender<M> {
31        fn deref_mut(&mut self) -> &mut Self::Target {
32            &mut self.0
33        }
34    }
35    impl<M> ::core::fmt::Debug for IERC1363Spender<M> {
36        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37            f.debug_tuple(stringify!(IERC1363Spender)).field(&self.address()).finish()
38        }
39    }
40    impl<M: ::ethers_providers::Middleware> IERC1363Spender<M> {
41        /// Creates a new contract instance with the specified `ethers` client at
42        /// `address`. The contract derefs to a `ethers::Contract` object.
43        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                    IERC1363SPENDER_ABI.clone(),
51                    client,
52                ),
53            )
54        }
55        ///Calls the contract's `onApprovalReceived` (0x7b04a2d0) function
56        pub fn on_approval_received(
57            &self,
58            owner: ::ethers_core::types::Address,
59            amount: ::ethers_core::types::U256,
60            data: ::ethers_core::types::Bytes,
61        ) -> ::ethers_contract::builders::ContractCall<M, [u8; 4]> {
62            self.0
63                .method_hash([123, 4, 162, 208], (owner, amount, data))
64                .expect("method not found (this should never happen)")
65        }
66    }
67    impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
68    for IERC1363Spender<M> {
69        fn from(contract: ::ethers_contract::Contract<M>) -> Self {
70            Self::new(contract.address(), contract.client())
71        }
72    }
73    ///Container type for all input parameters for the `onApprovalReceived` function with signature `onApprovalReceived(address,uint256,bytes)` and selector `0x7b04a2d0`
74    #[derive(
75        Clone,
76        ::ethers_contract::EthCall,
77        ::ethers_contract::EthDisplay,
78        Default,
79        Debug,
80        PartialEq,
81        Eq,
82        Hash
83    )]
84    #[ethcall(
85        name = "onApprovalReceived",
86        abi = "onApprovalReceived(address,uint256,bytes)"
87    )]
88    pub struct OnApprovalReceivedCall {
89        pub owner: ::ethers_core::types::Address,
90        pub amount: ::ethers_core::types::U256,
91        pub data: ::ethers_core::types::Bytes,
92    }
93    ///Container type for all return fields from the `onApprovalReceived` function with signature `onApprovalReceived(address,uint256,bytes)` and selector `0x7b04a2d0`
94    #[derive(
95        Clone,
96        ::ethers_contract::EthAbiType,
97        ::ethers_contract::EthAbiCodec,
98        Default,
99        Debug,
100        PartialEq,
101        Eq,
102        Hash
103    )]
104    pub struct OnApprovalReceivedReturn(pub [u8; 4]);
105}