105 lines
4.1 KiB
Rust

pub use eip1271_interface::*;
/// This module was auto-generated with ethers-rs Abigen.
/// More information at: <https://github.com/gakonst/ethers-rs>
#[allow(
clippy::enum_variant_names,
clippy::too_many_arguments,
clippy::upper_case_acronyms,
clippy::type_complexity,
dead_code,
non_camel_case_types,
)]
pub mod eip1271_interface {
#[rustfmt::skip]
const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"isValidSignature\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\",\"components\":[]}]}]";
///The parsed JSON ABI of the contract.
pub static EIP1271INTERFACE_ABI: ::ethers::contract::Lazy<
::ethers::core::abi::Abi,
> = ::ethers::contract::Lazy::new(|| {
::ethers::core::utils::__serde_json::from_str(__ABI)
.expect("ABI is always valid")
});
pub struct EIP1271Interface<M>(::ethers::contract::Contract<M>);
impl<M> ::core::clone::Clone for EIP1271Interface<M> {
fn clone(&self) -> Self {
Self(::core::clone::Clone::clone(&self.0))
}
}
impl<M> ::core::ops::Deref for EIP1271Interface<M> {
type Target = ::ethers::contract::Contract<M>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<M> ::core::ops::DerefMut for EIP1271Interface<M> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl<M> ::core::fmt::Debug for EIP1271Interface<M> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple(stringify!(EIP1271Interface)).field(&self.address()).finish()
}
}
impl<M: ::ethers::providers::Middleware> EIP1271Interface<M> {
/// Creates a new contract instance with the specified `ethers` client at
/// `address`. The contract derefs to a `ethers::Contract` object.
pub fn new<T: Into<::ethers::core::types::Address>>(
address: T,
client: ::std::sync::Arc<M>,
) -> Self {
Self(
::ethers::contract::Contract::new(
address.into(),
EIP1271INTERFACE_ABI.clone(),
client,
),
)
}
///Calls the contract's `isValidSignature` (0x1626ba7e) function
pub fn is_valid_signature(
&self,
digest: [u8; 32],
signature: ::ethers::core::types::Bytes,
) -> ::ethers::contract::builders::ContractCall<M, [u8; 4]> {
self.0
.method_hash([22, 38, 186, 126], (digest, signature))
.expect("method not found (this should never happen)")
}
}
impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>>
for EIP1271Interface<M> {
fn from(contract: ::ethers::contract::Contract<M>) -> Self {
Self::new(contract.address(), contract.client())
}
}
///Container type for all input parameters for the `isValidSignature` function with signature `isValidSignature(bytes32,bytes)` and selector `0x1626ba7e`
#[derive(
Clone,
::ethers::contract::EthCall,
::ethers::contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "isValidSignature", abi = "isValidSignature(bytes32,bytes)")]
pub struct IsValidSignatureCall {
pub digest: [u8; 32],
pub signature: ::ethers::core::types::Bytes,
}
///Container type for all return fields from the `isValidSignature` function with signature `isValidSignature(bytes32,bytes)` and selector `0x1626ba7e`
#[derive(
Clone,
::ethers::contract::EthAbiType,
::ethers::contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct IsValidSignatureReturn(pub [u8; 4]);
}