/**
Generated by the following Solidity interface...
```solidity
interface Portal {
constructor(address inputBox);
function getInputBox() external view returns (address);
}
```
...which was generated by the following JSON ABI:
```json
[
{
"type": "constructor",
"inputs": [
{
"name": "inputBox",
"type": "address",
"internalType": "contract IInputBox"
}
],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "getInputBox",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "contract IInputBox"
}
],
"stateMutability": "view"
}
]
```*/
#[allow(
non_camel_case_types,
non_snake_case,
clippy::pub_underscore_fields,
clippy::style,
clippy::empty_structs_with_brackets
)]
pub mod Portal {
use super::*;
use alloy::sol_types as alloy_sol_types;
/// The creation / init bytecode of the contract.
///
/// ```text
///0x60a034606457601f61011838819003918201601f19168301916001600160401b03831184841017606857808492602094604052833981010312606457516001600160a01b0381168103606457608052604051609b908161007d82396080518160320152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60808060405260043610156011575f80fd5b5f3560e01c62aace9a146022575f80fd5b346061575f3660031901126061577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5f80fdfea2646970667358221220f808389024894d9dd46bbb49637d5fdb168bf19fb22c53be3c18d2b60d77ab9764736f6c634300081e0033
/// ```
#[rustfmt::skip]
#[allow(clippy::all)]
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
b"`\xA04`dW`\x1Fa\x01\x188\x81\x90\x03\x91\x82\x01`\x1F\x19\x16\x83\x01\x91`\x01`\x01`@\x1B\x03\x83\x11\x84\x84\x10\x17`hW\x80\x84\x92` \x94`@R\x839\x81\x01\x03\x12`dWQ`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x03`dW`\x80R`@Q`\x9B\x90\x81a\0}\x829`\x80Q\x81`2\x01R\xF3[_\x80\xFD[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD\xFE`\x80\x80`@R`\x046\x10\x15`\x11W_\x80\xFD[_5`\xE0\x1Cb\xAA\xCE\x9A\x14`\"W_\x80\xFD[4`aW_6`\x03\x19\x01\x12`aW\x7F\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0`\x01`\x01`\xA0\x1B\x03\x16\x81R` \x90\xF3[_\x80\xFD\xFE\xA2dipfsX\"\x12 \xF8\x088\x90$\x89M\x9D\xD4k\xBBIc}_\xDB\x16\x8B\xF1\x9F\xB2,S\xBE<\x18\xD2\xB6\rw\xAB\x97dsolcC\0\x08\x1E\x003",
);
/// The runtime bytecode of the contract, as deployed on the network.
///
/// ```text
///0x60808060405260043610156011575f80fd5b5f3560e01c62aace9a146022575f80fd5b346061575f3660031901126061577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5f80fdfea2646970667358221220f808389024894d9dd46bbb49637d5fdb168bf19fb22c53be3c18d2b60d77ab9764736f6c634300081e0033
/// ```
#[rustfmt::skip]
#[allow(clippy::all)]
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
b"`\x80\x80`@R`\x046\x10\x15`\x11W_\x80\xFD[_5`\xE0\x1Cb\xAA\xCE\x9A\x14`\"W_\x80\xFD[4`aW_6`\x03\x19\x01\x12`aW\x7F\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0`\x01`\x01`\xA0\x1B\x03\x16\x81R` \x90\xF3[_\x80\xFD\xFE\xA2dipfsX\"\x12 \xF8\x088\x90$\x89M\x9D\xD4k\xBBIc}_\xDB\x16\x8B\xF1\x9F\xB2,S\xBE<\x18\xD2\xB6\rw\xAB\x97dsolcC\0\x08\x1E\x003",
);
/**Constructor`.
```solidity
constructor(address inputBox);
```*/
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct constructorCall {
#[allow(missing_docs)]
pub inputBox: alloy::sol_types::private::Address,
}
const _: () = {
use alloy::sol_types as alloy_sol_types;
{
#[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<constructorCall> for UnderlyingRustTuple<'_> {
fn from(value: constructorCall) -> Self {
(value.inputBox,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for constructorCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { inputBox: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolConstructor for constructorCall {
type Parameters<'a> = (alloy::sol_types::sol_data::Address,);
type Token<'a> = <Self::Parameters<
'a,
> as alloy_sol_types::SolType>::Token<'a>;
#[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.inputBox,
),
)
}
}
};
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
/**Function with signature `getInputBox()` and selector `0x00aace9a`.
```solidity
function getInputBox() external view returns (address);
```*/
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct getInputBoxCall;
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Default, Debug, PartialEq, Eq, Hash)]
///Container type for the return parameters of the [`getInputBox()`](getInputBoxCall) function.
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct getInputBoxReturn {
#[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> = ();
#[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<getInputBoxCall> for UnderlyingRustTuple<'_> {
fn from(value: getInputBoxCall) -> Self {
()
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for getInputBoxCall {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self
}
}
}
{
#[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<getInputBoxReturn> for UnderlyingRustTuple<'_> {
fn from(value: getInputBoxReturn) -> Self {
(value._0,)
}
}
#[automatically_derived]
#[doc(hidden)]
impl ::core::convert::From<UnderlyingRustTuple<'_>> for getInputBoxReturn {
fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
Self { _0: tuple.0 }
}
}
}
#[automatically_derived]
impl alloy_sol_types::SolCall for getInputBoxCall {
type Parameters<'a> = ();
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 = "getInputBox()";
const SELECTOR: [u8; 4] = [0u8, 170u8, 206u8, 154u8];
#[inline]
fn new<'a>(
tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
) -> Self {
tuple.into()
}
#[inline]
fn tokenize(&self) -> Self::Token<'_> {
()
}
#[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: getInputBoxReturn = 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: getInputBoxReturn = r.into();
r._0
})
}
}
};
///Container for all the [`Portal`](self) function calls.
#[derive(Clone)]
#[derive(serde::Serialize, serde::Deserialize)]
#[derive()]
pub enum PortalCalls {
#[allow(missing_docs)]
getInputBox(getInputBoxCall),
}
impl PortalCalls {
/// 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]] = &[[0u8, 170u8, 206u8, 154u8]];
/// The names of the variants in the same order as `SELECTORS`.
pub const VARIANT_NAMES: &'static [&'static str] = &[
::core::stringify!(getInputBox),
];
/// The signatures in the same order as `SELECTORS`.
pub const SIGNATURES: &'static [&'static str] = &[
<getInputBoxCall 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 PortalCalls {
const NAME: &'static str = "PortalCalls";
const MIN_DATA_LENGTH: usize = 0usize;
const COUNT: usize = 1usize;
#[inline]
fn selector(&self) -> [u8; 4] {
match self {
Self::getInputBox(_) => {
<getInputBoxCall 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<PortalCalls>] = &[
{
fn getInputBox(data: &[u8]) -> alloy_sol_types::Result<PortalCalls> {
<getInputBoxCall as alloy_sol_types::SolCall>::abi_decode_raw(
data,
)
.map(PortalCalls::getInputBox)
}
getInputBox
},
];
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<PortalCalls>] = &[
{
fn getInputBox(data: &[u8]) -> alloy_sol_types::Result<PortalCalls> {
<getInputBoxCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
data,
)
.map(PortalCalls::getInputBox)
}
getInputBox
},
];
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::getInputBox(inner) => {
<getInputBoxCall 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::getInputBox(inner) => {
<getInputBoxCall as alloy_sol_types::SolCall>::abi_encode_raw(
inner,
out,
)
}
}
}
}
use alloy::contract as alloy_contract;
/**Creates a new wrapper around an on-chain [`Portal`](self) contract instance.
See the [wrapper's documentation](`PortalInstance`) 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,
) -> PortalInstance<P, N> {
PortalInstance::<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,
inputBox: alloy::sol_types::private::Address,
) -> impl ::core::future::Future<
Output = alloy_contract::Result<PortalInstance<P, N>>,
> {
PortalInstance::<P, N>::deploy(__provider, inputBox)
}
/**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,
inputBox: alloy::sol_types::private::Address,
) -> alloy_contract::RawCallBuilder<P, N> {
PortalInstance::<P, N>::deploy_builder(__provider, inputBox)
}
/**A [`Portal`](self) instance.
Contains type-safe methods for interacting with an on-chain instance of the
[`Portal`](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 PortalInstance<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 PortalInstance<P, N> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("PortalInstance").field(&self.address).finish()
}
}
/// Instantiation and getters/setters.
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> PortalInstance<P, N> {
/**Creates a new wrapper around an on-chain [`Portal`](self) contract instance.
See the [wrapper's documentation](`PortalInstance`) 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,
inputBox: alloy::sol_types::private::Address,
) -> alloy_contract::Result<PortalInstance<P, N>> {
let call_builder = Self::deploy_builder(__provider, inputBox);
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,
inputBox: alloy::sol_types::private::Address,
) -> alloy_contract::RawCallBuilder<P, N> {
alloy_contract::RawCallBuilder::new_raw_deploy(
__provider,
[
&BYTECODE[..],
&alloy_sol_types::SolConstructor::abi_encode(
&constructorCall { inputBox },
)[..],
]
.concat()
.into(),
)
}
/// 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> PortalInstance<&P, N> {
/// Clones the provider and returns a new instance with the cloned provider.
#[inline]
pub fn with_cloned_provider(self) -> PortalInstance<P, N> {
PortalInstance {
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,
> PortalInstance<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 [`getInputBox`] function.
pub fn getInputBox(
&self,
) -> alloy_contract::SolCallBuilder<&P, getInputBoxCall, N> {
self.call_builder(&getInputBoxCall)
}
}
/// Event filters.
impl<
P: alloy_contract::private::Provider<N>,
N: alloy_contract::private::Network,
> PortalInstance<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)
}
}
}