/**
Generated by the following Solidity interface...
```solidity
interface ErrorRaiser {
function raise(bytes memory error) external pure;
}
```
...which was generated by the following JSON ABI:
```json
[
{
"type": "function",
"name": "raise",
"inputs": [
{
"name": "error",
"type": "bytes",
"internalType": "bytes"
}
],
"outputs": [],
"stateMutability": "pure"
}
]
```*/
#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style,
clippy::empty_structs_with_brackets
)]
pub mod ErrorRaiser {
use super::*;
use alloy::sol_types as alloy_sol_types;
/// The creation / init bytecode of the contract.
///
/// ```text
///0x6080806040523460155761010b908161001a8239f35b5f80fdfe608060405260043610156010575f80fd5b5f3560e01c63ac603e30146022575f80fd5b3460bd57602036600319011260bd5760043567ffffffffffffffff811160bd573660238201121560bd5780600401359067ffffffffffffffff821160bd57366024838301011160bd5760405191601f8101601f19908116603f011683019067ffffffffffffffff82118483101760b9578060245f946020946040528287520183860137830101528051908160b4575f80fd5b602001fd5b60c1565b5f80fd5b634e487b7160e01b5f52604160045260245ffdfea2646970667358221220ea792bddece773a94a603580762ed0f3b13fba33790f3c826f1c3c4fb14396c164736f6c634300081e0033
/// ```
#[rustfmt::skip]
#[allow(clippy::all)]
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
b"`\x80\x80`@R4`\x15Wa\x01\x0B\x90\x81a\0\x1A\x829\xF3[_\x80\xFD\xFE`\x80`@R`\x046\x10\x15`\x10W_\x80\xFD[_5`\xE0\x1Cc\xAC`>0\x14`\"W_\x80\xFD[4`\xBDW` 6`\x03\x19\x01\x12`\xBDW`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11`\xBDW6`#\x82\x01\x12\x15`\xBDW\x80`\x04\x015\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11`\xBDW6`$\x83\x83\x01\x01\x11`\xBDW`@Q\x91`\x1F\x81\x01`\x1F\x19\x90\x81\x16`?\x01\x16\x83\x01\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11\x84\x83\x10\x17`\xB9W\x80`$_\x94` \x94`@R\x82\x87R\x01\x83\x86\x017\x83\x01\x01R\x80Q\x90\x81`\xB4W_\x80\xFD[` \x01\xFD[`\xC1V[_\x80\xFD[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD\xFE\xA2dipfsX\"\x12 \xEAy+\xDD\xEC\xE7s\xA9J`5\x80v.\xD0\xF3\xB1?\xBA3y\x0F<\x82o\x1C<O\xB1C\x96\xC1dsolcC\0\x08\x1E\x003",
);
/// The runtime bytecode of the contract, as deployed on the network.
///
/// ```text
///0x608060405260043610156010575f80fd5b5f3560e01c63ac603e30146022575f80fd5b3460bd57602036600319011260bd5760043567ffffffffffffffff811160bd573660238201121560bd5780600401359067ffffffffffffffff821160bd57366024838301011160bd5760405191601f8101601f19908116603f011683019067ffffffffffffffff82118483101760b9578060245f946020946040528287520183860137830101528051908160b4575f80fd5b602001fd5b60c1565b5f80fd5b634e487b7160e01b5f52604160045260245ffdfea2646970667358221220ea792bddece773a94a603580762ed0f3b13fba33790f3c826f1c3c4fb14396c164736f6c634300081e0033
/// ```
#[rustfmt::skip]
#[allow(clippy::all)]
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
b"`\x80`@R`\x046\x10\x15`\x10W_\x80\xFD[_5`\xE0\x1Cc\xAC`>0\x14`\"W_\x80\xFD[4`\xBDW` 6`\x03\x19\x01\x12`\xBDW`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11`\xBDW6`#\x82\x01\x12\x15`\xBDW\x80`\x04\x015\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11`\xBDW6`$\x83\x83\x01\x01\x11`\xBDW`@Q\x91`\x1F\x81\x01`\x1F\x19\x90\x81\x16`?\x01\x16\x83\x01\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11\x84\x83\x10\x17`\xB9W\x80`$_\x94` \x94`@R\x82\x87R\x01\x83\x86\x017\x83\x01\x01R\x80Q\x90\x81`\xB4W_\x80\xFD[` \x01\xFD[`\xC1V[_\x80\xFD[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD\xFE\xA2dipfsX\"\x12 \xEAy+\xDD\xEC\xE7s\xA9J`5\x80v.\xD0\xF3\xB1?\xBA3y\x0F<\x82o\x1C<O\xB1C\x96\xC1dsolcC\0\x08\x1E\x003",
);
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
/**Function with signature `raise(bytes)` and selector `0xac603e30`.
```solidity
function raise(bytes memory error) external pure;
```*/
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct raiseCall {
#[allow(missing_docs)]
pub error: alloy::sol_types::private::Bytes,
}
///Container type for the return parameters of the [`raise(bytes)`](raiseCall) function.
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct raiseReturn {}
#[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::Bytes,);
#[doc(hidden)]
type UnderlyingRustTuple<'a> = (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<raiseCall> for UnderlyingRustTuple<'_> {
fn from(value: raiseCall) -> Self {
(value.error,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for raiseCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { error: tuple.0 }
}
}
}
{
#[doc(hidden)]
#[allow(dead_code)]
type UnderlyingSolTuple<'a> = ();
#[doc(hidden)]
type UnderlyingRustTuple<'a> = ();
#[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<raiseReturn> for UnderlyingRustTuple<'_> {
fn from(value: raiseReturn) -> Self {
()
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for raiseReturn {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self {}
}
}
}
impl raiseReturn {
fn _tokenize(
&self,
) -> <raiseCall as alloy_sol_types::SolCall>::ReturnToken<'_> {
()
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for raiseCall {
type Parameters<'a> = (alloy::sol_types::sol_data::Bytes,);
type Token<'a> = <Self::Parameters<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
type Return = raiseReturn;
type ReturnTuple<'a> = ();
type ReturnToken<'a> = <Self::ReturnTuple<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
const SIGNATURE: &'static str = "raise(bytes)";
const SELECTOR: [u8; 4] = [172u8, 96u8, 62u8, 48u8];
#[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::Bytes as alloy_sol_types::SolType>::tokenize(
&self.error,
),
)
}
#[inline]
fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
raiseReturn::_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(Into::into)
}
#[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(Into::into)
}
}
};
///Container for all the [`ErrorRaiser`](self) function calls.
#[derive(Clone)]
#[derive(serde::Serialize, serde::Deserialize)]
#[derive()]
pub enum ErrorRaiserCalls {
#[allow(missing_docs)]
raise(raiseCall),
}
impl ErrorRaiserCalls {
/// All the selectors of this enum.
///
/// Note that the selectors might not be in the same order as the variants.
/// No guarantees are made about the order of the selectors.
///
/// Prefer using `SolInterface` methods instead.
pub const SELECTORS: &'static [[u8; 4usize]] = &[[172u8, 96u8, 62u8, 48u8]];
/// The names of the variants in the same order as `SELECTORS`.
pub const VARIANT_NAMES: &'static [&'static str] = &[::core::stringify!(raise)];
/// The signatures in the same order as `SELECTORS`.
pub const SIGNATURES: &'static [&'static str] = &[
<raiseCall as alloy_sol_types::SolCall>::SIGNATURE,
];
/// Returns the signature for the given selector, if known.
#[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,
}
}
/// Returns the enum variant name for the given selector, if known.
#[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 ErrorRaiserCalls {
const NAME: &'static str = "ErrorRaiserCalls";
const MIN_DATA_LENGTH: usize = 64usize;
const COUNT: usize = 1usize;
#[inline]
fn selector(&self) -> [u8; 4] {
match self {
Self::raise(_) => <raiseCall 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<ErrorRaiserCalls>] = &[
{
fn raise(data: &[u8]) -> alloy_sol_types::Result<ErrorRaiserCalls> {
<raiseCall as alloy_sol_types::SolCall>::abi_decode_raw(data)
.map(ErrorRaiserCalls::raise)
}
raise
},
];
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<ErrorRaiserCalls>] = &[
{
fn raise(data: &[u8]) -> alloy_sol_types::Result<ErrorRaiserCalls> {
<raiseCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(ErrorRaiserCalls::raise)
}
raise
},
];
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::raise(inner) => {
<raiseCall 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::raise(inner) => {
<raiseCall as alloy_sol_types::SolCall>::abi_encode_raw(inner, out)
}
}
}
}
use alloy::contract as alloy_contract;
/**Creates a new wrapper around an on-chain [`ErrorRaiser`](self) contract instance.
See the [wrapper's documentation](`ErrorRaiserInstance`) for more details.*/
#[inline]
pub const fn new<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
>(
address: alloy_sol_types::private::Address,
__provider: P,
) -> ErrorRaiserInstance<P, N> {
ErrorRaiserInstance::<P, N>::new(address, __provider)
}
/**Deploys this contract using the given `provider` and constructor arguments, if any.
Returns a new instance of the contract, if the deployment was successful.
For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
#[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<ErrorRaiserInstance<P, N>>,
> {
ErrorRaiserInstance::<P, N>::deploy(__provider)
}
/**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
and constructor arguments, if any.
This is a simple wrapper around creating a `RawCallBuilder` with the data set to
the bytecode concatenated with the constructor's ABI-encoded arguments.*/
#[inline]
pub fn deploy_builder<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
>(__provider: P) -> alloy_contract::RawCallBuilder<P, N> {
ErrorRaiserInstance::<P, N>::deploy_builder(__provider)
}
/**A [`ErrorRaiser`](self) instance.
Contains type-safe methods for interacting with an on-chain instance of the
[`ErrorRaiser`](self) contract located at a given `address`, using a given
provider `P`.
If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!)
documentation on how to provide it), the `deploy` and `deploy_builder` methods can
be used to deploy a new instance of the contract.
See the [module-level documentation](self) for all the available methods.*/
#[derive(Clone)]
pub struct ErrorRaiserInstance<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 ErrorRaiserInstance<P, N> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("ErrorRaiserInstance").field(&self.address).finish()
}
}
/// Instantiation and getters/setters.
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> ErrorRaiserInstance<P, N> {
/**Creates a new wrapper around an on-chain [`ErrorRaiser`](self) contract instance.
See the [wrapper's documentation](`ErrorRaiserInstance`) for more details.*/
#[inline]
pub const fn new(
address: alloy_sol_types::private::Address,
__provider: P,
) -> Self {
Self {
address,
provider: __provider,
_network: ::core::marker::PhantomData,
}
}
/**Deploys this contract using the given `provider` and constructor arguments, if any.
Returns a new instance of the contract, if the deployment was successful.
For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
#[inline]
pub async fn deploy(
__provider: P,
) -> alloy_contract::Result<ErrorRaiserInstance<P, N>> {
let call_builder = Self::deploy_builder(__provider);
let contract_address = call_builder.deploy().await?;
Ok(Self::new(contract_address, call_builder.provider))
}
/**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
and constructor arguments, if any.
This is a simple wrapper around creating a `RawCallBuilder` with the data set to
the bytecode concatenated with the constructor's ABI-encoded arguments.*/
#[inline]
pub fn deploy_builder(__provider: P) -> alloy_contract::RawCallBuilder<P, N> {
alloy_contract::RawCallBuilder::new_raw_deploy(
__provider,
::core::clone::Clone::clone(&BYTECODE),
)
}
/// Returns a reference to the address.
#[inline]
pub const fn address(&self) -> &alloy_sol_types::private::Address {
&self.address
}
/// Sets the address.
#[inline]
pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
self.address = address;
}
/// Sets the address and returns `self`.
pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
self.set_address(address);
self
}
/// Returns a reference to the provider.
#[inline]
pub const fn provider(&self) -> &P {
&self.provider
}
}
impl<P: ::core::clone::Clone, N> ErrorRaiserInstance<&P, N> {
/// Clones the provider and returns a new instance with the cloned provider.
#[inline]
pub fn with_cloned_provider(self) -> ErrorRaiserInstance<P, N> {
ErrorRaiserInstance {
address: self.address,
provider: ::core::clone::Clone::clone(&self.provider),
_network: ::core::marker::PhantomData,
}
}
}
/// Function calls.
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> ErrorRaiserInstance<P, N> {
/// Creates a new call builder using this contract instance's provider and address.
///
/// Note that the call can be any function call, not just those defined in this
/// contract. Prefer using the other methods for building type-safe contract calls.
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)
}
///Creates a new call builder for the [`raise`] function.
pub fn raise(
&self,
error: alloy::sol_types::private::Bytes,
) -> alloy_contract::SolCallBuilder<&P, raiseCall, N> {
self.call_builder(&raiseCall { error })
}
}
/// Event filters.
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> ErrorRaiserInstance<P, N> {
/// Creates a new event filter using this contract instance's provider and address.
///
/// Note that the type can be any event, not just those defined in this contract.
/// Prefer using the other methods for building type-safe event filters.
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)
}
}
}