#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style,
clippy::empty_structs_with_brackets
)]
pub mod SafeCast {
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"`\x80\x80`@R4`\x17W`9\x90\x81`\x1C\x8290\x81PP\xF3[_\x80\xFD\xFE_\x80\xFD\xFE\xA2dipfsX\"\x12 S\x85\xEAF\x81\xF4\xCB\x95\xE6\x1B\x07\x8E[\xB6K\x0Ez\xBAK\xEFM\xB6\xD6c\xEE\xA0\xFEo}Rb\xEBdsolcC\0\x08\x1E\x003",
);
#[rustfmt::skip]
#[allow(clippy::all)]
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
b"_\x80\xFD\xFE\xA2dipfsX\"\x12 S\x85\xEAF\x81\xF4\xCB\x95\xE6\x1B\x07\x8E[\xB6K\x0Ez\xBAK\xEFM\xB6\xD6c\xEE\xA0\xFEo}Rb\xEBdsolcC\0\x08\x1E\x003",
);
#[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 SafeCastOverflowedIntDowncast {
#[allow(missing_docs)]
pub bits: u8,
#[allow(missing_docs)]
pub value: alloy::sol_types::private::primitives::aliases::I256,
}
#[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::Uint<8>,
alloy::sol_types::sol_data::Int<256>,
);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
u8,
alloy::sol_types::private::primitives::aliases::I256,
);
#[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<SafeCastOverflowedIntDowncast>
for UnderlyingRustTuple<'_> {
fn from(value: SafeCastOverflowedIntDowncast) -> Self {
(value.bits, value.value)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for SafeCastOverflowedIntDowncast {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self {
bits: tuple.0,
value: tuple.1,
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolError for SafeCastOverflowedIntDowncast {
type Parameters<'a> = UnderlyingSolTuple<'a>;
type Token<'a> = <Self::Parameters<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "SafeCastOverflowedIntDowncast(uint8,int256)";
const SELECTOR: [u8; 4] = [50u8, 114u8, 105u8, 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::Uint<
8,
> as alloy_sol_types::SolType>::tokenize(&self.bits),
<alloy::sol_types::sol_data::Int<
256,
> as alloy_sol_types::SolType>::tokenize(&self.value),
)
}
#[inline]
fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result<Self> {
<Self::Parameters<
'_,
> as alloy_sol_types::SolType>::abi_decode_sequence_validate(data)
.map(Self::new)
}
}
};
#[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 SafeCastOverflowedIntToUint {
#[allow(missing_docs)]
pub value: alloy::sol_types::private::primitives::aliases::I256,
}
#[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::Int<256>,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
alloy::sol_types::private::primitives::aliases::I256,
);
#[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<SafeCastOverflowedIntToUint>
for UnderlyingRustTuple<'_> {
fn from(value: SafeCastOverflowedIntToUint) -> Self {
(value.value,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for SafeCastOverflowedIntToUint {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { value: tuple.0 }
}
}
#[automatically_derived]
impl alloy_sol_types::SolError for SafeCastOverflowedIntToUint {
type Parameters<'a> = UnderlyingSolTuple<'a>;
type Token<'a> = <Self::Parameters<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "SafeCastOverflowedIntToUint(int256)";
const SELECTOR: [u8; 4] = [168u8, 206u8, 68u8, 50u8];
#[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::Int<
256,
> as alloy_sol_types::SolType>::tokenize(&self.value),
)
}
#[inline]
fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result<Self> {
<Self::Parameters<
'_,
> as alloy_sol_types::SolType>::abi_decode_sequence_validate(data)
.map(Self::new)
}
}
};
#[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 SafeCastOverflowedUintDowncast {
#[allow(missing_docs)]
pub bits: u8,
#[allow(missing_docs)]
pub value: alloy::sol_types::private::primitives::aliases::U256,
}
#[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::Uint<8>,
alloy::sol_types::sol_data::Uint<256>,
);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
u8,
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<SafeCastOverflowedUintDowncast>
for UnderlyingRustTuple<'_> {
fn from(value: SafeCastOverflowedUintDowncast) -> Self {
(value.bits, value.value)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for SafeCastOverflowedUintDowncast {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self {
bits: tuple.0,
value: tuple.1,
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolError for SafeCastOverflowedUintDowncast {
type Parameters<'a> = UnderlyingSolTuple<'a>;
type Token<'a> = <Self::Parameters<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "SafeCastOverflowedUintDowncast(uint8,uint256)";
const SELECTOR: [u8; 4] = [109u8, 252u8, 198u8, 80u8];
#[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::Uint<
8,
> as alloy_sol_types::SolType>::tokenize(&self.bits),
<alloy::sol_types::sol_data::Uint<
256,
> as alloy_sol_types::SolType>::tokenize(&self.value),
)
}
#[inline]
fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result<Self> {
<Self::Parameters<
'_,
> as alloy_sol_types::SolType>::abi_decode_sequence_validate(data)
.map(Self::new)
}
}
};
#[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 SafeCastOverflowedUintToInt {
#[allow(missing_docs)]
pub value: alloy::sol_types::private::primitives::aliases::U256,
}
#[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::Uint<256>,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (
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<SafeCastOverflowedUintToInt>
for UnderlyingRustTuple<'_> {
fn from(value: SafeCastOverflowedUintToInt) -> Self {
(value.value,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>>
for SafeCastOverflowedUintToInt {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { value: tuple.0 }
}
}
#[automatically_derived]
impl alloy_sol_types::SolError for SafeCastOverflowedUintToInt {
type Parameters<'a> = UnderlyingSolTuple<'a>;
type Token<'a> = <Self::Parameters<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "SafeCastOverflowedUintToInt(uint256)";
const SELECTOR: [u8; 4] = [36u8, 119u8, 94u8, 6u8];
#[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::Uint<
256,
> as alloy_sol_types::SolType>::tokenize(&self.value),
)
}
#[inline]
fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result<Self> {
<Self::Parameters<
'_,
> as alloy_sol_types::SolType>::abi_decode_sequence_validate(data)
.map(Self::new)
}
}
};
#[derive(Clone)]
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Debug, PartialEq, Eq, Hash)]
pub enum SafeCastErrors {
#[allow(missing_docs)]
SafeCastOverflowedIntDowncast(SafeCastOverflowedIntDowncast),
#[allow(missing_docs)]
SafeCastOverflowedIntToUint(SafeCastOverflowedIntToUint),
#[allow(missing_docs)]
SafeCastOverflowedUintDowncast(SafeCastOverflowedUintDowncast),
#[allow(missing_docs)]
SafeCastOverflowedUintToInt(SafeCastOverflowedUintToInt),
}
impl SafeCastErrors {
pub const SELECTORS: &'static [[u8; 4usize]] = &[
[36u8, 119u8, 94u8, 6u8],
[50u8, 114u8, 105u8, 167u8],
[109u8, 252u8, 198u8, 80u8],
[168u8, 206u8, 68u8, 50u8],
];
pub const VARIANT_NAMES: &'static [&'static str] = &[
::core::stringify!(SafeCastOverflowedUintToInt),
::core::stringify!(SafeCastOverflowedIntDowncast),
::core::stringify!(SafeCastOverflowedUintDowncast),
::core::stringify!(SafeCastOverflowedIntToUint),
];
pub const SIGNATURES: &'static [&'static str] = &[
<SafeCastOverflowedUintToInt as alloy_sol_types::SolError>::SIGNATURE,
<SafeCastOverflowedIntDowncast as alloy_sol_types::SolError>::SIGNATURE,
<SafeCastOverflowedUintDowncast as alloy_sol_types::SolError>::SIGNATURE,
<SafeCastOverflowedIntToUint as alloy_sol_types::SolError>::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 SafeCastErrors {
const NAME: &'static str = "SafeCastErrors";
const MIN_DATA_LENGTH: usize = 32usize;
const COUNT: usize = 4usize;
#[inline]
fn selector(&self) -> [u8; 4] {
match self {
Self::SafeCastOverflowedIntDowncast(_) => {
<SafeCastOverflowedIntDowncast as alloy_sol_types::SolError>::SELECTOR
}
Self::SafeCastOverflowedIntToUint(_) => {
<SafeCastOverflowedIntToUint as alloy_sol_types::SolError>::SELECTOR
}
Self::SafeCastOverflowedUintDowncast(_) => {
<SafeCastOverflowedUintDowncast as alloy_sol_types::SolError>::SELECTOR
}
Self::SafeCastOverflowedUintToInt(_) => {
<SafeCastOverflowedUintToInt as alloy_sol_types::SolError>::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<SafeCastErrors>] = &[
{
fn SafeCastOverflowedUintToInt(
data: &[u8],
) -> alloy_sol_types::Result<SafeCastErrors> {
<SafeCastOverflowedUintToInt as alloy_sol_types::SolError>::abi_decode_raw(
data,
)
.map(SafeCastErrors::SafeCastOverflowedUintToInt)
}
SafeCastOverflowedUintToInt
},
{
fn SafeCastOverflowedIntDowncast(
data: &[u8],
) -> alloy_sol_types::Result<SafeCastErrors> {
<SafeCastOverflowedIntDowncast as alloy_sol_types::SolError>::abi_decode_raw(
data,
)
.map(SafeCastErrors::SafeCastOverflowedIntDowncast)
}
SafeCastOverflowedIntDowncast
},
{
fn SafeCastOverflowedUintDowncast(
data: &[u8],
) -> alloy_sol_types::Result<SafeCastErrors> {
<SafeCastOverflowedUintDowncast as alloy_sol_types::SolError>::abi_decode_raw(
data,
)
.map(SafeCastErrors::SafeCastOverflowedUintDowncast)
}
SafeCastOverflowedUintDowncast
},
{
fn SafeCastOverflowedIntToUint(
data: &[u8],
) -> alloy_sol_types::Result<SafeCastErrors> {
<SafeCastOverflowedIntToUint as alloy_sol_types::SolError>::abi_decode_raw(
data,
)
.map(SafeCastErrors::SafeCastOverflowedIntToUint)
}
SafeCastOverflowedIntToUint
},
];
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<SafeCastErrors>] = &[
{
fn SafeCastOverflowedUintToInt(
data: &[u8],
) -> alloy_sol_types::Result<SafeCastErrors> {
<SafeCastOverflowedUintToInt as alloy_sol_types::SolError>::abi_decode_raw_validate(
data,
)
.map(SafeCastErrors::SafeCastOverflowedUintToInt)
}
SafeCastOverflowedUintToInt
},
{
fn SafeCastOverflowedIntDowncast(
data: &[u8],
) -> alloy_sol_types::Result<SafeCastErrors> {
<SafeCastOverflowedIntDowncast as alloy_sol_types::SolError>::abi_decode_raw_validate(
data,
)
.map(SafeCastErrors::SafeCastOverflowedIntDowncast)
}
SafeCastOverflowedIntDowncast
},
{
fn SafeCastOverflowedUintDowncast(
data: &[u8],
) -> alloy_sol_types::Result<SafeCastErrors> {
<SafeCastOverflowedUintDowncast as alloy_sol_types::SolError>::abi_decode_raw_validate(
data,
)
.map(SafeCastErrors::SafeCastOverflowedUintDowncast)
}
SafeCastOverflowedUintDowncast
},
{
fn SafeCastOverflowedIntToUint(
data: &[u8],
) -> alloy_sol_types::Result<SafeCastErrors> {
<SafeCastOverflowedIntToUint as alloy_sol_types::SolError>::abi_decode_raw_validate(
data,
)
.map(SafeCastErrors::SafeCastOverflowedIntToUint)
}
SafeCastOverflowedIntToUint
},
];
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::SafeCastOverflowedIntDowncast(inner) => {
<SafeCastOverflowedIntDowncast as alloy_sol_types::SolError>::abi_encoded_size(
inner,
)
}
Self::SafeCastOverflowedIntToUint(inner) => {
<SafeCastOverflowedIntToUint as alloy_sol_types::SolError>::abi_encoded_size(
inner,
)
}
Self::SafeCastOverflowedUintDowncast(inner) => {
<SafeCastOverflowedUintDowncast as alloy_sol_types::SolError>::abi_encoded_size(
inner,
)
}
Self::SafeCastOverflowedUintToInt(inner) => {
<SafeCastOverflowedUintToInt as alloy_sol_types::SolError>::abi_encoded_size(
inner,
)
}
}
}
#[inline]
fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
match self {
Self::SafeCastOverflowedIntDowncast(inner) => {
<SafeCastOverflowedIntDowncast as alloy_sol_types::SolError>::abi_encode_raw(
inner,
out,
)
}
Self::SafeCastOverflowedIntToUint(inner) => {
<SafeCastOverflowedIntToUint as alloy_sol_types::SolError>::abi_encode_raw(
inner,
out,
)
}
Self::SafeCastOverflowedUintDowncast(inner) => {
<SafeCastOverflowedUintDowncast as alloy_sol_types::SolError>::abi_encode_raw(
inner,
out,
)
}
Self::SafeCastOverflowedUintToInt(inner) => {
<SafeCastOverflowedUintToInt as alloy_sol_types::SolError>::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,
) -> SafeCastInstance<P, N> {
SafeCastInstance::<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<SafeCastInstance<P, N>>,
> {
SafeCastInstance::<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> {
SafeCastInstance::<P, N>::deploy_builder(__provider)
}
#[derive(Clone)]
pub struct SafeCastInstance<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 SafeCastInstance<P, N> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("SafeCastInstance").field(&self.address).finish()
}
}
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> SafeCastInstance<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<SafeCastInstance<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> SafeCastInstance<&P, N> {
#[inline]
pub fn with_cloned_provider(self) -> SafeCastInstance<P, N> {
SafeCastInstance {
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,
> SafeCastInstance<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)
}
}
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> SafeCastInstance<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)
}
}
}