pub use ierc4906::*;
/// 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 ierc4906 {
#[rustfmt::skip]
const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"Approval\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"ApprovalForAll\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_fromTokenId\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"uint256\",\"name\":\"_toTokenId\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"BatchMetadataUpdate\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"MetadataUpdate\",\"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\":\"tokenId\",\"type\":\"uint256\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"Transfer\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"approve\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"safeTransferFrom\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"safeTransferFrom\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"setApprovalForAll\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"supportsInterface\",\"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\":\"tokenId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transferFrom\",\"outputs\":[]}]";
///The parsed JSON ABI of the contract.
pub static IERC4906_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 IERC4906<M>(::ethers_contract::Contract<M>);
impl<M> ::core::clone::Clone for IERC4906<M> {
fn clone(&self) -> Self {
Self(::core::clone::Clone::clone(&self.0))
}
}
impl<M> ::core::ops::Deref for IERC4906<M> {
type Target = ::ethers_contract::Contract<M>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<M> ::core::ops::DerefMut for IERC4906<M> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl<M> ::core::fmt::Debug for IERC4906<M> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple(stringify!(IERC4906)).field(&self.address()).finish()
}
}
impl<M: ::ethers_providers::Middleware> IERC4906<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(),
IERC4906_ABI.clone(),
client,
),
)
}
///Calls the contract's `approve` (0x095ea7b3) function
pub fn approve(
&self,
to: ::ethers_core::types::Address,
token_id: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([9, 94, 167, 179], (to, token_id))
.expect("method not found (this should never happen)")
}
///Calls the contract's `balanceOf` (0x70a08231) function
pub fn balance_of(
&self,
owner: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
self.0
.method_hash([112, 160, 130, 49], owner)
.expect("method not found (this should never happen)")
}
///Calls the contract's `getApproved` (0x081812fc) function
pub fn get_approved(
&self,
token_id: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<
M,
::ethers_core::types::Address,
> {
self.0
.method_hash([8, 24, 18, 252], token_id)
.expect("method not found (this should never happen)")
}
///Calls the contract's `isApprovedForAll` (0xe985e9c5) function
pub fn is_approved_for_all(
&self,
owner: ::ethers_core::types::Address,
operator: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([233, 133, 233, 197], (owner, operator))
.expect("method not found (this should never happen)")
}
///Calls the contract's `ownerOf` (0x6352211e) function
pub fn owner_of(
&self,
token_id: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<
M,
::ethers_core::types::Address,
> {
self.0
.method_hash([99, 82, 33, 30], token_id)
.expect("method not found (this should never happen)")
}
///Calls the contract's `safeTransferFrom` (0x42842e0e) function
pub fn safe_transfer_from(
&self,
from: ::ethers_core::types::Address,
to: ::ethers_core::types::Address,
token_id: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([66, 132, 46, 14], (from, to, token_id))
.expect("method not found (this should never happen)")
}
///Calls the contract's `safeTransferFrom` (0xb88d4fde) function
pub fn safe_transfer_from_with_from_and_to_and_data(
&self,
from: ::ethers_core::types::Address,
to: ::ethers_core::types::Address,
token_id: ::ethers_core::types::U256,
data: ::ethers_core::types::Bytes,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([184, 141, 79, 222], (from, to, token_id, data))
.expect("method not found (this should never happen)")
}
///Calls the contract's `setApprovalForAll` (0xa22cb465) function
pub fn set_approval_for_all(
&self,
operator: ::ethers_core::types::Address,
approved: bool,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([162, 44, 180, 101], (operator, approved))
.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 `transferFrom` (0x23b872dd) function
pub fn transfer_from(
&self,
from: ::ethers_core::types::Address,
to: ::ethers_core::types::Address,
token_id: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([35, 184, 114, 221], (from, to, token_id))
.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 `ApprovalForAll` event
pub fn approval_for_all_filter(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
ApprovalForAllFilter,
> {
self.0.event()
}
///Gets the contract's `BatchMetadataUpdate` event
pub fn batch_metadata_update_filter(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
BatchMetadataUpdateFilter,
> {
self.0.event()
}
///Gets the contract's `MetadataUpdate` event
pub fn metadata_update_filter(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
MetadataUpdateFilter,
> {
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, IERC4906Events> {
self.0.event_with_filter(::core::default::Default::default())
}
}
impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
for IERC4906<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 approved: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub token_id: ::ethers_core::types::U256,
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(name = "ApprovalForAll", abi = "ApprovalForAll(address,address,bool)")]
pub struct ApprovalForAllFilter {
#[ethevent(indexed)]
pub owner: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub operator: ::ethers_core::types::Address,
pub approved: bool,
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(
name = "BatchMetadataUpdate",
abi = "BatchMetadataUpdate(uint256,uint256)"
)]
pub struct BatchMetadataUpdateFilter {
pub from_token_id: ::ethers_core::types::U256,
pub to_token_id: ::ethers_core::types::U256,
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(name = "MetadataUpdate", abi = "MetadataUpdate(uint256)")]
pub struct MetadataUpdateFilter {
pub token_id: ::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,
#[ethevent(indexed)]
pub token_id: ::ethers_core::types::U256,
}
///Container type for all of the contract's events
#[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum IERC4906Events {
ApprovalFilter(ApprovalFilter),
ApprovalForAllFilter(ApprovalForAllFilter),
BatchMetadataUpdateFilter(BatchMetadataUpdateFilter),
MetadataUpdateFilter(MetadataUpdateFilter),
TransferFilter(TransferFilter),
}
impl ::ethers_contract::EthLogDecode for IERC4906Events {
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(IERC4906Events::ApprovalFilter(decoded));
}
if let Ok(decoded) = ApprovalForAllFilter::decode_log(log) {
return Ok(IERC4906Events::ApprovalForAllFilter(decoded));
}
if let Ok(decoded) = BatchMetadataUpdateFilter::decode_log(log) {
return Ok(IERC4906Events::BatchMetadataUpdateFilter(decoded));
}
if let Ok(decoded) = MetadataUpdateFilter::decode_log(log) {
return Ok(IERC4906Events::MetadataUpdateFilter(decoded));
}
if let Ok(decoded) = TransferFilter::decode_log(log) {
return Ok(IERC4906Events::TransferFilter(decoded));
}
Err(::ethers_core::abi::Error::InvalidData)
}
}
impl ::core::fmt::Display for IERC4906Events {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::ApprovalFilter(element) => ::core::fmt::Display::fmt(element, f),
Self::ApprovalForAllFilter(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::BatchMetadataUpdateFilter(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::MetadataUpdateFilter(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::TransferFilter(element) => ::core::fmt::Display::fmt(element, f),
}
}
}
impl ::core::convert::From<ApprovalFilter> for IERC4906Events {
fn from(value: ApprovalFilter) -> Self {
Self::ApprovalFilter(value)
}
}
impl ::core::convert::From<ApprovalForAllFilter> for IERC4906Events {
fn from(value: ApprovalForAllFilter) -> Self {
Self::ApprovalForAllFilter(value)
}
}
impl ::core::convert::From<BatchMetadataUpdateFilter> for IERC4906Events {
fn from(value: BatchMetadataUpdateFilter) -> Self {
Self::BatchMetadataUpdateFilter(value)
}
}
impl ::core::convert::From<MetadataUpdateFilter> for IERC4906Events {
fn from(value: MetadataUpdateFilter) -> Self {
Self::MetadataUpdateFilter(value)
}
}
impl ::core::convert::From<TransferFilter> for IERC4906Events {
fn from(value: TransferFilter) -> Self {
Self::TransferFilter(value)
}
}
///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 to: ::ethers_core::types::Address,
pub token_id: ::ethers_core::types::U256,
}
///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 owner: ::ethers_core::types::Address,
}
///Container type for all input parameters for the `getApproved` function with signature `getApproved(uint256)` and selector `0x081812fc`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "getApproved", abi = "getApproved(uint256)")]
pub struct GetApprovedCall {
pub token_id: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `isApprovedForAll` function with signature `isApprovedForAll(address,address)` and selector `0xe985e9c5`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "isApprovedForAll", abi = "isApprovedForAll(address,address)")]
pub struct IsApprovedForAllCall {
pub owner: ::ethers_core::types::Address,
pub operator: ::ethers_core::types::Address,
}
///Container type for all input parameters for the `ownerOf` function with signature `ownerOf(uint256)` and selector `0x6352211e`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "ownerOf", abi = "ownerOf(uint256)")]
pub struct OwnerOfCall {
pub token_id: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `safeTransferFrom` function with signature `safeTransferFrom(address,address,uint256)` and selector `0x42842e0e`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(
name = "safeTransferFrom",
abi = "safeTransferFrom(address,address,uint256)"
)]
pub struct SafeTransferFromCall {
pub from: ::ethers_core::types::Address,
pub to: ::ethers_core::types::Address,
pub token_id: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `safeTransferFrom` function with signature `safeTransferFrom(address,address,uint256,bytes)` and selector `0xb88d4fde`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(
name = "safeTransferFrom",
abi = "safeTransferFrom(address,address,uint256,bytes)"
)]
pub struct SafeTransferFromWithFromAndToAndDataCall {
pub from: ::ethers_core::types::Address,
pub to: ::ethers_core::types::Address,
pub token_id: ::ethers_core::types::U256,
pub data: ::ethers_core::types::Bytes,
}
///Container type for all input parameters for the `setApprovalForAll` function with signature `setApprovalForAll(address,bool)` and selector `0xa22cb465`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "setApprovalForAll", abi = "setApprovalForAll(address,bool)")]
pub struct SetApprovalForAllCall {
pub operator: ::ethers_core::types::Address,
pub approved: bool,
}
///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 `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 token_id: ::ethers_core::types::U256,
}
///Container type for all of the contract's call
#[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum IERC4906Calls {
Approve(ApproveCall),
BalanceOf(BalanceOfCall),
GetApproved(GetApprovedCall),
IsApprovedForAll(IsApprovedForAllCall),
OwnerOf(OwnerOfCall),
SafeTransferFrom(SafeTransferFromCall),
SafeTransferFromWithFromAndToAndData(SafeTransferFromWithFromAndToAndDataCall),
SetApprovalForAll(SetApprovalForAllCall),
SupportsInterface(SupportsInterfaceCall),
TransferFrom(TransferFromCall),
}
impl ::ethers_core::abi::AbiDecode for IERC4906Calls {
fn decode(
data: impl AsRef<[u8]>,
) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
let data = data.as_ref();
if let Ok(decoded)
= <ApproveCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Approve(decoded));
}
if let Ok(decoded)
= <BalanceOfCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::BalanceOf(decoded));
}
if let Ok(decoded)
= <GetApprovedCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::GetApproved(decoded));
}
if let Ok(decoded)
= <IsApprovedForAllCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::IsApprovedForAll(decoded));
}
if let Ok(decoded)
= <OwnerOfCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::OwnerOf(decoded));
}
if let Ok(decoded)
= <SafeTransferFromCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::SafeTransferFrom(decoded));
}
if let Ok(decoded)
= <SafeTransferFromWithFromAndToAndDataCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::SafeTransferFromWithFromAndToAndData(decoded));
}
if let Ok(decoded)
= <SetApprovalForAllCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::SetApprovalForAll(decoded));
}
if let Ok(decoded)
= <SupportsInterfaceCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::SupportsInterface(decoded));
}
if let Ok(decoded)
= <TransferFromCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::TransferFrom(decoded));
}
Err(::ethers_core::abi::Error::InvalidData.into())
}
}
impl ::ethers_core::abi::AbiEncode for IERC4906Calls {
fn encode(self) -> Vec<u8> {
match self {
Self::Approve(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::BalanceOf(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::GetApproved(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::IsApprovedForAll(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::OwnerOf(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::SafeTransferFrom(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::SafeTransferFromWithFromAndToAndData(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::SetApprovalForAll(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::SupportsInterface(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::TransferFrom(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
}
}
}
impl ::core::fmt::Display for IERC4906Calls {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::Approve(element) => ::core::fmt::Display::fmt(element, f),
Self::BalanceOf(element) => ::core::fmt::Display::fmt(element, f),
Self::GetApproved(element) => ::core::fmt::Display::fmt(element, f),
Self::IsApprovedForAll(element) => ::core::fmt::Display::fmt(element, f),
Self::OwnerOf(element) => ::core::fmt::Display::fmt(element, f),
Self::SafeTransferFrom(element) => ::core::fmt::Display::fmt(element, f),
Self::SafeTransferFromWithFromAndToAndData(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::SetApprovalForAll(element) => ::core::fmt::Display::fmt(element, f),
Self::SupportsInterface(element) => ::core::fmt::Display::fmt(element, f),
Self::TransferFrom(element) => ::core::fmt::Display::fmt(element, f),
}
}
}
impl ::core::convert::From<ApproveCall> for IERC4906Calls {
fn from(value: ApproveCall) -> Self {
Self::Approve(value)
}
}
impl ::core::convert::From<BalanceOfCall> for IERC4906Calls {
fn from(value: BalanceOfCall) -> Self {
Self::BalanceOf(value)
}
}
impl ::core::convert::From<GetApprovedCall> for IERC4906Calls {
fn from(value: GetApprovedCall) -> Self {
Self::GetApproved(value)
}
}
impl ::core::convert::From<IsApprovedForAllCall> for IERC4906Calls {
fn from(value: IsApprovedForAllCall) -> Self {
Self::IsApprovedForAll(value)
}
}
impl ::core::convert::From<OwnerOfCall> for IERC4906Calls {
fn from(value: OwnerOfCall) -> Self {
Self::OwnerOf(value)
}
}
impl ::core::convert::From<SafeTransferFromCall> for IERC4906Calls {
fn from(value: SafeTransferFromCall) -> Self {
Self::SafeTransferFrom(value)
}
}
impl ::core::convert::From<SafeTransferFromWithFromAndToAndDataCall>
for IERC4906Calls {
fn from(value: SafeTransferFromWithFromAndToAndDataCall) -> Self {
Self::SafeTransferFromWithFromAndToAndData(value)
}
}
impl ::core::convert::From<SetApprovalForAllCall> for IERC4906Calls {
fn from(value: SetApprovalForAllCall) -> Self {
Self::SetApprovalForAll(value)
}
}
impl ::core::convert::From<SupportsInterfaceCall> for IERC4906Calls {
fn from(value: SupportsInterfaceCall) -> Self {
Self::SupportsInterface(value)
}
}
impl ::core::convert::From<TransferFromCall> for IERC4906Calls {
fn from(value: TransferFromCall) -> Self {
Self::TransferFrom(value)
}
}
///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 balance: ::ethers_core::types::U256,
}
///Container type for all return fields from the `getApproved` function with signature `getApproved(uint256)` and selector `0x081812fc`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct GetApprovedReturn {
pub operator: ::ethers_core::types::Address,
}
///Container type for all return fields from the `isApprovedForAll` function with signature `isApprovedForAll(address,address)` and selector `0xe985e9c5`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct IsApprovedForAllReturn(pub bool);
///Container type for all return fields from the `ownerOf` function with signature `ownerOf(uint256)` and selector `0x6352211e`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct OwnerOfReturn {
pub owner: ::ethers_core::types::Address,
}
///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);
}