pub use ierc1363::*;
/// This module was auto-generated with ethers-rs Abigen.
/// More information at: <https://github.com/gakonst/ethers-rs>
#[allow(
clippy::enum_variant_names,
clippy::too_many_arguments,
clippy::upper_case_acronyms,
clippy::type_complexity,
dead_code,
non_camel_case_types,
)]
pub mod ierc1363 {
#[rustfmt::skip]
const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"Approval\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"Transfer\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"approveAndCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"approveAndCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transferAndCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transferAndCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transferFromAndCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transferFromAndCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]}]";
///The parsed JSON ABI of the contract.
pub static IERC1363_ABI: ::ethers_contract::Lazy<::ethers_core::abi::Abi> = ::ethers_contract::Lazy::new(||
::ethers_core::utils::__serde_json::from_str(__ABI).expect("ABI is always valid"));
pub struct IERC1363<M>(::ethers_contract::Contract<M>);
impl<M> ::core::clone::Clone for IERC1363<M> {
fn clone(&self) -> Self {
Self(::core::clone::Clone::clone(&self.0))
}
}
impl<M> ::core::ops::Deref for IERC1363<M> {
type Target = ::ethers_contract::Contract<M>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<M> ::core::ops::DerefMut for IERC1363<M> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl<M> ::core::fmt::Debug for IERC1363<M> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple(stringify!(IERC1363)).field(&self.address()).finish()
}
}
impl<M: ::ethers_providers::Middleware> IERC1363<M> {
/// Creates a new contract instance with the specified `ethers` client at
/// `address`. The contract derefs to a `ethers::Contract` object.
pub fn new<T: Into<::ethers_core::types::Address>>(
address: T,
client: ::std::sync::Arc<M>,
) -> Self {
Self(
::ethers_contract::Contract::new(
address.into(),
IERC1363_ABI.clone(),
client,
),
)
}
///Calls the contract's `allowance` (0xdd62ed3e) function
pub fn allowance(
&self,
owner: ::ethers_core::types::Address,
spender: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
self.0
.method_hash([221, 98, 237, 62], (owner, spender))
.expect("method not found (this should never happen)")
}
///Calls the contract's `approve` (0x095ea7b3) function
pub fn approve(
&self,
spender: ::ethers_core::types::Address,
amount: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([9, 94, 167, 179], (spender, amount))
.expect("method not found (this should never happen)")
}
///Calls the contract's `approveAndCall` (0x3177029f) function
pub fn approve_and_call(
&self,
spender: ::ethers_core::types::Address,
amount: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([49, 119, 2, 159], (spender, amount))
.expect("method not found (this should never happen)")
}
///Calls the contract's `approveAndCall` (0xcae9ca51) function
pub fn approve_and_call_with_spender_and_amount(
&self,
spender: ::ethers_core::types::Address,
amount: ::ethers_core::types::U256,
data: ::ethers_core::types::Bytes,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([202, 233, 202, 81], (spender, amount, data))
.expect("method not found (this should never happen)")
}
///Calls the contract's `balanceOf` (0x70a08231) function
pub fn balance_of(
&self,
account: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
self.0
.method_hash([112, 160, 130, 49], account)
.expect("method not found (this should never happen)")
}
///Calls the contract's `supportsInterface` (0x01ffc9a7) function
pub fn supports_interface(
&self,
interface_id: [u8; 4],
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([1, 255, 201, 167], interface_id)
.expect("method not found (this should never happen)")
}
///Calls the contract's `totalSupply` (0x18160ddd) function
pub fn total_supply(
&self,
) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
self.0
.method_hash([24, 22, 13, 221], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `transfer` (0xa9059cbb) function
pub fn transfer(
&self,
to: ::ethers_core::types::Address,
amount: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([169, 5, 156, 187], (to, amount))
.expect("method not found (this should never happen)")
}
///Calls the contract's `transferAndCall` (0x1296ee62) function
pub fn transfer_and_call(
&self,
to: ::ethers_core::types::Address,
amount: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([18, 150, 238, 98], (to, amount))
.expect("method not found (this should never happen)")
}
///Calls the contract's `transferAndCall` (0x4000aea0) function
pub fn transfer_and_call_with_to_and_amount(
&self,
to: ::ethers_core::types::Address,
amount: ::ethers_core::types::U256,
data: ::ethers_core::types::Bytes,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([64, 0, 174, 160], (to, amount, data))
.expect("method not found (this should never happen)")
}
///Calls the contract's `transferFrom` (0x23b872dd) function
pub fn transfer_from(
&self,
from: ::ethers_core::types::Address,
to: ::ethers_core::types::Address,
amount: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([35, 184, 114, 221], (from, to, amount))
.expect("method not found (this should never happen)")
}
///Calls the contract's `transferFromAndCall` (0xc1d34b89) function
pub fn transfer_from_and_call_with_from_and_to_and_data(
&self,
from: ::ethers_core::types::Address,
to: ::ethers_core::types::Address,
amount: ::ethers_core::types::U256,
data: ::ethers_core::types::Bytes,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([193, 211, 75, 137], (from, to, amount, data))
.expect("method not found (this should never happen)")
}
///Calls the contract's `transferFromAndCall` (0xd8fbe994) function
pub fn transfer_from_and_call(
&self,
from: ::ethers_core::types::Address,
to: ::ethers_core::types::Address,
amount: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([216, 251, 233, 148], (from, to, amount))
.expect("method not found (this should never happen)")
}
///Gets the contract's `Approval` event
pub fn approval_filter(
&self,
) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, ApprovalFilter> {
self.0.event()
}
///Gets the contract's `Transfer` event
pub fn transfer_filter(
&self,
) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, TransferFilter> {
self.0.event()
}
/// Returns an `Event` builder for all the events of this contract.
pub fn events(
&self,
) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, IERC1363Events> {
self.0.event_with_filter(::core::default::Default::default())
}
}
impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
for IERC1363<M> {
fn from(contract: ::ethers_contract::Contract<M>) -> Self {
Self::new(contract.address(), contract.client())
}
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(name = "Approval", abi = "Approval(address,address,uint256)")]
pub struct ApprovalFilter {
#[ethevent(indexed)]
pub owner: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub spender: ::ethers_core::types::Address,
pub value: ::ethers_core::types::U256,
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(name = "Transfer", abi = "Transfer(address,address,uint256)")]
pub struct TransferFilter {
#[ethevent(indexed)]
pub from: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub to: ::ethers_core::types::Address,
pub value: ::ethers_core::types::U256,
}
///Container type for all of the contract's events
#[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum IERC1363Events {
ApprovalFilter(ApprovalFilter),
TransferFilter(TransferFilter),
}
impl ::ethers_contract::EthLogDecode for IERC1363Events {
fn decode_log(
log: &::ethers_core::abi::RawLog,
) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
if let Ok(decoded) = ApprovalFilter::decode_log(log) {
return Ok(IERC1363Events::ApprovalFilter(decoded));
}
if let Ok(decoded) = TransferFilter::decode_log(log) {
return Ok(IERC1363Events::TransferFilter(decoded));
}
Err(::ethers_core::abi::Error::InvalidData)
}
}
impl ::core::fmt::Display for IERC1363Events {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::ApprovalFilter(element) => ::core::fmt::Display::fmt(element, f),
Self::TransferFilter(element) => ::core::fmt::Display::fmt(element, f),
}
}
}
impl ::core::convert::From<ApprovalFilter> for IERC1363Events {
fn from(value: ApprovalFilter) -> Self {
Self::ApprovalFilter(value)
}
}
impl ::core::convert::From<TransferFilter> for IERC1363Events {
fn from(value: TransferFilter) -> Self {
Self::TransferFilter(value)
}
}
///Container type for all input parameters for the `allowance` function with signature `allowance(address,address)` and selector `0xdd62ed3e`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "allowance", abi = "allowance(address,address)")]
pub struct AllowanceCall {
pub owner: ::ethers_core::types::Address,
pub spender: ::ethers_core::types::Address,
}
///Container type for all input parameters for the `approve` function with signature `approve(address,uint256)` and selector `0x095ea7b3`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "approve", abi = "approve(address,uint256)")]
pub struct ApproveCall {
pub spender: ::ethers_core::types::Address,
pub amount: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `approveAndCall` function with signature `approveAndCall(address,uint256)` and selector `0x3177029f`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "approveAndCall", abi = "approveAndCall(address,uint256)")]
pub struct ApproveAndCallCall {
pub spender: ::ethers_core::types::Address,
pub amount: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `approveAndCall` function with signature `approveAndCall(address,uint256,bytes)` and selector `0xcae9ca51`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "approveAndCall", abi = "approveAndCall(address,uint256,bytes)")]
pub struct ApproveAndCallWithSpenderAndAmountCall {
pub spender: ::ethers_core::types::Address,
pub amount: ::ethers_core::types::U256,
pub data: ::ethers_core::types::Bytes,
}
///Container type for all input parameters for the `balanceOf` function with signature `balanceOf(address)` and selector `0x70a08231`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "balanceOf", abi = "balanceOf(address)")]
pub struct BalanceOfCall {
pub account: ::ethers_core::types::Address,
}
///Container type for all input parameters for the `supportsInterface` function with signature `supportsInterface(bytes4)` and selector `0x01ffc9a7`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "supportsInterface", abi = "supportsInterface(bytes4)")]
pub struct SupportsInterfaceCall {
pub interface_id: [u8; 4],
}
///Container type for all input parameters for the `totalSupply` function with signature `totalSupply()` and selector `0x18160ddd`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "totalSupply", abi = "totalSupply()")]
pub struct TotalSupplyCall;
///Container type for all input parameters for the `transfer` function with signature `transfer(address,uint256)` and selector `0xa9059cbb`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "transfer", abi = "transfer(address,uint256)")]
pub struct TransferCall {
pub to: ::ethers_core::types::Address,
pub amount: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `transferAndCall` function with signature `transferAndCall(address,uint256)` and selector `0x1296ee62`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "transferAndCall", abi = "transferAndCall(address,uint256)")]
pub struct TransferAndCallCall {
pub to: ::ethers_core::types::Address,
pub amount: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `transferAndCall` function with signature `transferAndCall(address,uint256,bytes)` and selector `0x4000aea0`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "transferAndCall", abi = "transferAndCall(address,uint256,bytes)")]
pub struct TransferAndCallWithToAndAmountCall {
pub to: ::ethers_core::types::Address,
pub amount: ::ethers_core::types::U256,
pub data: ::ethers_core::types::Bytes,
}
///Container type for all input parameters for the `transferFrom` function with signature `transferFrom(address,address,uint256)` and selector `0x23b872dd`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "transferFrom", abi = "transferFrom(address,address,uint256)")]
pub struct TransferFromCall {
pub from: ::ethers_core::types::Address,
pub to: ::ethers_core::types::Address,
pub amount: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `transferFromAndCall` function with signature `transferFromAndCall(address,address,uint256,bytes)` and selector `0xc1d34b89`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(
name = "transferFromAndCall",
abi = "transferFromAndCall(address,address,uint256,bytes)"
)]
pub struct TransferFromAndCallWithFromAndToAndDataCall {
pub from: ::ethers_core::types::Address,
pub to: ::ethers_core::types::Address,
pub amount: ::ethers_core::types::U256,
pub data: ::ethers_core::types::Bytes,
}
///Container type for all input parameters for the `transferFromAndCall` function with signature `transferFromAndCall(address,address,uint256)` and selector `0xd8fbe994`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(
name = "transferFromAndCall",
abi = "transferFromAndCall(address,address,uint256)"
)]
pub struct TransferFromAndCallCall {
pub from: ::ethers_core::types::Address,
pub to: ::ethers_core::types::Address,
pub amount: ::ethers_core::types::U256,
}
///Container type for all of the contract's call
#[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum IERC1363Calls {
Allowance(AllowanceCall),
Approve(ApproveCall),
ApproveAndCall(ApproveAndCallCall),
ApproveAndCallWithSpenderAndAmount(ApproveAndCallWithSpenderAndAmountCall),
BalanceOf(BalanceOfCall),
SupportsInterface(SupportsInterfaceCall),
TotalSupply(TotalSupplyCall),
Transfer(TransferCall),
TransferAndCall(TransferAndCallCall),
TransferAndCallWithToAndAmount(TransferAndCallWithToAndAmountCall),
TransferFrom(TransferFromCall),
TransferFromAndCallWithFromAndToAndData(
TransferFromAndCallWithFromAndToAndDataCall,
),
TransferFromAndCall(TransferFromAndCallCall),
}
impl ::ethers_core::abi::AbiDecode for IERC1363Calls {
fn decode(
data: impl AsRef<[u8]>,
) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
let data = data.as_ref();
if let Ok(decoded)
= <AllowanceCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Allowance(decoded));
}
if let Ok(decoded)
= <ApproveCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Approve(decoded));
}
if let Ok(decoded)
= <ApproveAndCallCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::ApproveAndCall(decoded));
}
if let Ok(decoded)
= <ApproveAndCallWithSpenderAndAmountCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::ApproveAndCallWithSpenderAndAmount(decoded));
}
if let Ok(decoded)
= <BalanceOfCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::BalanceOf(decoded));
}
if let Ok(decoded)
= <SupportsInterfaceCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::SupportsInterface(decoded));
}
if let Ok(decoded)
= <TotalSupplyCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::TotalSupply(decoded));
}
if let Ok(decoded)
= <TransferCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Transfer(decoded));
}
if let Ok(decoded)
= <TransferAndCallCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::TransferAndCall(decoded));
}
if let Ok(decoded)
= <TransferAndCallWithToAndAmountCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::TransferAndCallWithToAndAmount(decoded));
}
if let Ok(decoded)
= <TransferFromCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::TransferFrom(decoded));
}
if let Ok(decoded)
= <TransferFromAndCallWithFromAndToAndDataCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::TransferFromAndCallWithFromAndToAndData(decoded));
}
if let Ok(decoded)
= <TransferFromAndCallCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::TransferFromAndCall(decoded));
}
Err(::ethers_core::abi::Error::InvalidData.into())
}
}
impl ::ethers_core::abi::AbiEncode for IERC1363Calls {
fn encode(self) -> Vec<u8> {
match self {
Self::Allowance(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Approve(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::ApproveAndCall(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::ApproveAndCallWithSpenderAndAmount(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::BalanceOf(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::SupportsInterface(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::TotalSupply(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Transfer(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::TransferAndCall(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::TransferAndCallWithToAndAmount(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::TransferFrom(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::TransferFromAndCallWithFromAndToAndData(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::TransferFromAndCall(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
}
}
}
impl ::core::fmt::Display for IERC1363Calls {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::Allowance(element) => ::core::fmt::Display::fmt(element, f),
Self::Approve(element) => ::core::fmt::Display::fmt(element, f),
Self::ApproveAndCall(element) => ::core::fmt::Display::fmt(element, f),
Self::ApproveAndCallWithSpenderAndAmount(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::BalanceOf(element) => ::core::fmt::Display::fmt(element, f),
Self::SupportsInterface(element) => ::core::fmt::Display::fmt(element, f),
Self::TotalSupply(element) => ::core::fmt::Display::fmt(element, f),
Self::Transfer(element) => ::core::fmt::Display::fmt(element, f),
Self::TransferAndCall(element) => ::core::fmt::Display::fmt(element, f),
Self::TransferAndCallWithToAndAmount(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::TransferFrom(element) => ::core::fmt::Display::fmt(element, f),
Self::TransferFromAndCallWithFromAndToAndData(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::TransferFromAndCall(element) => {
::core::fmt::Display::fmt(element, f)
}
}
}
}
impl ::core::convert::From<AllowanceCall> for IERC1363Calls {
fn from(value: AllowanceCall) -> Self {
Self::Allowance(value)
}
}
impl ::core::convert::From<ApproveCall> for IERC1363Calls {
fn from(value: ApproveCall) -> Self {
Self::Approve(value)
}
}
impl ::core::convert::From<ApproveAndCallCall> for IERC1363Calls {
fn from(value: ApproveAndCallCall) -> Self {
Self::ApproveAndCall(value)
}
}
impl ::core::convert::From<ApproveAndCallWithSpenderAndAmountCall>
for IERC1363Calls {
fn from(value: ApproveAndCallWithSpenderAndAmountCall) -> Self {
Self::ApproveAndCallWithSpenderAndAmount(value)
}
}
impl ::core::convert::From<BalanceOfCall> for IERC1363Calls {
fn from(value: BalanceOfCall) -> Self {
Self::BalanceOf(value)
}
}
impl ::core::convert::From<SupportsInterfaceCall> for IERC1363Calls {
fn from(value: SupportsInterfaceCall) -> Self {
Self::SupportsInterface(value)
}
}
impl ::core::convert::From<TotalSupplyCall> for IERC1363Calls {
fn from(value: TotalSupplyCall) -> Self {
Self::TotalSupply(value)
}
}
impl ::core::convert::From<TransferCall> for IERC1363Calls {
fn from(value: TransferCall) -> Self {
Self::Transfer(value)
}
}
impl ::core::convert::From<TransferAndCallCall> for IERC1363Calls {
fn from(value: TransferAndCallCall) -> Self {
Self::TransferAndCall(value)
}
}
impl ::core::convert::From<TransferAndCallWithToAndAmountCall> for IERC1363Calls {
fn from(value: TransferAndCallWithToAndAmountCall) -> Self {
Self::TransferAndCallWithToAndAmount(value)
}
}
impl ::core::convert::From<TransferFromCall> for IERC1363Calls {
fn from(value: TransferFromCall) -> Self {
Self::TransferFrom(value)
}
}
impl ::core::convert::From<TransferFromAndCallWithFromAndToAndDataCall>
for IERC1363Calls {
fn from(value: TransferFromAndCallWithFromAndToAndDataCall) -> Self {
Self::TransferFromAndCallWithFromAndToAndData(value)
}
}
impl ::core::convert::From<TransferFromAndCallCall> for IERC1363Calls {
fn from(value: TransferFromAndCallCall) -> Self {
Self::TransferFromAndCall(value)
}
}
///Container type for all return fields from the `allowance` function with signature `allowance(address,address)` and selector `0xdd62ed3e`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct AllowanceReturn(pub ::ethers_core::types::U256);
///Container type for all return fields from the `approve` function with signature `approve(address,uint256)` and selector `0x095ea7b3`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct ApproveReturn(pub bool);
///Container type for all return fields from the `approveAndCall` function with signature `approveAndCall(address,uint256)` and selector `0x3177029f`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct ApproveAndCallReturn(pub bool);
///Container type for all return fields from the `approveAndCall` function with signature `approveAndCall(address,uint256,bytes)` and selector `0xcae9ca51`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct ApproveAndCallWithSpenderAndAmountReturn(pub bool);
///Container type for all return fields from the `balanceOf` function with signature `balanceOf(address)` and selector `0x70a08231`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct BalanceOfReturn(pub ::ethers_core::types::U256);
///Container type for all return fields from the `supportsInterface` function with signature `supportsInterface(bytes4)` and selector `0x01ffc9a7`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct SupportsInterfaceReturn(pub bool);
///Container type for all return fields from the `totalSupply` function with signature `totalSupply()` and selector `0x18160ddd`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct TotalSupplyReturn(pub ::ethers_core::types::U256);
///Container type for all return fields from the `transfer` function with signature `transfer(address,uint256)` and selector `0xa9059cbb`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct TransferReturn(pub bool);
///Container type for all return fields from the `transferAndCall` function with signature `transferAndCall(address,uint256)` and selector `0x1296ee62`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct TransferAndCallReturn(pub bool);
///Container type for all return fields from the `transferAndCall` function with signature `transferAndCall(address,uint256,bytes)` and selector `0x4000aea0`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct TransferAndCallWithToAndAmountReturn(pub bool);
///Container type for all return fields from the `transferFrom` function with signature `transferFrom(address,address,uint256)` and selector `0x23b872dd`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct TransferFromReturn(pub bool);
///Container type for all return fields from the `transferFromAndCall` function with signature `transferFromAndCall(address,address,uint256,bytes)` and selector `0xc1d34b89`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct TransferFromAndCallWithFromAndToAndDataReturn(pub bool);
///Container type for all return fields from the `transferFromAndCall` function with signature `transferFromAndCall(address,address,uint256)` and selector `0xd8fbe994`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct TransferFromAndCallReturn(pub bool);
}