#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style,
clippy::empty_structs_with_brackets
)]
pub mod ERC1155Holder {
use super::*;
use alloy::sol_types as alloy_sol_types;
#[rustfmt::skip]
#[allow(clippy::all)]
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
b"",
);
#[rustfmt::skip]
#[allow(clippy::all)]
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
b"",
);
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct onERC1155BatchReceivedCall {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::Address,
#[allow(missing_docs)]
pub _1: alloy::sol_types::private::Address,
#[allow(missing_docs)]
pub _2: alloy::sol_types::private::Vec<
alloy::sol_types::private::primitives::aliases::U256,
>,
#[allow(missing_docs)]
pub _3: alloy::sol_types::private::Vec<
alloy::sol_types::private::primitives::aliases::U256,
>,
#[allow(missing_docs)]
pub _4: alloy::sol_types::private::Bytes,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct onERC1155BatchReceivedReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::FixedBytes<4>,
}
#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style
)]
const _: () = {
use alloy::sol_types as alloy_sol_types;
{
#[doc(hidden)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (
alloy::sol_types::sol_data::Address,
alloy::sol_types::sol_data::Address,
alloy::sol_types::sol_data::Array<alloy::sol_types::sol_data::Uint<256>>,
alloy::sol_types::sol_data::Array<alloy::sol_types::sol_data::Uint<256>>,
alloy::sol_types::sol_data::Bytes,
);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
alloy::sol_types::private::Address,
alloy::sol_types::private::Address,
alloy::sol_types::private::Vec<
alloy::sol_types::private::primitives::aliases::U256,
>,
alloy::sol_types::private::Vec<
alloy::sol_types::private::primitives::aliases::U256,
>,
alloy::sol_types::private::Bytes,
);
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(
_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<onERC1155BatchReceivedCall>
for UnderlyingRustTuple<'_> {
fn from(value: onERC1155BatchReceivedCall) -> Self {
(value._0, value._1, value._2, value._3, value._4)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for onERC1155BatchReceivedCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self {
_0: tuple.0,
_1: tuple.1,
_2: tuple.2,
_3: tuple.3,
_4: tuple.4,
}
}
}
}
{
#[doc(hidden)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<4>,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<4>,);
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(
_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<onERC1155BatchReceivedReturn>
for UnderlyingRustTuple<'_> {
fn from(value: onERC1155BatchReceivedReturn) -> Self {
(value._0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for onERC1155BatchReceivedReturn {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { _0: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for onERC1155BatchReceivedCall {
type Parameters<'a> = (
alloy::sol_types::sol_data::Address,
alloy::sol_types::sol_data::Address,
alloy::sol_types::sol_data::Array<alloy::sol_types::sol_data::Uint<256>>,
alloy::sol_types::sol_data::Array<alloy::sol_types::sol_data::Uint<256>>,
alloy::sol_types::sol_data::Bytes,
);
type Token<'a> = <Self::Parameters<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
type Return = alloy::sol_types::private::FixedBytes<4>;
type ReturnTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<4>,);
type ReturnToken<'a> = <Self::ReturnTuple<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)";
const SELECTOR: [u8; 4] = [188u8, 25u8, 124u8, 129u8];
#[inline]
fn new<'a>(
tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
) -> Self {
tuple.into()
}
#[inline]
fn tokenize(&self) -> Self::Token<'_> {
(
<alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
&self._0,
),
<alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
&self._1,
),
<alloy::sol_types::sol_data::Array<
alloy::sol_types::sol_data::Uint<256>,
> as alloy_sol_types::SolType>::tokenize(&self._2),
<alloy::sol_types::sol_data::Array<
alloy::sol_types::sol_data::Uint<256>,
> as alloy_sol_types::SolType>::tokenize(&self._3),
<alloy::sol_types::sol_data::Bytes as alloy_sol_types::SolType>::tokenize(
&self._4,
),
)
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
(
<alloy::sol_types::sol_data::FixedBytes<
4,
> as alloy_sol_types::SolType>::tokenize(ret),
)
}
#[inline]
fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<
'_,
> as alloy_sol_types::SolType>::abi_decode_sequence(data)
.map(|r| {
let r: onERC1155BatchReceivedReturn = r.into();
r._0
})
}
#[inline]
fn abi_decode_returns_validate(
data: &[u8],
) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<
'_,
> as alloy_sol_types::SolType>::abi_decode_sequence_validate(data)
.map(|r| {
let r: onERC1155BatchReceivedReturn = r.into();
r._0
})
}
}
};
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct onERC1155ReceivedCall {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::Address,
#[allow(missing_docs)]
pub _1: alloy::sol_types::private::Address,
#[allow(missing_docs)]
pub _2: alloy::sol_types::private::primitives::aliases::U256,
#[allow(missing_docs)]
pub _3: alloy::sol_types::private::primitives::aliases::U256,
#[allow(missing_docs)]
pub _4: alloy::sol_types::private::Bytes,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct onERC1155ReceivedReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::FixedBytes<4>,
}
#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style
)]
const _: () = {
use alloy::sol_types as alloy_sol_types;
{
#[doc(hidden)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (
alloy::sol_types::sol_data::Address,
alloy::sol_types::sol_data::Address,
alloy::sol_types::sol_data::Uint<256>,
alloy::sol_types::sol_data::Uint<256>,
alloy::sol_types::sol_data::Bytes,
);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
alloy::sol_types::private::Address,
alloy::sol_types::private::Address,
alloy::sol_types::private::primitives::aliases::U256,
alloy::sol_types::private::primitives::aliases::U256,
alloy::sol_types::private::Bytes,
);
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(
_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<onERC1155ReceivedCall>
for UnderlyingRustTuple<'_> {
fn from(value: onERC1155ReceivedCall) -> Self {
(value._0, value._1, value._2, value._3, value._4)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for onERC1155ReceivedCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self {
_0: tuple.0,
_1: tuple.1,
_2: tuple.2,
_3: tuple.3,
_4: tuple.4,
}
}
}
}
{
#[doc(hidden)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<4>,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<4>,);
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(
_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<onERC1155ReceivedReturn>
for UnderlyingRustTuple<'_> {
fn from(value: onERC1155ReceivedReturn) -> Self {
(value._0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for onERC1155ReceivedReturn {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { _0: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for onERC1155ReceivedCall {
type Parameters<'a> = (
alloy::sol_types::sol_data::Address,
alloy::sol_types::sol_data::Address,
alloy::sol_types::sol_data::Uint<256>,
alloy::sol_types::sol_data::Uint<256>,
alloy::sol_types::sol_data::Bytes,
);
type Token<'a> = <Self::Parameters<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
type Return = alloy::sol_types::private::FixedBytes<4>;
type ReturnTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<4>,);
type ReturnToken<'a> = <Self::ReturnTuple<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "onERC1155Received(address,address,uint256,uint256,bytes)";
const SELECTOR: [u8; 4] = [242u8, 58u8, 110u8, 97u8];
#[inline]
fn new<'a>(
tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
) -> Self {
tuple.into()
}
#[inline]
fn tokenize(&self) -> Self::Token<'_> {
(
<alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
&self._0,
),
<alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
&self._1,
),
<alloy::sol_types::sol_data::Uint<
256,
> as alloy_sol_types::SolType>::tokenize(&self._2),
<alloy::sol_types::sol_data::Uint<
256,
> as alloy_sol_types::SolType>::tokenize(&self._3),
<alloy::sol_types::sol_data::Bytes as alloy_sol_types::SolType>::tokenize(
&self._4,
),
)
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
(
<alloy::sol_types::sol_data::FixedBytes<
4,
> as alloy_sol_types::SolType>::tokenize(ret),
)
}
#[inline]
fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<
'_,
> as alloy_sol_types::SolType>::abi_decode_sequence(data)
.map(|r| {
let r: onERC1155ReceivedReturn = r.into();
r._0
})
}
#[inline]
fn abi_decode_returns_validate(
data: &[u8],
) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<
'_,
> as alloy_sol_types::SolType>::abi_decode_sequence_validate(data)
.map(|r| {
let r: onERC1155ReceivedReturn = r.into();
r._0
})
}
}
};
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct supportsInterfaceCall {
#[allow(missing_docs)]
pub interfaceId: alloy::sol_types::private::FixedBytes<4>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct supportsInterfaceReturn {
#[allow(missing_docs)]
pub _0: bool,
}
#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style
)]
const _: () = {
use alloy::sol_types as alloy_sol_types;
{
#[doc(hidden)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<4>,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<4>,);
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(
_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<supportsInterfaceCall>
for UnderlyingRustTuple<'_> {
fn from(value: supportsInterfaceCall) -> Self {
(value.interfaceId,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for supportsInterfaceCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { interfaceId: tuple.0 }
}
}
}
{
#[doc(hidden)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Bool,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (bool,);
#[cfg(test)]
#[allow(dead_code, unreachable_patterns)]
fn _type_assertion(
_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
) {
match _t {
alloy_sol_types::private::AssertTypeEq::<
<UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
>(_) => {}
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<supportsInterfaceReturn>
for UnderlyingRustTuple<'_> {
fn from(value: supportsInterfaceReturn) -> Self {
(value._0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for supportsInterfaceReturn {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { _0: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for supportsInterfaceCall {
type Parameters<'a> = (alloy::sol_types::sol_data::FixedBytes<4>,);
type Token<'a> = <Self::Parameters<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
type Return = bool;
type ReturnTuple<'a> = (alloy::sol_types::sol_data::Bool,);
type ReturnToken<'a> = <Self::ReturnTuple<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "supportsInterface(bytes4)";
const SELECTOR: [u8; 4] = [1u8, 255u8, 201u8, 167u8];
#[inline]
fn new<'a>(
tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
) -> Self {
tuple.into()
}
#[inline]
fn tokenize(&self) -> Self::Token<'_> {
(
<alloy::sol_types::sol_data::FixedBytes<
4,
> as alloy_sol_types::SolType>::tokenize(&self.interfaceId),
)
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
(
<alloy::sol_types::sol_data::Bool as alloy_sol_types::SolType>::tokenize(
ret,
),
)
}
#[inline]
fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<
'_,
> as alloy_sol_types::SolType>::abi_decode_sequence(data)
.map(|r| {
let r: supportsInterfaceReturn = r.into();
r._0
})
}
#[inline]
fn abi_decode_returns_validate(
data: &[u8],
) -> alloy_sol_types::Result<Self::Return> {
<Self::ReturnTuple<
'_,
> as alloy_sol_types::SolType>::abi_decode_sequence_validate(data)
.map(|r| {
let r: supportsInterfaceReturn = r.into();
r._0
})
}
}
};
#[derive(Clone)]
#[derive(serde::Serialize, serde::Deserialize)]
#[derive()]
pub enum ERC1155HolderCalls {
#[allow(missing_docs)]
onERC1155BatchReceived(onERC1155BatchReceivedCall),
#[allow(missing_docs)]
onERC1155Received(onERC1155ReceivedCall),
#[allow(missing_docs)]
supportsInterface(supportsInterfaceCall),
}
impl ERC1155HolderCalls {
pub const SELECTORS: &'static [[u8; 4usize]] = &[
[1u8, 255u8, 201u8, 167u8],
[188u8, 25u8, 124u8, 129u8],
[242u8, 58u8, 110u8, 97u8],
];
pub const VARIANT_NAMES: &'static [&'static str] = &[
::core::stringify!(supportsInterface),
::core::stringify!(onERC1155BatchReceived),
::core::stringify!(onERC1155Received),
];
pub const SIGNATURES: &'static [&'static str] = &[
<supportsInterfaceCall as alloy_sol_types::SolCall>::SIGNATURE,
<onERC1155BatchReceivedCall as alloy_sol_types::SolCall>::SIGNATURE,
<onERC1155ReceivedCall as alloy_sol_types::SolCall>::SIGNATURE,
];
#[inline]
pub fn signature_by_selector(
selector: [u8; 4usize],
) -> ::core::option::Option<&'static str> {
match Self::SELECTORS.binary_search(&selector) {
::core::result::Result::Ok(idx) => {
::core::option::Option::Some(Self::SIGNATURES[idx])
}
::core::result::Result::Err(_) => ::core::option::Option::None,
}
}
#[inline]
pub fn name_by_selector(
selector: [u8; 4usize],
) -> ::core::option::Option<&'static str> {
let sig = Self::signature_by_selector(selector)?;
sig.split_once('(').map(|(name, _)| name)
}
}
#[automatically_derived]
impl alloy_sol_types::SolInterface for ERC1155HolderCalls {
const NAME: &'static str = "ERC1155HolderCalls";
const MIN_DATA_LENGTH: usize = 32usize;
const COUNT: usize = 3usize;
#[inline]
fn selector(&self) -> [u8; 4] {
match self {
Self::onERC1155BatchReceived(_) => {
<onERC1155BatchReceivedCall as alloy_sol_types::SolCall>::SELECTOR
}
Self::onERC1155Received(_) => {
<onERC1155ReceivedCall as alloy_sol_types::SolCall>::SELECTOR
}
Self::supportsInterface(_) => {
<supportsInterfaceCall as alloy_sol_types::SolCall>::SELECTOR
}
}
}
#[inline]
fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> {
Self::SELECTORS.get(i).copied()
}
#[inline]
fn valid_selector(selector: [u8; 4]) -> bool {
Self::SELECTORS.binary_search(&selector).is_ok()
}
#[inline]
#[allow(non_snake_case)]
fn abi_decode_raw(
selector: [u8; 4],
data: &[u8],
) -> alloy_sol_types::Result<Self> {
static DECODE_SHIMS: &[fn(
&[u8],
) -> alloy_sol_types::Result<ERC1155HolderCalls>] = &[
{
fn supportsInterface(
data: &[u8],
) -> alloy_sol_types::Result<ERC1155HolderCalls> {
<supportsInterfaceCall as alloy_sol_types::SolCall>::abi_decode_raw(
data,
)
.map(ERC1155HolderCalls::supportsInterface)
}
supportsInterface
},
{
fn onERC1155BatchReceived(
data: &[u8],
) -> alloy_sol_types::Result<ERC1155HolderCalls> {
<onERC1155BatchReceivedCall as alloy_sol_types::SolCall>::abi_decode_raw(
data,
)
.map(ERC1155HolderCalls::onERC1155BatchReceived)
}
onERC1155BatchReceived
},
{
fn onERC1155Received(
data: &[u8],
) -> alloy_sol_types::Result<ERC1155HolderCalls> {
<onERC1155ReceivedCall as alloy_sol_types::SolCall>::abi_decode_raw(
data,
)
.map(ERC1155HolderCalls::onERC1155Received)
}
onERC1155Received
},
];
let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
return Err(
alloy_sol_types::Error::unknown_selector(
<Self as alloy_sol_types::SolInterface>::NAME,
selector,
),
);
};
DECODE_SHIMS[idx](data)
}
#[inline]
#[allow(non_snake_case)]
fn abi_decode_raw_validate(
selector: [u8; 4],
data: &[u8],
) -> alloy_sol_types::Result<Self> {
static DECODE_VALIDATE_SHIMS: &[fn(
&[u8],
) -> alloy_sol_types::Result<ERC1155HolderCalls>] = &[
{
fn supportsInterface(
data: &[u8],
) -> alloy_sol_types::Result<ERC1155HolderCalls> {
<supportsInterfaceCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(ERC1155HolderCalls::supportsInterface)
}
supportsInterface
},
{
fn onERC1155BatchReceived(
data: &[u8],
) -> alloy_sol_types::Result<ERC1155HolderCalls> {
<onERC1155BatchReceivedCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(ERC1155HolderCalls::onERC1155BatchReceived)
}
onERC1155BatchReceived
},
{
fn onERC1155Received(
data: &[u8],
) -> alloy_sol_types::Result<ERC1155HolderCalls> {
<onERC1155ReceivedCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(ERC1155HolderCalls::onERC1155Received)
}
onERC1155Received
},
];
let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
return Err(
alloy_sol_types::Error::unknown_selector(
<Self as alloy_sol_types::SolInterface>::NAME,
selector,
),
);
};
DECODE_VALIDATE_SHIMS[idx](data)
}
#[inline]
fn abi_encoded_size(&self) -> usize {
match self {
Self::onERC1155BatchReceived(inner) => {
<onERC1155BatchReceivedCall as alloy_sol_types::SolCall>::abi_encoded_size(
inner,
)
}
Self::onERC1155Received(inner) => {
<onERC1155ReceivedCall as alloy_sol_types::SolCall>::abi_encoded_size(
inner,
)
}
Self::supportsInterface(inner) => {
<supportsInterfaceCall as alloy_sol_types::SolCall>::abi_encoded_size(
inner,
)
}
}
}
#[inline]
fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
match self {
Self::onERC1155BatchReceived(inner) => {
<onERC1155BatchReceivedCall as alloy_sol_types::SolCall>::abi_encode_raw(
inner,
out,
)
}
Self::onERC1155Received(inner) => {
<onERC1155ReceivedCall as alloy_sol_types::SolCall>::abi_encode_raw(
inner,
out,
)
}
Self::supportsInterface(inner) => {
<supportsInterfaceCall as alloy_sol_types::SolCall>::abi_encode_raw(
inner,
out,
)
}
}
}
}
use alloy::contract as alloy_contract;
#[inline]
pub const fn new<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
>(
address: alloy_sol_types::private::Address,
__provider: P,
) -> ERC1155HolderInstance<P, N> {
ERC1155HolderInstance::<P, N>::new(address, __provider)
}
#[inline]
pub fn deploy<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
>(
__provider: P,
) -> impl ::core::future::Future<
Output = alloy_contract::Result<ERC1155HolderInstance<P, N>>,
> {
ERC1155HolderInstance::<P, N>::deploy(__provider)
}
#[inline]
pub fn deploy_builder<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
>(__provider: P) -> alloy_contract::RawCallBuilder<P, N> {
ERC1155HolderInstance::<P, N>::deploy_builder(__provider)
}
#[derive(Clone)]
pub struct ERC1155HolderInstance<P, N = alloy_contract::private::Ethereum> {
address: alloy_sol_types::private::Address,
provider: P,
_network: ::core::marker::PhantomData<N>,
}
#[automatically_derived]
impl<P, N> ::core::fmt::Debug for ERC1155HolderInstance<P, N> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("ERC1155HolderInstance").field(&self.address).finish()
}
}
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> ERC1155HolderInstance<P, N> {
#[inline]
pub const fn new(
address: alloy_sol_types::private::Address,
__provider: P,
) -> Self {
Self {
address,
provider: __provider,
_network: ::core::marker::PhantomData,
}
}
#[inline]
pub async fn deploy(
__provider: P,
) -> alloy_contract::Result<ERC1155HolderInstance<P, N>> {
let call_builder = Self::deploy_builder(__provider);
let contract_address = call_builder.deploy().await?;
Ok(Self::new(contract_address, call_builder.provider))
}
#[inline]
pub fn deploy_builder(__provider: P) -> alloy_contract::RawCallBuilder<P, N> {
alloy_contract::RawCallBuilder::new_raw_deploy(
__provider,
::core::clone::Clone::clone(&BYTECODE),
)
}
#[inline]
pub const fn address(&self) -> &alloy_sol_types::private::Address {
&self.address
}
#[inline]
pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
self.address = address;
}
pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
self.set_address(address);
self
}
#[inline]
pub const fn provider(&self) -> &P {
&self.provider
}
}
impl<P: ::core::clone::Clone, N> ERC1155HolderInstance<&P, N> {
#[inline]
pub fn with_cloned_provider(self) -> ERC1155HolderInstance<P, N> {
ERC1155HolderInstance {
address: self.address,
provider: ::core::clone::Clone::clone(&self.provider),
_network: ::core::marker::PhantomData,
}
}
}
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> ERC1155HolderInstance<P, N> {
pub fn call_builder<C: alloy_sol_types::SolCall>(
&self,
call: &C,
) -> alloy_contract::SolCallBuilder<&P, C, N> {
alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
}
pub fn onERC1155BatchReceived(
&self,
_0: alloy::sol_types::private::Address,
_1: alloy::sol_types::private::Address,
_2: alloy::sol_types::private::Vec<
alloy::sol_types::private::primitives::aliases::U256,
>,
_3: alloy::sol_types::private::Vec<
alloy::sol_types::private::primitives::aliases::U256,
>,
_4: alloy::sol_types::private::Bytes,
) -> alloy_contract::SolCallBuilder<&P, onERC1155BatchReceivedCall, N> {
self.call_builder(
&onERC1155BatchReceivedCall {
_0,
_1,
_2,
_3,
_4,
},
)
}
pub fn onERC1155Received(
&self,
_0: alloy::sol_types::private::Address,
_1: alloy::sol_types::private::Address,
_2: alloy::sol_types::private::primitives::aliases::U256,
_3: alloy::sol_types::private::primitives::aliases::U256,
_4: alloy::sol_types::private::Bytes,
) -> alloy_contract::SolCallBuilder<&P, onERC1155ReceivedCall, N> {
self.call_builder(
&onERC1155ReceivedCall {
_0,
_1,
_2,
_3,
_4,
},
)
}
pub fn supportsInterface(
&self,
interfaceId: alloy::sol_types::private::FixedBytes<4>,
) -> alloy_contract::SolCallBuilder<&P, supportsInterfaceCall, N> {
self.call_builder(
&supportsInterfaceCall {
interfaceId,
},
)
}
}
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> ERC1155HolderInstance<P, N> {
pub fn event_filter<E: alloy_sol_types::SolEvent>(
&self,
) -> alloy_contract::Event<&P, E, N> {
alloy_contract::Event::new_sol(&self.provider, &self.address)
}
}
}