pub use schnorr::*; /// This module was auto-generated with ethers-rs Abigen. /// More information at: #[allow( clippy::enum_variant_names, clippy::too_many_arguments, clippy::upper_case_acronyms, clippy::type_complexity, dead_code, non_camel_case_types, )] pub mod schnorr { #[allow(deprecated)] fn __abi() -> ::ethers_core::abi::Abi { ::ethers_core::abi::ethabi::Contract { constructor: ::core::option::Option::None, functions: ::core::convert::From::from([ ( ::std::borrow::ToOwned::to_owned("Q"), ::std::vec![ ::ethers_core::abi::ethabi::Function { name: ::std::borrow::ToOwned::to_owned("Q"), inputs: ::std::vec![], outputs: ::std::vec![ ::ethers_core::abi::ethabi::Param { name: ::std::string::String::new(), kind: ::ethers_core::abi::ethabi::ParamType::Uint(256usize), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned("uint256"), ), }, ], constant: ::core::option::Option::None, state_mutability: ::ethers_core::abi::ethabi::StateMutability::View, }, ], ), ( ::std::borrow::ToOwned::to_owned("verify"), ::std::vec![ ::ethers_core::abi::ethabi::Function { name: ::std::borrow::ToOwned::to_owned("verify"), inputs: ::std::vec![ ::ethers_core::abi::ethabi::Param { name: ::std::borrow::ToOwned::to_owned("parity"), kind: ::ethers_core::abi::ethabi::ParamType::Uint(8usize), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned("uint8"), ), }, ::ethers_core::abi::ethabi::Param { name: ::std::borrow::ToOwned::to_owned("px"), kind: ::ethers_core::abi::ethabi::ParamType::FixedBytes( 32usize, ), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned("bytes32"), ), }, ::ethers_core::abi::ethabi::Param { name: ::std::borrow::ToOwned::to_owned("message"), kind: ::ethers_core::abi::ethabi::ParamType::FixedBytes( 32usize, ), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned("bytes32"), ), }, ::ethers_core::abi::ethabi::Param { name: ::std::borrow::ToOwned::to_owned("c"), kind: ::ethers_core::abi::ethabi::ParamType::FixedBytes( 32usize, ), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned("bytes32"), ), }, ::ethers_core::abi::ethabi::Param { name: ::std::borrow::ToOwned::to_owned("s"), kind: ::ethers_core::abi::ethabi::ParamType::FixedBytes( 32usize, ), internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned("bytes32"), ), }, ], outputs: ::std::vec![ ::ethers_core::abi::ethabi::Param { name: ::std::string::String::new(), kind: ::ethers_core::abi::ethabi::ParamType::Bool, internal_type: ::core::option::Option::Some( ::std::borrow::ToOwned::to_owned("bool"), ), }, ], constant: ::core::option::Option::None, state_mutability: ::ethers_core::abi::ethabi::StateMutability::View, }, ], ), ]), events: ::std::collections::BTreeMap::new(), errors: ::core::convert::From::from([ ( ::std::borrow::ToOwned::to_owned("InvalidSOrA"), ::std::vec![ ::ethers_core::abi::ethabi::AbiError { name: ::std::borrow::ToOwned::to_owned("InvalidSOrA"), inputs: ::std::vec![], }, ], ), ( ::std::borrow::ToOwned::to_owned("InvalidSignature"), ::std::vec![ ::ethers_core::abi::ethabi::AbiError { name: ::std::borrow::ToOwned::to_owned("InvalidSignature"), inputs: ::std::vec![], }, ], ), ]), receive: false, fallback: false, } } ///The parsed JSON ABI of the contract. pub static SCHNORR_ABI: ::ethers_contract::Lazy<::ethers_core::abi::Abi> = ::ethers_contract::Lazy::new( __abi, ); pub struct Schnorr(::ethers_contract::Contract); impl ::core::clone::Clone for Schnorr { fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } } impl ::core::ops::Deref for Schnorr { type Target = ::ethers_contract::Contract; fn deref(&self) -> &Self::Target { &self.0 } } impl ::core::ops::DerefMut for Schnorr { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } impl ::core::fmt::Debug for Schnorr { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { f.debug_tuple(::core::stringify!(Schnorr)).field(&self.address()).finish() } } impl Schnorr { /// Creates a new contract instance with the specified `ethers` client at /// `address`. The contract derefs to a `ethers::Contract` object. pub fn new>( address: T, client: ::std::sync::Arc, ) -> Self { Self( ::ethers_contract::Contract::new( address.into(), SCHNORR_ABI.clone(), client, ), ) } ///Calls the contract's `Q` (0xe493ef8c) function pub fn q( &self, ) -> ::ethers_contract::builders::ContractCall { self.0 .method_hash([228, 147, 239, 140], ()) .expect("method not found (this should never happen)") } ///Calls the contract's `verify` (0x9186da4c) function pub fn verify( &self, parity: u8, px: [u8; 32], message: [u8; 32], c: [u8; 32], s: [u8; 32], ) -> ::ethers_contract::builders::ContractCall { self.0 .method_hash([145, 134, 218, 76], (parity, px, message, c, s)) .expect("method not found (this should never happen)") } } impl From<::ethers_contract::Contract> for Schnorr { fn from(contract: ::ethers_contract::Contract) -> Self { Self::new(contract.address(), contract.client()) } } ///Custom Error type `InvalidSOrA` with signature `InvalidSOrA()` and selector `0x4e99a12e` #[derive( Clone, ::ethers_contract::EthError, ::ethers_contract::EthDisplay, Default, Debug, PartialEq, Eq, Hash )] #[etherror(name = "InvalidSOrA", abi = "InvalidSOrA()")] pub struct InvalidSOrA; ///Custom Error type `InvalidSignature` with signature `InvalidSignature()` and selector `0x8baa579f` #[derive( Clone, ::ethers_contract::EthError, ::ethers_contract::EthDisplay, Default, Debug, PartialEq, Eq, Hash )] #[etherror(name = "InvalidSignature", abi = "InvalidSignature()")] pub struct InvalidSignature; ///Container type for all of the contract's custom errors #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)] pub enum SchnorrErrors { InvalidSOrA(InvalidSOrA), InvalidSignature(InvalidSignature), /// The standard solidity revert string, with selector /// Error(string) -- 0x08c379a0 RevertString(::std::string::String), } impl ::ethers_core::abi::AbiDecode for SchnorrErrors { fn decode( data: impl AsRef<[u8]>, ) -> ::core::result::Result { let data = data.as_ref(); if let Ok(decoded) = <::std::string::String as ::ethers_core::abi::AbiDecode>::decode( data, ) { return Ok(Self::RevertString(decoded)); } if let Ok(decoded) = ::decode( data, ) { return Ok(Self::InvalidSOrA(decoded)); } if let Ok(decoded) = ::decode( data, ) { return Ok(Self::InvalidSignature(decoded)); } Err(::ethers_core::abi::Error::InvalidData.into()) } } impl ::ethers_core::abi::AbiEncode for SchnorrErrors { fn encode(self) -> ::std::vec::Vec { match self { Self::InvalidSOrA(element) => { ::ethers_core::abi::AbiEncode::encode(element) } Self::InvalidSignature(element) => { ::ethers_core::abi::AbiEncode::encode(element) } Self::RevertString(s) => ::ethers_core::abi::AbiEncode::encode(s), } } } impl ::ethers_contract::ContractRevert for SchnorrErrors { fn valid_selector(selector: [u8; 4]) -> bool { match selector { [0x08, 0xc3, 0x79, 0xa0] => true, _ if selector == ::selector() => true, _ if selector == ::selector() => { true } _ => false, } } } impl ::core::fmt::Display for SchnorrErrors { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { match self { Self::InvalidSOrA(element) => ::core::fmt::Display::fmt(element, f), Self::InvalidSignature(element) => ::core::fmt::Display::fmt(element, f), Self::RevertString(s) => ::core::fmt::Display::fmt(s, f), } } } impl ::core::convert::From<::std::string::String> for SchnorrErrors { fn from(value: String) -> Self { Self::RevertString(value) } } impl ::core::convert::From for SchnorrErrors { fn from(value: InvalidSOrA) -> Self { Self::InvalidSOrA(value) } } impl ::core::convert::From for SchnorrErrors { fn from(value: InvalidSignature) -> Self { Self::InvalidSignature(value) } } ///Container type for all input parameters for the `Q` function with signature `Q()` and selector `0xe493ef8c` #[derive( Clone, ::ethers_contract::EthCall, ::ethers_contract::EthDisplay, Default, Debug, PartialEq, Eq, Hash )] #[ethcall(name = "Q", abi = "Q()")] pub struct QCall; ///Container type for all input parameters for the `verify` function with signature `verify(uint8,bytes32,bytes32,bytes32,bytes32)` and selector `0x9186da4c` #[derive( Clone, ::ethers_contract::EthCall, ::ethers_contract::EthDisplay, Default, Debug, PartialEq, Eq, Hash )] #[ethcall(name = "verify", abi = "verify(uint8,bytes32,bytes32,bytes32,bytes32)")] pub struct VerifyCall { pub parity: u8, pub px: [u8; 32], pub message: [u8; 32], pub c: [u8; 32], pub s: [u8; 32], } ///Container type for all of the contract's call #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)] pub enum SchnorrCalls { Q(QCall), Verify(VerifyCall), } impl ::ethers_core::abi::AbiDecode for SchnorrCalls { fn decode( data: impl AsRef<[u8]>, ) -> ::core::result::Result { let data = data.as_ref(); if let Ok(decoded) = ::decode(data) { return Ok(Self::Q(decoded)); } if let Ok(decoded) = ::decode( data, ) { return Ok(Self::Verify(decoded)); } Err(::ethers_core::abi::Error::InvalidData.into()) } } impl ::ethers_core::abi::AbiEncode for SchnorrCalls { fn encode(self) -> Vec { match self { Self::Q(element) => ::ethers_core::abi::AbiEncode::encode(element), Self::Verify(element) => ::ethers_core::abi::AbiEncode::encode(element), } } } impl ::core::fmt::Display for SchnorrCalls { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { match self { Self::Q(element) => ::core::fmt::Display::fmt(element, f), Self::Verify(element) => ::core::fmt::Display::fmt(element, f), } } } impl ::core::convert::From for SchnorrCalls { fn from(value: QCall) -> Self { Self::Q(value) } } impl ::core::convert::From for SchnorrCalls { fn from(value: VerifyCall) -> Self { Self::Verify(value) } } ///Container type for all return fields from the `Q` function with signature `Q()` and selector `0xe493ef8c` #[derive( Clone, ::ethers_contract::EthAbiType, ::ethers_contract::EthAbiCodec, Default, Debug, PartialEq, Eq, Hash )] pub struct QReturn(pub ::ethers_core::types::U256); ///Container type for all return fields from the `verify` function with signature `verify(uint8,bytes32,bytes32,bytes32,bytes32)` and selector `0x9186da4c` #[derive( Clone, ::ethers_contract::EthAbiType, ::ethers_contract::EthAbiCodec, Default, Debug, PartialEq, Eq, Hash )] pub struct VerifyReturn(pub bool); }