openzeppelin_rs/contracts/
IERC1363Receiver.rs

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