#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style,
clippy::empty_structs_with_brackets
)]
pub mod IAuthorityFactory {
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,
clippy::style
)]
#[derive(Clone)]
pub struct AuthorityCreated {
#[allow(missing_docs)]
pub authority: alloy::sol_types::private::Address,
}
#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style
)]
const _: () = {
use alloy::sol_types as alloy_sol_types;
#[automatically_derived]
impl alloy_sol_types::SolEvent for AuthorityCreated {
type DataTuple<'a> = (alloy::sol_types::sol_data::Address,);
type DataToken<'a> = <Self::DataTuple<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
type TopicList = (alloy_sol_types::sol_data::FixedBytes<32>,);
const SIGNATURE: &'static str = "AuthorityCreated(address)";
const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([
220u8, 161u8, 250u8, 215u8, 11u8, 238u8, 75u8, 167u8, 164u8, 225u8,
122u8, 28u8, 110u8, 153u8, 230u8, 87u8, 210u8, 37u8, 26u8, 247u8, 162u8,
121u8, 18u8, 71u8, 88u8, 188u8, 1u8, 88u8, 138u8, 190u8, 45u8, 47u8,
]);
const ANONYMOUS: bool = false;
#[allow(unused_variables)]
#[inline]
fn new(
topics: <Self::TopicList as alloy_sol_types::SolType>::RustType,
data: <Self::DataTuple<'_> as alloy_sol_types::SolType>::RustType,
) -> Self {
Self { authority: data.0 }
}
#[inline]
fn check_signature(
topics: &<Self::TopicList as alloy_sol_types::SolType>::RustType,
) -> alloy_sol_types::Result<()> {
if topics.0 != Self::SIGNATURE_HASH {
return Err(
alloy_sol_types::Error::invalid_event_signature_hash(
Self::SIGNATURE,
topics.0,
Self::SIGNATURE_HASH,
),
);
}
Ok(())
}
#[inline]
fn tokenize_body(&self) -> Self::DataToken<'_> {
(
<alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
&self.authority,
),
)
}
#[inline]
fn topics(&self) -> <Self::TopicList as alloy_sol_types::SolType>::RustType {
(Self::SIGNATURE_HASH.into(),)
}
#[inline]
fn encode_topics_raw(
&self,
out: &mut [alloy_sol_types::abi::token::WordToken],
) -> alloy_sol_types::Result<()> {
if out.len() < <Self::TopicList as alloy_sol_types::TopicList>::COUNT {
return Err(alloy_sol_types::Error::Overrun);
}
out[0usize] = alloy_sol_types::abi::token::WordToken(
Self::SIGNATURE_HASH,
);
Ok(())
}
}
#[automatically_derived]
impl alloy_sol_types::private::IntoLogData for AuthorityCreated {
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
From::from(self)
}
fn into_log_data(self) -> alloy_sol_types::private::LogData {
From::from(&self)
}
}
#[automatically_derived]
impl From<&AuthorityCreated> for alloy_sol_types::private::LogData {
#[inline]
fn from(this: &AuthorityCreated) -> alloy_sol_types::private::LogData {
alloy_sol_types::SolEvent::encode_log_data(this)
}
}
};
#[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 calculateAuthorityAddressCall {
#[allow(missing_docs)]
pub authorityOwner: alloy::sol_types::private::Address,
#[allow(missing_docs)]
pub epochLength: alloy::sol_types::private::primitives::aliases::U256,
#[allow(missing_docs)]
pub salt: alloy::sol_types::private::FixedBytes<32>,
}
#[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 calculateAuthorityAddressReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::Address,
}
#[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::Uint<256>,
alloy::sol_types::sol_data::FixedBytes<32>,
);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
alloy::sol_types::private::Address,
alloy::sol_types::private::primitives::aliases::U256,
alloy::sol_types::private::FixedBytes<32>,
);
#[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<calculateAuthorityAddressCall>
for UnderlyingRustTuple<'_> {
fn from(value: calculateAuthorityAddressCall) -> Self {
(value.authorityOwner, value.epochLength, value.salt)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for calculateAuthorityAddressCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self {
authorityOwner: tuple.0,
epochLength: tuple.1,
salt: tuple.2,
}
}
}
}
{
#[doc(hidden)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
#[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<calculateAuthorityAddressReturn>
for UnderlyingRustTuple<'_> {
fn from(value: calculateAuthorityAddressReturn) -> Self {
(value._0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for calculateAuthorityAddressReturn {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { _0: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for calculateAuthorityAddressCall {
type Parameters<'a> = (
alloy::sol_types::sol_data::Address,
alloy::sol_types::sol_data::Uint<256>,
alloy::sol_types::sol_data::FixedBytes<32>,
);
type Token<'a> = <Self::Parameters<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
type Return = alloy::sol_types::private::Address;
type ReturnTuple<'a> = (alloy::sol_types::sol_data::Address,);
type ReturnToken<'a> = <Self::ReturnTuple<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "calculateAuthorityAddress(address,uint256,bytes32)";
const SELECTOR: [u8; 4] = [20u8, 66u8, 247u8, 187u8];
#[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.authorityOwner,
),
<alloy::sol_types::sol_data::Uint<
256,
> as alloy_sol_types::SolType>::tokenize(&self.epochLength),
<alloy::sol_types::sol_data::FixedBytes<
32,
> as alloy_sol_types::SolType>::tokenize(&self.salt),
)
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
(
<alloy::sol_types::sol_data::Address 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: calculateAuthorityAddressReturn = 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: calculateAuthorityAddressReturn = 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 newAuthority_0Call {
#[allow(missing_docs)]
pub authorityOwner: alloy::sol_types::private::Address,
#[allow(missing_docs)]
pub epochLength: alloy::sol_types::private::primitives::aliases::U256,
}
#[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 newAuthority_0Return {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::Address,
}
#[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::Uint<256>,
);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
alloy::sol_types::private::Address,
alloy::sol_types::private::primitives::aliases::U256,
);
#[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<newAuthority_0Call> for UnderlyingRustTuple<'_> {
fn from(value: newAuthority_0Call) -> Self {
(value.authorityOwner, value.epochLength)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for newAuthority_0Call {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self {
authorityOwner: tuple.0,
epochLength: tuple.1,
}
}
}
}
{
#[doc(hidden)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
#[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<newAuthority_0Return>
for UnderlyingRustTuple<'_> {
fn from(value: newAuthority_0Return) -> Self {
(value._0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for newAuthority_0Return {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { _0: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for newAuthority_0Call {
type Parameters<'a> = (
alloy::sol_types::sol_data::Address,
alloy::sol_types::sol_data::Uint<256>,
);
type Token<'a> = <Self::Parameters<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
type Return = alloy::sol_types::private::Address;
type ReturnTuple<'a> = (alloy::sol_types::sol_data::Address,);
type ReturnToken<'a> = <Self::ReturnTuple<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "newAuthority(address,uint256)";
const SELECTOR: [u8; 4] = [147u8, 215u8, 33u8, 124u8];
#[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.authorityOwner,
),
<alloy::sol_types::sol_data::Uint<
256,
> as alloy_sol_types::SolType>::tokenize(&self.epochLength),
)
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
(
<alloy::sol_types::sol_data::Address 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: newAuthority_0Return = 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: newAuthority_0Return = 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 newAuthority_1Call {
#[allow(missing_docs)]
pub authorityOwner: alloy::sol_types::private::Address,
#[allow(missing_docs)]
pub epochLength: alloy::sol_types::private::primitives::aliases::U256,
#[allow(missing_docs)]
pub salt: alloy::sol_types::private::FixedBytes<32>,
}
#[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 newAuthority_1Return {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::Address,
}
#[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::Uint<256>,
alloy::sol_types::sol_data::FixedBytes<32>,
);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
alloy::sol_types::private::Address,
alloy::sol_types::private::primitives::aliases::U256,
alloy::sol_types::private::FixedBytes<32>,
);
#[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<newAuthority_1Call> for UnderlyingRustTuple<'_> {
fn from(value: newAuthority_1Call) -> Self {
(value.authorityOwner, value.epochLength, value.salt)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for newAuthority_1Call {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self {
authorityOwner: tuple.0,
epochLength: tuple.1,
salt: tuple.2,
}
}
}
}
{
#[doc(hidden)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
#[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<newAuthority_1Return>
for UnderlyingRustTuple<'_> {
fn from(value: newAuthority_1Return) -> Self {
(value._0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for newAuthority_1Return {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { _0: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for newAuthority_1Call {
type Parameters<'a> = (
alloy::sol_types::sol_data::Address,
alloy::sol_types::sol_data::Uint<256>,
alloy::sol_types::sol_data::FixedBytes<32>,
);
type Token<'a> = <Self::Parameters<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
type Return = alloy::sol_types::private::Address;
type ReturnTuple<'a> = (alloy::sol_types::sol_data::Address,);
type ReturnToken<'a> = <Self::ReturnTuple<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "newAuthority(address,uint256,bytes32)";
const SELECTOR: [u8; 4] = [236u8, 153u8, 38u8, 104u8];
#[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.authorityOwner,
),
<alloy::sol_types::sol_data::Uint<
256,
> as alloy_sol_types::SolType>::tokenize(&self.epochLength),
<alloy::sol_types::sol_data::FixedBytes<
32,
> as alloy_sol_types::SolType>::tokenize(&self.salt),
)
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
(
<alloy::sol_types::sol_data::Address 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: newAuthority_1Return = 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: newAuthority_1Return = r.into();
r._0
})
}
}
};
#[derive(Clone)]
#[derive(serde::Serialize, serde::Deserialize)]
#[derive()]
pub enum IAuthorityFactoryCalls {
#[allow(missing_docs)]
calculateAuthorityAddress(calculateAuthorityAddressCall),
#[allow(missing_docs)]
newAuthority_0(newAuthority_0Call),
#[allow(missing_docs)]
newAuthority_1(newAuthority_1Call),
}
impl IAuthorityFactoryCalls {
pub const SELECTORS: &'static [[u8; 4usize]] = &[
[20u8, 66u8, 247u8, 187u8],
[147u8, 215u8, 33u8, 124u8],
[236u8, 153u8, 38u8, 104u8],
];
pub const VARIANT_NAMES: &'static [&'static str] = &[
::core::stringify!(calculateAuthorityAddress),
::core::stringify!(newAuthority_0),
::core::stringify!(newAuthority_1),
];
pub const SIGNATURES: &'static [&'static str] = &[
<calculateAuthorityAddressCall as alloy_sol_types::SolCall>::SIGNATURE,
<newAuthority_0Call as alloy_sol_types::SolCall>::SIGNATURE,
<newAuthority_1Call 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 IAuthorityFactoryCalls {
const NAME: &'static str = "IAuthorityFactoryCalls";
const MIN_DATA_LENGTH: usize = 64usize;
const COUNT: usize = 3usize;
#[inline]
fn selector(&self) -> [u8; 4] {
match self {
Self::calculateAuthorityAddress(_) => {
<calculateAuthorityAddressCall as alloy_sol_types::SolCall>::SELECTOR
}
Self::newAuthority_0(_) => {
<newAuthority_0Call as alloy_sol_types::SolCall>::SELECTOR
}
Self::newAuthority_1(_) => {
<newAuthority_1Call 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<IAuthorityFactoryCalls>] = &[
{
fn calculateAuthorityAddress(
data: &[u8],
) -> alloy_sol_types::Result<IAuthorityFactoryCalls> {
<calculateAuthorityAddressCall as alloy_sol_types::SolCall>::abi_decode_raw(
data,
)
.map(IAuthorityFactoryCalls::calculateAuthorityAddress)
}
calculateAuthorityAddress
},
{
fn newAuthority_0(
data: &[u8],
) -> alloy_sol_types::Result<IAuthorityFactoryCalls> {
<newAuthority_0Call as alloy_sol_types::SolCall>::abi_decode_raw(
data,
)
.map(IAuthorityFactoryCalls::newAuthority_0)
}
newAuthority_0
},
{
fn newAuthority_1(
data: &[u8],
) -> alloy_sol_types::Result<IAuthorityFactoryCalls> {
<newAuthority_1Call as alloy_sol_types::SolCall>::abi_decode_raw(
data,
)
.map(IAuthorityFactoryCalls::newAuthority_1)
}
newAuthority_1
},
];
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<IAuthorityFactoryCalls>] = &[
{
fn calculateAuthorityAddress(
data: &[u8],
) -> alloy_sol_types::Result<IAuthorityFactoryCalls> {
<calculateAuthorityAddressCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(IAuthorityFactoryCalls::calculateAuthorityAddress)
}
calculateAuthorityAddress
},
{
fn newAuthority_0(
data: &[u8],
) -> alloy_sol_types::Result<IAuthorityFactoryCalls> {
<newAuthority_0Call as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(IAuthorityFactoryCalls::newAuthority_0)
}
newAuthority_0
},
{
fn newAuthority_1(
data: &[u8],
) -> alloy_sol_types::Result<IAuthorityFactoryCalls> {
<newAuthority_1Call as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(IAuthorityFactoryCalls::newAuthority_1)
}
newAuthority_1
},
];
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::calculateAuthorityAddress(inner) => {
<calculateAuthorityAddressCall as alloy_sol_types::SolCall>::abi_encoded_size(
inner,
)
}
Self::newAuthority_0(inner) => {
<newAuthority_0Call as alloy_sol_types::SolCall>::abi_encoded_size(
inner,
)
}
Self::newAuthority_1(inner) => {
<newAuthority_1Call 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::calculateAuthorityAddress(inner) => {
<calculateAuthorityAddressCall as alloy_sol_types::SolCall>::abi_encode_raw(
inner,
out,
)
}
Self::newAuthority_0(inner) => {
<newAuthority_0Call as alloy_sol_types::SolCall>::abi_encode_raw(
inner,
out,
)
}
Self::newAuthority_1(inner) => {
<newAuthority_1Call as alloy_sol_types::SolCall>::abi_encode_raw(
inner,
out,
)
}
}
}
}
#[derive(Clone)]
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Debug, PartialEq, Eq, Hash)]
pub enum IAuthorityFactoryEvents {
#[allow(missing_docs)]
AuthorityCreated(AuthorityCreated),
}
impl IAuthorityFactoryEvents {
pub const SELECTORS: &'static [[u8; 32usize]] = &[
[
220u8, 161u8, 250u8, 215u8, 11u8, 238u8, 75u8, 167u8, 164u8, 225u8,
122u8, 28u8, 110u8, 153u8, 230u8, 87u8, 210u8, 37u8, 26u8, 247u8, 162u8,
121u8, 18u8, 71u8, 88u8, 188u8, 1u8, 88u8, 138u8, 190u8, 45u8, 47u8,
],
];
pub const VARIANT_NAMES: &'static [&'static str] = &[
::core::stringify!(AuthorityCreated),
];
pub const SIGNATURES: &'static [&'static str] = &[
<AuthorityCreated as alloy_sol_types::SolEvent>::SIGNATURE,
];
#[inline]
pub fn signature_by_selector(
selector: [u8; 32usize],
) -> ::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; 32usize],
) -> ::core::option::Option<&'static str> {
let sig = Self::signature_by_selector(selector)?;
sig.split_once('(').map(|(name, _)| name)
}
}
#[automatically_derived]
impl alloy_sol_types::SolEventInterface for IAuthorityFactoryEvents {
const NAME: &'static str = "IAuthorityFactoryEvents";
const COUNT: usize = 1usize;
fn decode_raw_log(
topics: &[alloy_sol_types::Word],
data: &[u8],
) -> alloy_sol_types::Result<Self> {
match topics.first().copied() {
Some(<AuthorityCreated as alloy_sol_types::SolEvent>::SIGNATURE_HASH) => {
<AuthorityCreated as alloy_sol_types::SolEvent>::decode_raw_log(
topics,
data,
)
.map(Self::AuthorityCreated)
}
_ => {
alloy_sol_types::private::Err(alloy_sol_types::Error::InvalidLog {
name: <Self as alloy_sol_types::SolEventInterface>::NAME,
log: alloy_sol_types::private::Box::new(
alloy_sol_types::private::LogData::new_unchecked(
topics.to_vec(),
data.to_vec().into(),
),
),
})
}
}
}
}
#[automatically_derived]
impl alloy_sol_types::private::IntoLogData for IAuthorityFactoryEvents {
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
match self {
Self::AuthorityCreated(inner) => {
alloy_sol_types::private::IntoLogData::to_log_data(inner)
}
}
}
fn into_log_data(self) -> alloy_sol_types::private::LogData {
match self {
Self::AuthorityCreated(inner) => {
alloy_sol_types::private::IntoLogData::into_log_data(inner)
}
}
}
}
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,
) -> IAuthorityFactoryInstance<P, N> {
IAuthorityFactoryInstance::<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<IAuthorityFactoryInstance<P, N>>,
> {
IAuthorityFactoryInstance::<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> {
IAuthorityFactoryInstance::<P, N>::deploy_builder(__provider)
}
#[derive(Clone)]
pub struct IAuthorityFactoryInstance<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 IAuthorityFactoryInstance<P, N> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("IAuthorityFactoryInstance").field(&self.address).finish()
}
}
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> IAuthorityFactoryInstance<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<IAuthorityFactoryInstance<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> IAuthorityFactoryInstance<&P, N> {
#[inline]
pub fn with_cloned_provider(self) -> IAuthorityFactoryInstance<P, N> {
IAuthorityFactoryInstance {
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,
> IAuthorityFactoryInstance<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 calculateAuthorityAddress(
&self,
authorityOwner: alloy::sol_types::private::Address,
epochLength: alloy::sol_types::private::primitives::aliases::U256,
salt: alloy::sol_types::private::FixedBytes<32>,
) -> alloy_contract::SolCallBuilder<&P, calculateAuthorityAddressCall, N> {
self.call_builder(
&calculateAuthorityAddressCall {
authorityOwner,
epochLength,
salt,
},
)
}
pub fn newAuthority_0(
&self,
authorityOwner: alloy::sol_types::private::Address,
epochLength: alloy::sol_types::private::primitives::aliases::U256,
) -> alloy_contract::SolCallBuilder<&P, newAuthority_0Call, N> {
self.call_builder(
&newAuthority_0Call {
authorityOwner,
epochLength,
},
)
}
pub fn newAuthority_1(
&self,
authorityOwner: alloy::sol_types::private::Address,
epochLength: alloy::sol_types::private::primitives::aliases::U256,
salt: alloy::sol_types::private::FixedBytes<32>,
) -> alloy_contract::SolCallBuilder<&P, newAuthority_1Call, N> {
self.call_builder(
&newAuthority_1Call {
authorityOwner,
epochLength,
salt,
},
)
}
}
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> IAuthorityFactoryInstance<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)
}
pub fn AuthorityCreated_filter(
&self,
) -> alloy_contract::Event<&P, AuthorityCreated, N> {
self.event_filter::<AuthorityCreated>()
}
}
}