openzeppelin_rs/contracts/
IERC777Sender.rs

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