diff --git a/protocol/Makefile b/protocol/Makefile index 4458941e..a2a4f0d4 100644 --- a/protocol/Makefile +++ b/protocol/Makefile @@ -1,8 +1,8 @@ generate: - forge bind --crate-name pod-protocol --bindings-path ./bindings --alloy-version 1.0.24 --force --no-metadata --select "^IBridgeMintBurn$$" --select "^BridgeDepositWithdraw$$" --select "^WrappedToken$$" --overwrite + forge bind --crate-name pod-protocol --bindings-path ./bindings --alloy-version 1.0.24 --force --no-metadata --select "^IBridge$$" --select "^WrappedToken$$" --overwrite check: - forge bind --crate-name pod-protocol --bindings-path ./bindings --alloy-version 1.0.24 --force --no-metadata --select "^IBridgeMintBurn$$" --select "^BridgeDepositWithdraw$$" --select "^WrappedToken$$" + forge bind --crate-name pod-protocol --bindings-path ./bindings --alloy-version 1.0.24 --force --no-metadata --select "^IBridge$$" --select "^WrappedToken$$" diff --git a/protocol/bindings/src/bridge_deposit_withdraw.rs b/protocol/bindings/src/bridge_deposit_withdraw.rs deleted file mode 100644 index ac705d04..00000000 --- a/protocol/bindings/src/bridge_deposit_withdraw.rs +++ /dev/null @@ -1,9954 +0,0 @@ -///Module containing a contract's types and functions. -/** - -```solidity -library IBridge { - struct TokenLimits { uint256 minAmount; uint256 deposit; uint256 claim; } - struct TokenUsage { uint256 consumed; uint256 lastUpdated; } -} -```*/ -#[allow( - non_camel_case_types, - non_snake_case, - clippy::pub_underscore_fields, - clippy::style, - clippy::empty_structs_with_brackets -)] -pub mod IBridge { - use super::*; - use alloy::sol_types as alloy_sol_types; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**```solidity -struct TokenLimits { uint256 minAmount; uint256 deposit; uint256 claim; } -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct TokenLimits { - #[allow(missing_docs)] - pub minAmount: alloy::sol_types::private::primitives::aliases::U256, - #[allow(missing_docs)] - pub deposit: alloy::sol_types::private::primitives::aliases::U256, - #[allow(missing_docs)] - pub claim: 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>, - alloy::sol_types::sol_data::Uint<256>, - alloy::sol_types::sol_data::Uint<256>, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::primitives::aliases::U256, - alloy::sol_types::private::primitives::aliases::U256, - alloy::sol_types::private::primitives::aliases::U256, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: TokenLimits) -> Self { - (value.minAmount, value.deposit, value.claim) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for TokenLimits { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - minAmount: tuple.0, - deposit: tuple.1, - claim: tuple.2, - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolValue for TokenLimits { - type SolType = Self; - } - #[automatically_derived] - impl alloy_sol_types::private::SolTypeValue for TokenLimits { - #[inline] - fn stv_to_tokens(&self) -> ::Token<'_> { - ( - as alloy_sol_types::SolType>::tokenize(&self.minAmount), - as alloy_sol_types::SolType>::tokenize(&self.deposit), - as alloy_sol_types::SolType>::tokenize(&self.claim), - ) - } - #[inline] - fn stv_abi_encoded_size(&self) -> usize { - if let Some(size) = ::ENCODED_SIZE { - return size; - } - let tuple = as ::core::convert::From>::from(self.clone()); - as alloy_sol_types::SolType>::abi_encoded_size(&tuple) - } - #[inline] - fn stv_eip712_data_word(&self) -> alloy_sol_types::Word { - ::eip712_hash_struct(self) - } - #[inline] - fn stv_abi_encode_packed_to( - &self, - out: &mut alloy_sol_types::private::Vec, - ) { - let tuple = as ::core::convert::From>::from(self.clone()); - as alloy_sol_types::SolType>::abi_encode_packed_to(&tuple, out) - } - #[inline] - fn stv_abi_packed_encoded_size(&self) -> usize { - if let Some(size) = ::PACKED_ENCODED_SIZE { - return size; - } - let tuple = as ::core::convert::From>::from(self.clone()); - as alloy_sol_types::SolType>::abi_packed_encoded_size(&tuple) - } - } - #[automatically_derived] - impl alloy_sol_types::SolType for TokenLimits { - type RustType = Self; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SOL_NAME: &'static str = ::NAME; - const ENCODED_SIZE: Option = as alloy_sol_types::SolType>::ENCODED_SIZE; - const PACKED_ENCODED_SIZE: Option = as alloy_sol_types::SolType>::PACKED_ENCODED_SIZE; - #[inline] - fn valid_token(token: &Self::Token<'_>) -> bool { - as alloy_sol_types::SolType>::valid_token(token) - } - #[inline] - fn detokenize(token: Self::Token<'_>) -> Self::RustType { - let tuple = as alloy_sol_types::SolType>::detokenize(token); - >>::from(tuple) - } - } - #[automatically_derived] - impl alloy_sol_types::SolStruct for TokenLimits { - const NAME: &'static str = "TokenLimits"; - #[inline] - fn eip712_root_type() -> alloy_sol_types::private::Cow<'static, str> { - alloy_sol_types::private::Cow::Borrowed( - "TokenLimits(uint256 minAmount,uint256 deposit,uint256 claim)", - ) - } - #[inline] - fn eip712_components() -> alloy_sol_types::private::Vec< - alloy_sol_types::private::Cow<'static, str>, - > { - alloy_sol_types::private::Vec::new() - } - #[inline] - fn eip712_encode_type() -> alloy_sol_types::private::Cow<'static, str> { - ::eip712_root_type() - } - #[inline] - fn eip712_encode_data(&self) -> alloy_sol_types::private::Vec { - [ - as alloy_sol_types::SolType>::eip712_data_word(&self.minAmount) - .0, - as alloy_sol_types::SolType>::eip712_data_word(&self.deposit) - .0, - as alloy_sol_types::SolType>::eip712_data_word(&self.claim) - .0, - ] - .concat() - } - } - #[automatically_derived] - impl alloy_sol_types::EventTopic for TokenLimits { - #[inline] - fn topic_preimage_length(rust: &Self::RustType) -> usize { - 0usize - + as alloy_sol_types::EventTopic>::topic_preimage_length( - &rust.minAmount, - ) - + as alloy_sol_types::EventTopic>::topic_preimage_length( - &rust.deposit, - ) - + as alloy_sol_types::EventTopic>::topic_preimage_length(&rust.claim) - } - #[inline] - fn encode_topic_preimage( - rust: &Self::RustType, - out: &mut alloy_sol_types::private::Vec, - ) { - out.reserve( - ::topic_preimage_length(rust), - ); - as alloy_sol_types::EventTopic>::encode_topic_preimage( - &rust.minAmount, - out, - ); - as alloy_sol_types::EventTopic>::encode_topic_preimage( - &rust.deposit, - out, - ); - as alloy_sol_types::EventTopic>::encode_topic_preimage( - &rust.claim, - out, - ); - } - #[inline] - fn encode_topic( - rust: &Self::RustType, - ) -> alloy_sol_types::abi::token::WordToken { - let mut out = alloy_sol_types::private::Vec::new(); - ::encode_topic_preimage( - rust, - &mut out, - ); - alloy_sol_types::abi::token::WordToken( - alloy_sol_types::private::keccak256(out), - ) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**```solidity -struct TokenUsage { uint256 consumed; uint256 lastUpdated; } -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct TokenUsage { - #[allow(missing_docs)] - pub consumed: alloy::sol_types::private::primitives::aliases::U256, - #[allow(missing_docs)] - pub lastUpdated: 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>, - alloy::sol_types::sol_data::Uint<256>, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::primitives::aliases::U256, - alloy::sol_types::private::primitives::aliases::U256, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: TokenUsage) -> Self { - (value.consumed, value.lastUpdated) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for TokenUsage { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - consumed: tuple.0, - lastUpdated: tuple.1, - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolValue for TokenUsage { - type SolType = Self; - } - #[automatically_derived] - impl alloy_sol_types::private::SolTypeValue for TokenUsage { - #[inline] - fn stv_to_tokens(&self) -> ::Token<'_> { - ( - as alloy_sol_types::SolType>::tokenize(&self.consumed), - as alloy_sol_types::SolType>::tokenize(&self.lastUpdated), - ) - } - #[inline] - fn stv_abi_encoded_size(&self) -> usize { - if let Some(size) = ::ENCODED_SIZE { - return size; - } - let tuple = as ::core::convert::From>::from(self.clone()); - as alloy_sol_types::SolType>::abi_encoded_size(&tuple) - } - #[inline] - fn stv_eip712_data_word(&self) -> alloy_sol_types::Word { - ::eip712_hash_struct(self) - } - #[inline] - fn stv_abi_encode_packed_to( - &self, - out: &mut alloy_sol_types::private::Vec, - ) { - let tuple = as ::core::convert::From>::from(self.clone()); - as alloy_sol_types::SolType>::abi_encode_packed_to(&tuple, out) - } - #[inline] - fn stv_abi_packed_encoded_size(&self) -> usize { - if let Some(size) = ::PACKED_ENCODED_SIZE { - return size; - } - let tuple = as ::core::convert::From>::from(self.clone()); - as alloy_sol_types::SolType>::abi_packed_encoded_size(&tuple) - } - } - #[automatically_derived] - impl alloy_sol_types::SolType for TokenUsage { - type RustType = Self; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SOL_NAME: &'static str = ::NAME; - const ENCODED_SIZE: Option = as alloy_sol_types::SolType>::ENCODED_SIZE; - const PACKED_ENCODED_SIZE: Option = as alloy_sol_types::SolType>::PACKED_ENCODED_SIZE; - #[inline] - fn valid_token(token: &Self::Token<'_>) -> bool { - as alloy_sol_types::SolType>::valid_token(token) - } - #[inline] - fn detokenize(token: Self::Token<'_>) -> Self::RustType { - let tuple = as alloy_sol_types::SolType>::detokenize(token); - >>::from(tuple) - } - } - #[automatically_derived] - impl alloy_sol_types::SolStruct for TokenUsage { - const NAME: &'static str = "TokenUsage"; - #[inline] - fn eip712_root_type() -> alloy_sol_types::private::Cow<'static, str> { - alloy_sol_types::private::Cow::Borrowed( - "TokenUsage(uint256 consumed,uint256 lastUpdated)", - ) - } - #[inline] - fn eip712_components() -> alloy_sol_types::private::Vec< - alloy_sol_types::private::Cow<'static, str>, - > { - alloy_sol_types::private::Vec::new() - } - #[inline] - fn eip712_encode_type() -> alloy_sol_types::private::Cow<'static, str> { - ::eip712_root_type() - } - #[inline] - fn eip712_encode_data(&self) -> alloy_sol_types::private::Vec { - [ - as alloy_sol_types::SolType>::eip712_data_word(&self.consumed) - .0, - as alloy_sol_types::SolType>::eip712_data_word(&self.lastUpdated) - .0, - ] - .concat() - } - } - #[automatically_derived] - impl alloy_sol_types::EventTopic for TokenUsage { - #[inline] - fn topic_preimage_length(rust: &Self::RustType) -> usize { - 0usize - + as alloy_sol_types::EventTopic>::topic_preimage_length( - &rust.consumed, - ) - + as alloy_sol_types::EventTopic>::topic_preimage_length( - &rust.lastUpdated, - ) - } - #[inline] - fn encode_topic_preimage( - rust: &Self::RustType, - out: &mut alloy_sol_types::private::Vec, - ) { - out.reserve( - ::topic_preimage_length(rust), - ); - as alloy_sol_types::EventTopic>::encode_topic_preimage( - &rust.consumed, - out, - ); - as alloy_sol_types::EventTopic>::encode_topic_preimage( - &rust.lastUpdated, - out, - ); - } - #[inline] - fn encode_topic( - rust: &Self::RustType, - ) -> alloy_sol_types::abi::token::WordToken { - let mut out = alloy_sol_types::private::Vec::new(); - ::encode_topic_preimage( - rust, - &mut out, - ); - alloy_sol_types::abi::token::WordToken( - alloy_sol_types::private::keccak256(out), - ) - } - } - }; - use alloy::contract as alloy_contract; - /**Creates a new wrapper around an on-chain [`IBridge`](self) contract instance. - -See the [wrapper's documentation](`IBridgeInstance`) for more details.*/ - #[inline] - pub const fn new< - P: alloy_contract::private::Provider, - N: alloy_contract::private::Network, - >( - address: alloy_sol_types::private::Address, - __provider: P, - ) -> IBridgeInstance { - IBridgeInstance::::new(address, __provider) - } - /**A [`IBridge`](self) instance. - -Contains type-safe methods for interacting with an on-chain instance of the -[`IBridge`](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 IBridgeInstance { - address: alloy_sol_types::private::Address, - provider: P, - _network: ::core::marker::PhantomData, - } - #[automatically_derived] - impl ::core::fmt::Debug for IBridgeInstance { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_tuple("IBridgeInstance").field(&self.address).finish() - } - } - /// Instantiation and getters/setters. - impl< - P: alloy_contract::private::Provider, - N: alloy_contract::private::Network, - > IBridgeInstance { - /**Creates a new wrapper around an on-chain [`IBridge`](self) contract instance. - -See the [wrapper's documentation](`IBridgeInstance`) 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, - } - } - /// 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 IBridgeInstance<&P, N> { - /// Clones the provider and returns a new instance with the cloned provider. - #[inline] - pub fn with_cloned_provider(self) -> IBridgeInstance { - IBridgeInstance { - address: self.address, - provider: ::core::clone::Clone::clone(&self.provider), - _network: ::core::marker::PhantomData, - } - } - } - /// Function calls. - impl< - P: alloy_contract::private::Provider, - N: alloy_contract::private::Network, - > IBridgeInstance { - /// 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( - &self, - call: &C, - ) -> alloy_contract::SolCallBuilder<&P, C, N> { - alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call) - } - } - /// Event filters. - impl< - P: alloy_contract::private::Provider, - N: alloy_contract::private::Network, - > IBridgeInstance { - /// 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( - &self, - ) -> alloy_contract::Event<&P, E, N> { - alloy_contract::Event::new_sol(&self.provider, &self.address) - } - } -} -///Module containing a contract's types and functions. -/** - -```solidity -library MerkleTree { - struct MultiProof { bytes32[] path; bool[] flags; } -} -```*/ -#[allow( - non_camel_case_types, - non_snake_case, - clippy::pub_underscore_fields, - clippy::style, - clippy::empty_structs_with_brackets -)] -pub mod MerkleTree { - use super::*; - use alloy::sol_types as alloy_sol_types; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**```solidity -struct MultiProof { bytes32[] path; bool[] flags; } -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct MultiProof { - #[allow(missing_docs)] - pub path: alloy::sol_types::private::Vec< - alloy::sol_types::private::FixedBytes<32>, - >, - #[allow(missing_docs)] - pub flags: alloy::sol_types::private::Vec, - } - #[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::Array< - alloy::sol_types::sol_data::FixedBytes<32>, - >, - alloy::sol_types::sol_data::Array, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::Vec>, - alloy::sol_types::private::Vec, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: MultiProof) -> Self { - (value.path, value.flags) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for MultiProof { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - path: tuple.0, - flags: tuple.1, - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolValue for MultiProof { - type SolType = Self; - } - #[automatically_derived] - impl alloy_sol_types::private::SolTypeValue for MultiProof { - #[inline] - fn stv_to_tokens(&self) -> ::Token<'_> { - ( - , - > as alloy_sol_types::SolType>::tokenize(&self.path), - as alloy_sol_types::SolType>::tokenize(&self.flags), - ) - } - #[inline] - fn stv_abi_encoded_size(&self) -> usize { - if let Some(size) = ::ENCODED_SIZE { - return size; - } - let tuple = as ::core::convert::From>::from(self.clone()); - as alloy_sol_types::SolType>::abi_encoded_size(&tuple) - } - #[inline] - fn stv_eip712_data_word(&self) -> alloy_sol_types::Word { - ::eip712_hash_struct(self) - } - #[inline] - fn stv_abi_encode_packed_to( - &self, - out: &mut alloy_sol_types::private::Vec, - ) { - let tuple = as ::core::convert::From>::from(self.clone()); - as alloy_sol_types::SolType>::abi_encode_packed_to(&tuple, out) - } - #[inline] - fn stv_abi_packed_encoded_size(&self) -> usize { - if let Some(size) = ::PACKED_ENCODED_SIZE { - return size; - } - let tuple = as ::core::convert::From>::from(self.clone()); - as alloy_sol_types::SolType>::abi_packed_encoded_size(&tuple) - } - } - #[automatically_derived] - impl alloy_sol_types::SolType for MultiProof { - type RustType = Self; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SOL_NAME: &'static str = ::NAME; - const ENCODED_SIZE: Option = as alloy_sol_types::SolType>::ENCODED_SIZE; - const PACKED_ENCODED_SIZE: Option = as alloy_sol_types::SolType>::PACKED_ENCODED_SIZE; - #[inline] - fn valid_token(token: &Self::Token<'_>) -> bool { - as alloy_sol_types::SolType>::valid_token(token) - } - #[inline] - fn detokenize(token: Self::Token<'_>) -> Self::RustType { - let tuple = as alloy_sol_types::SolType>::detokenize(token); - >>::from(tuple) - } - } - #[automatically_derived] - impl alloy_sol_types::SolStruct for MultiProof { - const NAME: &'static str = "MultiProof"; - #[inline] - fn eip712_root_type() -> alloy_sol_types::private::Cow<'static, str> { - alloy_sol_types::private::Cow::Borrowed( - "MultiProof(bytes32[] path,bool[] flags)", - ) - } - #[inline] - fn eip712_components() -> alloy_sol_types::private::Vec< - alloy_sol_types::private::Cow<'static, str>, - > { - alloy_sol_types::private::Vec::new() - } - #[inline] - fn eip712_encode_type() -> alloy_sol_types::private::Cow<'static, str> { - ::eip712_root_type() - } - #[inline] - fn eip712_encode_data(&self) -> alloy_sol_types::private::Vec { - [ - , - > as alloy_sol_types::SolType>::eip712_data_word(&self.path) - .0, - as alloy_sol_types::SolType>::eip712_data_word(&self.flags) - .0, - ] - .concat() - } - } - #[automatically_derived] - impl alloy_sol_types::EventTopic for MultiProof { - #[inline] - fn topic_preimage_length(rust: &Self::RustType) -> usize { - 0usize - + , - > as alloy_sol_types::EventTopic>::topic_preimage_length(&rust.path) - + as alloy_sol_types::EventTopic>::topic_preimage_length(&rust.flags) - } - #[inline] - fn encode_topic_preimage( - rust: &Self::RustType, - out: &mut alloy_sol_types::private::Vec, - ) { - out.reserve( - ::topic_preimage_length(rust), - ); - , - > as alloy_sol_types::EventTopic>::encode_topic_preimage( - &rust.path, - out, - ); - as alloy_sol_types::EventTopic>::encode_topic_preimage( - &rust.flags, - out, - ); - } - #[inline] - fn encode_topic( - rust: &Self::RustType, - ) -> alloy_sol_types::abi::token::WordToken { - let mut out = alloy_sol_types::private::Vec::new(); - ::encode_topic_preimage( - rust, - &mut out, - ); - alloy_sol_types::abi::token::WordToken( - alloy_sol_types::private::keccak256(out), - ) - } - } - }; - use alloy::contract as alloy_contract; - /**Creates a new wrapper around an on-chain [`MerkleTree`](self) contract instance. - -See the [wrapper's documentation](`MerkleTreeInstance`) for more details.*/ - #[inline] - pub const fn new< - P: alloy_contract::private::Provider, - N: alloy_contract::private::Network, - >( - address: alloy_sol_types::private::Address, - __provider: P, - ) -> MerkleTreeInstance { - MerkleTreeInstance::::new(address, __provider) - } - /**A [`MerkleTree`](self) instance. - -Contains type-safe methods for interacting with an on-chain instance of the -[`MerkleTree`](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 MerkleTreeInstance { - address: alloy_sol_types::private::Address, - provider: P, - _network: ::core::marker::PhantomData, - } - #[automatically_derived] - impl ::core::fmt::Debug for MerkleTreeInstance { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_tuple("MerkleTreeInstance").field(&self.address).finish() - } - } - /// Instantiation and getters/setters. - impl< - P: alloy_contract::private::Provider, - N: alloy_contract::private::Network, - > MerkleTreeInstance { - /**Creates a new wrapper around an on-chain [`MerkleTree`](self) contract instance. - -See the [wrapper's documentation](`MerkleTreeInstance`) 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, - } - } - /// 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 MerkleTreeInstance<&P, N> { - /// Clones the provider and returns a new instance with the cloned provider. - #[inline] - pub fn with_cloned_provider(self) -> MerkleTreeInstance { - MerkleTreeInstance { - address: self.address, - provider: ::core::clone::Clone::clone(&self.provider), - _network: ::core::marker::PhantomData, - } - } - } - /// Function calls. - impl< - P: alloy_contract::private::Provider, - N: alloy_contract::private::Network, - > MerkleTreeInstance { - /// 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( - &self, - call: &C, - ) -> alloy_contract::SolCallBuilder<&P, C, N> { - alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call) - } - } - /// Event filters. - impl< - P: alloy_contract::private::Provider, - N: alloy_contract::private::Network, - > MerkleTreeInstance { - /// 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( - &self, - ) -> alloy_contract::Event<&P, E, N> { - alloy_contract::Event::new_sol(&self.provider, &self.address) - } - } -} -/** - -Generated by the following Solidity interface... -```solidity -library IBridge { - struct TokenLimits { - uint256 minAmount; - uint256 deposit; - uint256 claim; - } - struct TokenUsage { - uint256 consumed; - uint256 lastUpdated; - } -} - -library MerkleTree { - struct MultiProof { - bytes32[] path; - bool[] flags; - } -} - -interface BridgeDepositWithdraw { - error AccessControlBadConfirmation(); - error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); - error ContractMigrated(); - error DailyLimitExhausted(); - error EnforcedPause(); - error ExpectedPause(); - error InvalidBridgeContract(); - error InvalidToAddress(); - error InvalidTokenAmount(); - error InvalidTokenConfig(); - error MirrorTokenNotFound(); - error NativeDepositNotSupported(); - error RequestAlreadyProcessed(); - error SafeERC20FailedOperation(address token); - - event Claim(bytes32 indexed id, address mirrorToken, address token, uint256 amount, address indexed to); - event Deposit(bytes32 indexed id, address indexed token, uint256 amount, address indexed to); - event Paused(address account); - event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); - event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); - event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); - event Unpaused(address account); - - constructor(address _podRegistry, address _bridgeContract); - - function DEFAULT_ADMIN_ROLE() external view returns (bytes32); - function PAUSER_ROLE() external view returns (bytes32); - function bridgeContract() external view returns (address); - function claim(address token, uint256 amount, address to, uint64 committeeEpoch, bytes memory aggregatedSignatures, MerkleTree.MultiProof memory proof) external; - function configureToken(address token, IBridge.TokenLimits memory limits) external; - function deposit(address token, uint256 amount, address to) external payable returns (bytes32); - function depositIndex() external view returns (uint256); - function getRoleAdmin(bytes32 role) external view returns (bytes32); - function grantRole(bytes32 role, address account) external; - function hasRole(bytes32 role, address account) external view returns (bool); - function migrate(address _newContract) external; - function migratedContract() external view returns (address); - function mirrorTokens(address) external view returns (address); - function pause() external; - function paused() external view returns (bool); - function podConfig() external view returns (uint8 thresholdNumerator, uint8 thresholdDenominator, address registry); - function processedRequests(bytes32) external view returns (bool); - function renounceRole(bytes32 role, address callerConfirmation) external; - function revokeRole(bytes32 role, address account) external; - function supportsInterface(bytes4 interfaceId) external view returns (bool); - function tokenData(address) external view returns (IBridge.TokenLimits memory limits, IBridge.TokenUsage memory deposit, IBridge.TokenUsage memory claim); - function unpause() external; - function whiteListToken(address token, address mirrorToken, IBridge.TokenLimits memory limits) external; - function whitelistedTokens(uint256) external view returns (address); -} -``` - -...which was generated by the following JSON ABI: -```json -[ - { - "type": "constructor", - "inputs": [ - { - "name": "_podRegistry", - "type": "address", - "internalType": "address" - }, - { - "name": "_bridgeContract", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "DEFAULT_ADMIN_ROLE", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "PAUSER_ROLE", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "bridgeContract", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "claim", - "inputs": [ - { - "name": "token", - "type": "address", - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "to", - "type": "address", - "internalType": "address" - }, - { - "name": "committeeEpoch", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "aggregatedSignatures", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "proof", - "type": "tuple", - "internalType": "struct MerkleTree.MultiProof", - "components": [ - { - "name": "path", - "type": "bytes32[]", - "internalType": "bytes32[]" - }, - { - "name": "flags", - "type": "bool[]", - "internalType": "bool[]" - } - ] - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "configureToken", - "inputs": [ - { - "name": "token", - "type": "address", - "internalType": "address" - }, - { - "name": "limits", - "type": "tuple", - "internalType": "struct IBridge.TokenLimits", - "components": [ - { - "name": "minAmount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "deposit", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "claim", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "deposit", - "inputs": [ - { - "name": "token", - "type": "address", - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "to", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "payable" - }, - { - "type": "function", - "name": "depositIndex", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getRoleAdmin", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "grantRole", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "account", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "hasRole", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "account", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "migrate", - "inputs": [ - { - "name": "_newContract", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "migratedContract", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "mirrorTokens", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "pause", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "paused", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "podConfig", - "inputs": [], - "outputs": [ - { - "name": "thresholdNumerator", - "type": "uint8", - "internalType": "uint8" - }, - { - "name": "thresholdDenominator", - "type": "uint8", - "internalType": "uint8" - }, - { - "name": "registry", - "type": "address", - "internalType": "contract IPodRegistry" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "processedRequests", - "inputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "renounceRole", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "callerConfirmation", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "revokeRole", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "account", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "supportsInterface", - "inputs": [ - { - "name": "interfaceId", - "type": "bytes4", - "internalType": "bytes4" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "tokenData", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "limits", - "type": "tuple", - "internalType": "struct IBridge.TokenLimits", - "components": [ - { - "name": "minAmount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "deposit", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "claim", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "name": "deposit", - "type": "tuple", - "internalType": "struct IBridge.TokenUsage", - "components": [ - { - "name": "consumed", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "lastUpdated", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "name": "claim", - "type": "tuple", - "internalType": "struct IBridge.TokenUsage", - "components": [ - { - "name": "consumed", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "lastUpdated", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "unpause", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "whiteListToken", - "inputs": [ - { - "name": "token", - "type": "address", - "internalType": "address" - }, - { - "name": "mirrorToken", - "type": "address", - "internalType": "address" - }, - { - "name": "limits", - "type": "tuple", - "internalType": "struct IBridge.TokenLimits", - "components": [ - { - "name": "minAmount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "deposit", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "claim", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "whitelistedTokens", - "inputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "event", - "name": "Claim", - "inputs": [ - { - "name": "id", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "mirrorToken", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "token", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "to", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Deposit", - "inputs": [ - { - "name": "id", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "token", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "to", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Paused", - "inputs": [ - { - "name": "account", - "type": "address", - "indexed": false, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "RoleAdminChanged", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "previousAdminRole", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "newAdminRole", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "RoleGranted", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "account", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "sender", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "RoleRevoked", - "inputs": [ - { - "name": "role", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "account", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "sender", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Unpaused", - "inputs": [ - { - "name": "account", - "type": "address", - "indexed": false, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "error", - "name": "AccessControlBadConfirmation", - "inputs": [] - }, - { - "type": "error", - "name": "AccessControlUnauthorizedAccount", - "inputs": [ - { - "name": "account", - "type": "address", - "internalType": "address" - }, - { - "name": "neededRole", - "type": "bytes32", - "internalType": "bytes32" - } - ] - }, - { - "type": "error", - "name": "ContractMigrated", - "inputs": [] - }, - { - "type": "error", - "name": "DailyLimitExhausted", - "inputs": [] - }, - { - "type": "error", - "name": "EnforcedPause", - "inputs": [] - }, - { - "type": "error", - "name": "ExpectedPause", - "inputs": [] - }, - { - "type": "error", - "name": "InvalidBridgeContract", - "inputs": [] - }, - { - "type": "error", - "name": "InvalidToAddress", - "inputs": [] - }, - { - "type": "error", - "name": "InvalidTokenAmount", - "inputs": [] - }, - { - "type": "error", - "name": "InvalidTokenConfig", - "inputs": [] - }, - { - "type": "error", - "name": "MirrorTokenNotFound", - "inputs": [] - }, - { - "type": "error", - "name": "NativeDepositNotSupported", - "inputs": [] - }, - { - "type": "error", - "name": "RequestAlreadyProcessed", - "inputs": [] - }, - { - "type": "error", - "name": "SafeERC20FailedOperation", - "inputs": [ - { - "name": "token", - "type": "address", - "internalType": "address" - } - ] - } -] -```*/ -#[allow( - non_camel_case_types, - non_snake_case, - clippy::pub_underscore_fields, - clippy::style, - clippy::empty_structs_with_brackets -)] -pub mod BridgeDepositWithdraw { - use super::*; - use alloy::sol_types as alloy_sol_types; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `AccessControlBadConfirmation()` and selector `0x6697b232`. -```solidity -error AccessControlBadConfirmation(); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct AccessControlBadConfirmation; - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: AccessControlBadConfirmation) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for AccessControlBadConfirmation { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for AccessControlBadConfirmation { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "AccessControlBadConfirmation()"; - const SELECTOR: [u8; 4] = [102u8, 151u8, 178u8, 50u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `AccessControlUnauthorizedAccount(address,bytes32)` and selector `0xe2517d3f`. -```solidity -error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct AccessControlUnauthorizedAccount { - #[allow(missing_docs)] - pub account: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub neededRole: alloy::sol_types::private::FixedBytes<32>, - } - #[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::Address, - alloy::sol_types::sol_data::FixedBytes<32>, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::Address, - alloy::sol_types::private::FixedBytes<32>, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: AccessControlUnauthorizedAccount) -> Self { - (value.account, value.neededRole) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for AccessControlUnauthorizedAccount { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - account: tuple.0, - neededRole: tuple.1, - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for AccessControlUnauthorizedAccount { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "AccessControlUnauthorizedAccount(address,bytes32)"; - const SELECTOR: [u8; 4] = [226u8, 81u8, 125u8, 63u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - ::tokenize( - &self.account, - ), - as alloy_sol_types::SolType>::tokenize(&self.neededRole), - ) - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `ContractMigrated()` and selector `0x3f4f6896`. -```solidity -error ContractMigrated(); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct ContractMigrated; - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: ContractMigrated) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for ContractMigrated { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for ContractMigrated { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "ContractMigrated()"; - const SELECTOR: [u8; 4] = [63u8, 79u8, 104u8, 150u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `DailyLimitExhausted()` and selector `0xbdc4df72`. -```solidity -error DailyLimitExhausted(); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct DailyLimitExhausted; - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: DailyLimitExhausted) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for DailyLimitExhausted { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for DailyLimitExhausted { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "DailyLimitExhausted()"; - const SELECTOR: [u8; 4] = [189u8, 196u8, 223u8, 114u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `EnforcedPause()` and selector `0xd93c0665`. -```solidity -error EnforcedPause(); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct EnforcedPause; - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: EnforcedPause) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for EnforcedPause { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for EnforcedPause { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "EnforcedPause()"; - const SELECTOR: [u8; 4] = [217u8, 60u8, 6u8, 101u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `ExpectedPause()` and selector `0x8dfc202b`. -```solidity -error ExpectedPause(); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct ExpectedPause; - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: ExpectedPause) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for ExpectedPause { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for ExpectedPause { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "ExpectedPause()"; - const SELECTOR: [u8; 4] = [141u8, 252u8, 32u8, 43u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `InvalidBridgeContract()` and selector `0x66da8037`. -```solidity -error InvalidBridgeContract(); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct InvalidBridgeContract; - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: InvalidBridgeContract) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for InvalidBridgeContract { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for InvalidBridgeContract { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "InvalidBridgeContract()"; - const SELECTOR: [u8; 4] = [102u8, 218u8, 128u8, 55u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `InvalidToAddress()` and selector `0x8aa3a72f`. -```solidity -error InvalidToAddress(); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct InvalidToAddress; - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: InvalidToAddress) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for InvalidToAddress { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for InvalidToAddress { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "InvalidToAddress()"; - const SELECTOR: [u8; 4] = [138u8, 163u8, 167u8, 47u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `InvalidTokenAmount()` and selector `0x21607339`. -```solidity -error InvalidTokenAmount(); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct InvalidTokenAmount; - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: InvalidTokenAmount) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for InvalidTokenAmount { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for InvalidTokenAmount { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "InvalidTokenAmount()"; - const SELECTOR: [u8; 4] = [33u8, 96u8, 115u8, 57u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `InvalidTokenConfig()` and selector `0x07fe7bae`. -```solidity -error InvalidTokenConfig(); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct InvalidTokenConfig; - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: InvalidTokenConfig) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for InvalidTokenConfig { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for InvalidTokenConfig { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "InvalidTokenConfig()"; - const SELECTOR: [u8; 4] = [7u8, 254u8, 123u8, 174u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `MirrorTokenNotFound()` and selector `0xa8ddb64d`. -```solidity -error MirrorTokenNotFound(); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct MirrorTokenNotFound; - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: MirrorTokenNotFound) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for MirrorTokenNotFound { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for MirrorTokenNotFound { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "MirrorTokenNotFound()"; - const SELECTOR: [u8; 4] = [168u8, 221u8, 182u8, 77u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `NativeDepositNotSupported()` and selector `0x926249b3`. -```solidity -error NativeDepositNotSupported(); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct NativeDepositNotSupported; - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: NativeDepositNotSupported) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for NativeDepositNotSupported { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for NativeDepositNotSupported { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "NativeDepositNotSupported()"; - const SELECTOR: [u8; 4] = [146u8, 98u8, 73u8, 179u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `RequestAlreadyProcessed()` and selector `0xa6bc74c4`. -```solidity -error RequestAlreadyProcessed(); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct RequestAlreadyProcessed; - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: RequestAlreadyProcessed) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for RequestAlreadyProcessed { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for RequestAlreadyProcessed { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "RequestAlreadyProcessed()"; - const SELECTOR: [u8; 4] = [166u8, 188u8, 116u8, 196u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Custom error with signature `SafeERC20FailedOperation(address)` and selector `0x5274afe7`. -```solidity -error SafeERC20FailedOperation(address token); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct SafeERC20FailedOperation { - #[allow(missing_docs)] - pub token: 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> = (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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: SafeERC20FailedOperation) -> Self { - (value.token,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for SafeERC20FailedOperation { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { token: tuple.0 } - } - } - #[automatically_derived] - impl alloy_sol_types::SolError for SafeERC20FailedOperation { - type Parameters<'a> = UnderlyingSolTuple<'a>; - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "SafeERC20FailedOperation(address)"; - const SELECTOR: [u8; 4] = [82u8, 116u8, 175u8, 231u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - ::tokenize( - &self.token, - ), - ) - } - #[inline] - fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Self::new) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Event with signature `Claim(bytes32,address,address,uint256,address)` and selector `0xa0b99c0fdfc395724d7b81a88a6d74852461f7691371afe2839bb8688475788c`. -```solidity -event Claim(bytes32 indexed id, address mirrorToken, address token, uint256 amount, address indexed to); -```*/ - #[allow( - non_camel_case_types, - non_snake_case, - clippy::pub_underscore_fields, - clippy::style - )] - #[derive(Clone)] - pub struct Claim { - #[allow(missing_docs)] - pub id: alloy::sol_types::private::FixedBytes<32>, - #[allow(missing_docs)] - pub mirrorToken: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub token: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub amount: alloy::sol_types::private::primitives::aliases::U256, - #[allow(missing_docs)] - pub to: 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; - #[automatically_derived] - impl alloy_sol_types::SolEvent for Claim { - type DataTuple<'a> = ( - alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Uint<256>, - ); - type DataToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - type TopicList = ( - alloy_sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::Address, - ); - const SIGNATURE: &'static str = "Claim(bytes32,address,address,uint256,address)"; - const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([ - 160u8, 185u8, 156u8, 15u8, 223u8, 195u8, 149u8, 114u8, 77u8, 123u8, - 129u8, 168u8, 138u8, 109u8, 116u8, 133u8, 36u8, 97u8, 247u8, 105u8, 19u8, - 113u8, 175u8, 226u8, 131u8, 155u8, 184u8, 104u8, 132u8, 117u8, 120u8, - 140u8, - ]); - const ANONYMOUS: bool = false; - #[allow(unused_variables)] - #[inline] - fn new( - topics: ::RustType, - data: as alloy_sol_types::SolType>::RustType, - ) -> Self { - Self { - id: topics.1, - mirrorToken: data.0, - token: data.1, - amount: data.2, - to: topics.2, - } - } - #[inline] - fn check_signature( - topics: &::RustType, - ) -> alloy_sol_types::Result<()> { - if topics.0 != Self::SIGNATURE_HASH { - return Err( - alloy_sol_types::Error::invalid_event_signature_hash( - Self::SIGNATURE, - topics.0, - Self::SIGNATURE_HASH, - ), - ); - } - Ok(()) - } - #[inline] - fn tokenize_body(&self) -> Self::DataToken<'_> { - ( - ::tokenize( - &self.mirrorToken, - ), - ::tokenize( - &self.token, - ), - as alloy_sol_types::SolType>::tokenize(&self.amount), - ) - } - #[inline] - fn topics(&self) -> ::RustType { - (Self::SIGNATURE_HASH.into(), self.id.clone(), self.to.clone()) - } - #[inline] - fn encode_topics_raw( - &self, - out: &mut [alloy_sol_types::abi::token::WordToken], - ) -> alloy_sol_types::Result<()> { - if out.len() < ::COUNT { - return Err(alloy_sol_types::Error::Overrun); - } - out[0usize] = alloy_sol_types::abi::token::WordToken( - Self::SIGNATURE_HASH, - ); - out[1usize] = as alloy_sol_types::EventTopic>::encode_topic(&self.id); - out[2usize] = ::encode_topic( - &self.to, - ); - Ok(()) - } - } - #[automatically_derived] - impl alloy_sol_types::private::IntoLogData for Claim { - fn to_log_data(&self) -> alloy_sol_types::private::LogData { - From::from(self) - } - fn into_log_data(self) -> alloy_sol_types::private::LogData { - From::from(&self) - } - } - #[automatically_derived] - impl From<&Claim> for alloy_sol_types::private::LogData { - #[inline] - fn from(this: &Claim) -> alloy_sol_types::private::LogData { - alloy_sol_types::SolEvent::encode_log_data(this) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Event with signature `Deposit(bytes32,address,uint256,address)` and selector `0xb25817d51bf1faf024f38337136f66fa778e7da5a20888ec58560d655ed82447`. -```solidity -event Deposit(bytes32 indexed id, address indexed token, uint256 amount, address indexed to); -```*/ - #[allow( - non_camel_case_types, - non_snake_case, - clippy::pub_underscore_fields, - clippy::style - )] - #[derive(Clone)] - pub struct Deposit { - #[allow(missing_docs)] - pub id: alloy::sol_types::private::FixedBytes<32>, - #[allow(missing_docs)] - pub token: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub amount: alloy::sol_types::private::primitives::aliases::U256, - #[allow(missing_docs)] - pub to: 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; - #[automatically_derived] - impl alloy_sol_types::SolEvent for Deposit { - type DataTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); - type DataToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - type TopicList = ( - alloy_sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Address, - ); - const SIGNATURE: &'static str = "Deposit(bytes32,address,uint256,address)"; - const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([ - 178u8, 88u8, 23u8, 213u8, 27u8, 241u8, 250u8, 240u8, 36u8, 243u8, 131u8, - 55u8, 19u8, 111u8, 102u8, 250u8, 119u8, 142u8, 125u8, 165u8, 162u8, 8u8, - 136u8, 236u8, 88u8, 86u8, 13u8, 101u8, 94u8, 216u8, 36u8, 71u8, - ]); - const ANONYMOUS: bool = false; - #[allow(unused_variables)] - #[inline] - fn new( - topics: ::RustType, - data: as alloy_sol_types::SolType>::RustType, - ) -> Self { - Self { - id: topics.1, - token: topics.2, - amount: data.0, - to: topics.3, - } - } - #[inline] - fn check_signature( - topics: &::RustType, - ) -> alloy_sol_types::Result<()> { - if topics.0 != Self::SIGNATURE_HASH { - return Err( - alloy_sol_types::Error::invalid_event_signature_hash( - Self::SIGNATURE, - topics.0, - Self::SIGNATURE_HASH, - ), - ); - } - Ok(()) - } - #[inline] - fn tokenize_body(&self) -> Self::DataToken<'_> { - ( - as alloy_sol_types::SolType>::tokenize(&self.amount), - ) - } - #[inline] - fn topics(&self) -> ::RustType { - ( - Self::SIGNATURE_HASH.into(), - self.id.clone(), - self.token.clone(), - self.to.clone(), - ) - } - #[inline] - fn encode_topics_raw( - &self, - out: &mut [alloy_sol_types::abi::token::WordToken], - ) -> alloy_sol_types::Result<()> { - if out.len() < ::COUNT { - return Err(alloy_sol_types::Error::Overrun); - } - out[0usize] = alloy_sol_types::abi::token::WordToken( - Self::SIGNATURE_HASH, - ); - out[1usize] = as alloy_sol_types::EventTopic>::encode_topic(&self.id); - out[2usize] = ::encode_topic( - &self.token, - ); - out[3usize] = ::encode_topic( - &self.to, - ); - Ok(()) - } - } - #[automatically_derived] - impl alloy_sol_types::private::IntoLogData for Deposit { - fn to_log_data(&self) -> alloy_sol_types::private::LogData { - From::from(self) - } - fn into_log_data(self) -> alloy_sol_types::private::LogData { - From::from(&self) - } - } - #[automatically_derived] - impl From<&Deposit> for alloy_sol_types::private::LogData { - #[inline] - fn from(this: &Deposit) -> alloy_sol_types::private::LogData { - alloy_sol_types::SolEvent::encode_log_data(this) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Event with signature `Paused(address)` and selector `0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258`. -```solidity -event Paused(address account); -```*/ - #[allow( - non_camel_case_types, - non_snake_case, - clippy::pub_underscore_fields, - clippy::style - )] - #[derive(Clone)] - pub struct Paused { - #[allow(missing_docs)] - pub account: 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; - #[automatically_derived] - impl alloy_sol_types::SolEvent for Paused { - type DataTuple<'a> = (alloy::sol_types::sol_data::Address,); - type DataToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - type TopicList = (alloy_sol_types::sol_data::FixedBytes<32>,); - const SIGNATURE: &'static str = "Paused(address)"; - const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([ - 98u8, 231u8, 140u8, 234u8, 1u8, 190u8, 227u8, 32u8, 205u8, 78u8, 66u8, - 2u8, 112u8, 181u8, 234u8, 116u8, 0u8, 13u8, 17u8, 176u8, 201u8, 247u8, - 71u8, 84u8, 235u8, 219u8, 252u8, 84u8, 75u8, 5u8, 162u8, 88u8, - ]); - const ANONYMOUS: bool = false; - #[allow(unused_variables)] - #[inline] - fn new( - topics: ::RustType, - data: as alloy_sol_types::SolType>::RustType, - ) -> Self { - Self { account: data.0 } - } - #[inline] - fn check_signature( - topics: &::RustType, - ) -> alloy_sol_types::Result<()> { - if topics.0 != Self::SIGNATURE_HASH { - return Err( - alloy_sol_types::Error::invalid_event_signature_hash( - Self::SIGNATURE, - topics.0, - Self::SIGNATURE_HASH, - ), - ); - } - Ok(()) - } - #[inline] - fn tokenize_body(&self) -> Self::DataToken<'_> { - ( - ::tokenize( - &self.account, - ), - ) - } - #[inline] - fn topics(&self) -> ::RustType { - (Self::SIGNATURE_HASH.into(),) - } - #[inline] - fn encode_topics_raw( - &self, - out: &mut [alloy_sol_types::abi::token::WordToken], - ) -> alloy_sol_types::Result<()> { - if out.len() < ::COUNT { - return Err(alloy_sol_types::Error::Overrun); - } - out[0usize] = alloy_sol_types::abi::token::WordToken( - Self::SIGNATURE_HASH, - ); - Ok(()) - } - } - #[automatically_derived] - impl alloy_sol_types::private::IntoLogData for Paused { - fn to_log_data(&self) -> alloy_sol_types::private::LogData { - From::from(self) - } - fn into_log_data(self) -> alloy_sol_types::private::LogData { - From::from(&self) - } - } - #[automatically_derived] - impl From<&Paused> for alloy_sol_types::private::LogData { - #[inline] - fn from(this: &Paused) -> alloy_sol_types::private::LogData { - alloy_sol_types::SolEvent::encode_log_data(this) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Event with signature `RoleAdminChanged(bytes32,bytes32,bytes32)` and selector `0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff`. -```solidity -event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); -```*/ - #[allow( - non_camel_case_types, - non_snake_case, - clippy::pub_underscore_fields, - clippy::style - )] - #[derive(Clone)] - pub struct RoleAdminChanged { - #[allow(missing_docs)] - pub role: alloy::sol_types::private::FixedBytes<32>, - #[allow(missing_docs)] - pub previousAdminRole: alloy::sol_types::private::FixedBytes<32>, - #[allow(missing_docs)] - pub newAdminRole: alloy::sol_types::private::FixedBytes<32>, - } - #[allow( - non_camel_case_types, - non_snake_case, - clippy::pub_underscore_fields, - clippy::style - )] - const _: () = { - use alloy::sol_types as alloy_sol_types; - #[automatically_derived] - impl alloy_sol_types::SolEvent for RoleAdminChanged { - type DataTuple<'a> = (); - type DataToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - type TopicList = ( - alloy_sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::FixedBytes<32>, - ); - const SIGNATURE: &'static str = "RoleAdminChanged(bytes32,bytes32,bytes32)"; - const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([ - 189u8, 121u8, 184u8, 111u8, 254u8, 10u8, 184u8, 232u8, 119u8, 97u8, 81u8, - 81u8, 66u8, 23u8, 205u8, 124u8, 172u8, 213u8, 44u8, 144u8, 159u8, 102u8, - 71u8, 92u8, 58u8, 244u8, 78u8, 18u8, 159u8, 11u8, 0u8, 255u8, - ]); - const ANONYMOUS: bool = false; - #[allow(unused_variables)] - #[inline] - fn new( - topics: ::RustType, - data: as alloy_sol_types::SolType>::RustType, - ) -> Self { - Self { - role: topics.1, - previousAdminRole: topics.2, - newAdminRole: topics.3, - } - } - #[inline] - fn check_signature( - topics: &::RustType, - ) -> alloy_sol_types::Result<()> { - if topics.0 != Self::SIGNATURE_HASH { - return Err( - alloy_sol_types::Error::invalid_event_signature_hash( - Self::SIGNATURE, - topics.0, - Self::SIGNATURE_HASH, - ), - ); - } - Ok(()) - } - #[inline] - fn tokenize_body(&self) -> Self::DataToken<'_> { - () - } - #[inline] - fn topics(&self) -> ::RustType { - ( - Self::SIGNATURE_HASH.into(), - self.role.clone(), - self.previousAdminRole.clone(), - self.newAdminRole.clone(), - ) - } - #[inline] - fn encode_topics_raw( - &self, - out: &mut [alloy_sol_types::abi::token::WordToken], - ) -> alloy_sol_types::Result<()> { - if out.len() < ::COUNT { - return Err(alloy_sol_types::Error::Overrun); - } - out[0usize] = alloy_sol_types::abi::token::WordToken( - Self::SIGNATURE_HASH, - ); - out[1usize] = as alloy_sol_types::EventTopic>::encode_topic(&self.role); - out[2usize] = as alloy_sol_types::EventTopic>::encode_topic(&self.previousAdminRole); - out[3usize] = as alloy_sol_types::EventTopic>::encode_topic(&self.newAdminRole); - Ok(()) - } - } - #[automatically_derived] - impl alloy_sol_types::private::IntoLogData for RoleAdminChanged { - fn to_log_data(&self) -> alloy_sol_types::private::LogData { - From::from(self) - } - fn into_log_data(self) -> alloy_sol_types::private::LogData { - From::from(&self) - } - } - #[automatically_derived] - impl From<&RoleAdminChanged> for alloy_sol_types::private::LogData { - #[inline] - fn from(this: &RoleAdminChanged) -> alloy_sol_types::private::LogData { - alloy_sol_types::SolEvent::encode_log_data(this) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Event with signature `RoleGranted(bytes32,address,address)` and selector `0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d`. -```solidity -event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); -```*/ - #[allow( - non_camel_case_types, - non_snake_case, - clippy::pub_underscore_fields, - clippy::style - )] - #[derive(Clone)] - pub struct RoleGranted { - #[allow(missing_docs)] - pub role: alloy::sol_types::private::FixedBytes<32>, - #[allow(missing_docs)] - pub account: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub sender: 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; - #[automatically_derived] - impl alloy_sol_types::SolEvent for RoleGranted { - type DataTuple<'a> = (); - type DataToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - type TopicList = ( - alloy_sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Address, - ); - const SIGNATURE: &'static str = "RoleGranted(bytes32,address,address)"; - const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([ - 47u8, 135u8, 136u8, 17u8, 126u8, 126u8, 255u8, 29u8, 130u8, 233u8, 38u8, - 236u8, 121u8, 73u8, 1u8, 209u8, 124u8, 120u8, 2u8, 74u8, 80u8, 39u8, 9u8, - 64u8, 48u8, 69u8, 64u8, 167u8, 51u8, 101u8, 111u8, 13u8, - ]); - const ANONYMOUS: bool = false; - #[allow(unused_variables)] - #[inline] - fn new( - topics: ::RustType, - data: as alloy_sol_types::SolType>::RustType, - ) -> Self { - Self { - role: topics.1, - account: topics.2, - sender: topics.3, - } - } - #[inline] - fn check_signature( - topics: &::RustType, - ) -> alloy_sol_types::Result<()> { - if topics.0 != Self::SIGNATURE_HASH { - return Err( - alloy_sol_types::Error::invalid_event_signature_hash( - Self::SIGNATURE, - topics.0, - Self::SIGNATURE_HASH, - ), - ); - } - Ok(()) - } - #[inline] - fn tokenize_body(&self) -> Self::DataToken<'_> { - () - } - #[inline] - fn topics(&self) -> ::RustType { - ( - Self::SIGNATURE_HASH.into(), - self.role.clone(), - self.account.clone(), - self.sender.clone(), - ) - } - #[inline] - fn encode_topics_raw( - &self, - out: &mut [alloy_sol_types::abi::token::WordToken], - ) -> alloy_sol_types::Result<()> { - if out.len() < ::COUNT { - return Err(alloy_sol_types::Error::Overrun); - } - out[0usize] = alloy_sol_types::abi::token::WordToken( - Self::SIGNATURE_HASH, - ); - out[1usize] = as alloy_sol_types::EventTopic>::encode_topic(&self.role); - out[2usize] = ::encode_topic( - &self.account, - ); - out[3usize] = ::encode_topic( - &self.sender, - ); - Ok(()) - } - } - #[automatically_derived] - impl alloy_sol_types::private::IntoLogData for RoleGranted { - fn to_log_data(&self) -> alloy_sol_types::private::LogData { - From::from(self) - } - fn into_log_data(self) -> alloy_sol_types::private::LogData { - From::from(&self) - } - } - #[automatically_derived] - impl From<&RoleGranted> for alloy_sol_types::private::LogData { - #[inline] - fn from(this: &RoleGranted) -> alloy_sol_types::private::LogData { - alloy_sol_types::SolEvent::encode_log_data(this) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Event with signature `RoleRevoked(bytes32,address,address)` and selector `0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b`. -```solidity -event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); -```*/ - #[allow( - non_camel_case_types, - non_snake_case, - clippy::pub_underscore_fields, - clippy::style - )] - #[derive(Clone)] - pub struct RoleRevoked { - #[allow(missing_docs)] - pub role: alloy::sol_types::private::FixedBytes<32>, - #[allow(missing_docs)] - pub account: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub sender: 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; - #[automatically_derived] - impl alloy_sol_types::SolEvent for RoleRevoked { - type DataTuple<'a> = (); - type DataToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - type TopicList = ( - alloy_sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Address, - ); - const SIGNATURE: &'static str = "RoleRevoked(bytes32,address,address)"; - const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([ - 246u8, 57u8, 31u8, 92u8, 50u8, 217u8, 198u8, 157u8, 42u8, 71u8, 234u8, - 103u8, 11u8, 68u8, 41u8, 116u8, 181u8, 57u8, 53u8, 209u8, 237u8, 199u8, - 253u8, 100u8, 235u8, 33u8, 224u8, 71u8, 168u8, 57u8, 23u8, 27u8, - ]); - const ANONYMOUS: bool = false; - #[allow(unused_variables)] - #[inline] - fn new( - topics: ::RustType, - data: as alloy_sol_types::SolType>::RustType, - ) -> Self { - Self { - role: topics.1, - account: topics.2, - sender: topics.3, - } - } - #[inline] - fn check_signature( - topics: &::RustType, - ) -> alloy_sol_types::Result<()> { - if topics.0 != Self::SIGNATURE_HASH { - return Err( - alloy_sol_types::Error::invalid_event_signature_hash( - Self::SIGNATURE, - topics.0, - Self::SIGNATURE_HASH, - ), - ); - } - Ok(()) - } - #[inline] - fn tokenize_body(&self) -> Self::DataToken<'_> { - () - } - #[inline] - fn topics(&self) -> ::RustType { - ( - Self::SIGNATURE_HASH.into(), - self.role.clone(), - self.account.clone(), - self.sender.clone(), - ) - } - #[inline] - fn encode_topics_raw( - &self, - out: &mut [alloy_sol_types::abi::token::WordToken], - ) -> alloy_sol_types::Result<()> { - if out.len() < ::COUNT { - return Err(alloy_sol_types::Error::Overrun); - } - out[0usize] = alloy_sol_types::abi::token::WordToken( - Self::SIGNATURE_HASH, - ); - out[1usize] = as alloy_sol_types::EventTopic>::encode_topic(&self.role); - out[2usize] = ::encode_topic( - &self.account, - ); - out[3usize] = ::encode_topic( - &self.sender, - ); - Ok(()) - } - } - #[automatically_derived] - impl alloy_sol_types::private::IntoLogData for RoleRevoked { - fn to_log_data(&self) -> alloy_sol_types::private::LogData { - From::from(self) - } - fn into_log_data(self) -> alloy_sol_types::private::LogData { - From::from(&self) - } - } - #[automatically_derived] - impl From<&RoleRevoked> for alloy_sol_types::private::LogData { - #[inline] - fn from(this: &RoleRevoked) -> alloy_sol_types::private::LogData { - alloy_sol_types::SolEvent::encode_log_data(this) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Event with signature `Unpaused(address)` and selector `0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa`. -```solidity -event Unpaused(address account); -```*/ - #[allow( - non_camel_case_types, - non_snake_case, - clippy::pub_underscore_fields, - clippy::style - )] - #[derive(Clone)] - pub struct Unpaused { - #[allow(missing_docs)] - pub account: 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; - #[automatically_derived] - impl alloy_sol_types::SolEvent for Unpaused { - type DataTuple<'a> = (alloy::sol_types::sol_data::Address,); - type DataToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - type TopicList = (alloy_sol_types::sol_data::FixedBytes<32>,); - const SIGNATURE: &'static str = "Unpaused(address)"; - const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([ - 93u8, 185u8, 238u8, 10u8, 73u8, 91u8, 242u8, 230u8, 255u8, 156u8, 145u8, - 167u8, 131u8, 76u8, 27u8, 164u8, 253u8, 210u8, 68u8, 165u8, 232u8, 170u8, - 78u8, 83u8, 123u8, 211u8, 138u8, 234u8, 228u8, 176u8, 115u8, 170u8, - ]); - const ANONYMOUS: bool = false; - #[allow(unused_variables)] - #[inline] - fn new( - topics: ::RustType, - data: as alloy_sol_types::SolType>::RustType, - ) -> Self { - Self { account: data.0 } - } - #[inline] - fn check_signature( - topics: &::RustType, - ) -> alloy_sol_types::Result<()> { - if topics.0 != Self::SIGNATURE_HASH { - return Err( - alloy_sol_types::Error::invalid_event_signature_hash( - Self::SIGNATURE, - topics.0, - Self::SIGNATURE_HASH, - ), - ); - } - Ok(()) - } - #[inline] - fn tokenize_body(&self) -> Self::DataToken<'_> { - ( - ::tokenize( - &self.account, - ), - ) - } - #[inline] - fn topics(&self) -> ::RustType { - (Self::SIGNATURE_HASH.into(),) - } - #[inline] - fn encode_topics_raw( - &self, - out: &mut [alloy_sol_types::abi::token::WordToken], - ) -> alloy_sol_types::Result<()> { - if out.len() < ::COUNT { - return Err(alloy_sol_types::Error::Overrun); - } - out[0usize] = alloy_sol_types::abi::token::WordToken( - Self::SIGNATURE_HASH, - ); - Ok(()) - } - } - #[automatically_derived] - impl alloy_sol_types::private::IntoLogData for Unpaused { - fn to_log_data(&self) -> alloy_sol_types::private::LogData { - From::from(self) - } - fn into_log_data(self) -> alloy_sol_types::private::LogData { - From::from(&self) - } - } - #[automatically_derived] - impl From<&Unpaused> for alloy_sol_types::private::LogData { - #[inline] - fn from(this: &Unpaused) -> alloy_sol_types::private::LogData { - alloy_sol_types::SolEvent::encode_log_data(this) - } - } - }; - /**Constructor`. -```solidity -constructor(address _podRegistry, address _bridgeContract); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct constructorCall { - #[allow(missing_docs)] - pub _podRegistry: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub _bridgeContract: 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, - alloy::sol_types::sol_data::Address, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::Address, - alloy::sol_types::private::Address, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: constructorCall) -> Self { - (value._podRegistry, value._bridgeContract) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for constructorCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - _podRegistry: tuple.0, - _bridgeContract: tuple.1, - } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolConstructor for constructorCall { - type Parameters<'a> = ( - alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Address, - ); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - ::tokenize( - &self._podRegistry, - ), - ::tokenize( - &self._bridgeContract, - ), - ) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `DEFAULT_ADMIN_ROLE()` and selector `0xa217fddf`. -```solidity -function DEFAULT_ADMIN_ROLE() external view returns (bytes32); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct DEFAULT_ADMIN_ROLECall; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`DEFAULT_ADMIN_ROLE()`](DEFAULT_ADMIN_ROLECall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct DEFAULT_ADMIN_ROLEReturn { - #[allow(missing_docs)] - pub _0: alloy::sol_types::private::FixedBytes<32>, - } - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: DEFAULT_ADMIN_ROLECall) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for DEFAULT_ADMIN_ROLECall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - } - { - #[doc(hidden)] - #[allow(dead_code)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<32>,); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: DEFAULT_ADMIN_ROLEReturn) -> Self { - (value._0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for DEFAULT_ADMIN_ROLEReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for DEFAULT_ADMIN_ROLECall { - type Parameters<'a> = (); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = alloy::sol_types::private::FixedBytes<32>; - type ReturnTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "DEFAULT_ADMIN_ROLE()"; - const SELECTOR: [u8; 4] = [162u8, 23u8, 253u8, 223u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - ( - as alloy_sol_types::SolType>::tokenize(ret), - ) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: DEFAULT_ADMIN_ROLEReturn = r.into(); - r._0 - }) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: DEFAULT_ADMIN_ROLEReturn = r.into(); - r._0 - }) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `PAUSER_ROLE()` and selector `0xe63ab1e9`. -```solidity -function PAUSER_ROLE() external view returns (bytes32); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct PAUSER_ROLECall; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`PAUSER_ROLE()`](PAUSER_ROLECall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct PAUSER_ROLEReturn { - #[allow(missing_docs)] - pub _0: alloy::sol_types::private::FixedBytes<32>, - } - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: PAUSER_ROLECall) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for PAUSER_ROLECall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - } - { - #[doc(hidden)] - #[allow(dead_code)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<32>,); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: PAUSER_ROLEReturn) -> Self { - (value._0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for PAUSER_ROLEReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for PAUSER_ROLECall { - type Parameters<'a> = (); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = alloy::sol_types::private::FixedBytes<32>; - type ReturnTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "PAUSER_ROLE()"; - const SELECTOR: [u8; 4] = [230u8, 58u8, 177u8, 233u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - ( - as alloy_sol_types::SolType>::tokenize(ret), - ) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: PAUSER_ROLEReturn = r.into(); - r._0 - }) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: PAUSER_ROLEReturn = r.into(); - r._0 - }) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `bridgeContract()` and selector `0xcd596583`. -```solidity -function bridgeContract() external view returns (address); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct bridgeContractCall; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`bridgeContract()`](bridgeContractCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct bridgeContractReturn { - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: bridgeContractCall) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for bridgeContractCall { - 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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: bridgeContractReturn) -> Self { - (value._0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for bridgeContractReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for bridgeContractCall { - type Parameters<'a> = (); - type Token<'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> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "bridgeContract()"; - const SELECTOR: [u8; 4] = [205u8, 89u8, 101u8, 131u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - ( - ::tokenize( - ret, - ), - ) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: bridgeContractReturn = r.into(); - r._0 - }) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: bridgeContractReturn = r.into(); - r._0 - }) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `claim(address,uint256,address,uint64,bytes,(bytes32[],bool[]))` and selector `0x7683f59e`. -```solidity -function claim(address token, uint256 amount, address to, uint64 committeeEpoch, bytes memory aggregatedSignatures, MerkleTree.MultiProof memory proof) external; -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct claimCall { - #[allow(missing_docs)] - pub token: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub amount: alloy::sol_types::private::primitives::aliases::U256, - #[allow(missing_docs)] - pub to: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub committeeEpoch: u64, - #[allow(missing_docs)] - pub aggregatedSignatures: alloy::sol_types::private::Bytes, - #[allow(missing_docs)] - pub proof: ::RustType, - } - ///Container type for the return parameters of the [`claim(address,uint256,address,uint64,bytes,(bytes32[],bool[]))`](claimCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct claimReturn {} - #[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::Address, - alloy::sol_types::sol_data::Uint<256>, - alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Uint<64>, - alloy::sol_types::sol_data::Bytes, - MerkleTree::MultiProof, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::Address, - alloy::sol_types::private::primitives::aliases::U256, - alloy::sol_types::private::Address, - u64, - alloy::sol_types::private::Bytes, - ::RustType, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: claimCall) -> Self { - ( - value.token, - value.amount, - value.to, - value.committeeEpoch, - value.aggregatedSignatures, - value.proof, - ) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for claimCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - token: tuple.0, - amount: tuple.1, - to: tuple.2, - committeeEpoch: tuple.3, - aggregatedSignatures: tuple.4, - proof: tuple.5, - } - } - } - } - { - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: claimReturn) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for claimReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self {} - } - } - } - impl claimReturn { - fn _tokenize( - &self, - ) -> ::ReturnToken<'_> { - () - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for claimCall { - type Parameters<'a> = ( - alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Uint<256>, - alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Uint<64>, - alloy::sol_types::sol_data::Bytes, - MerkleTree::MultiProof, - ); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = claimReturn; - type ReturnTuple<'a> = (); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "claim(address,uint256,address,uint64,bytes,(bytes32[],bool[]))"; - const SELECTOR: [u8; 4] = [118u8, 131u8, 245u8, 158u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - ::tokenize( - &self.token, - ), - as alloy_sol_types::SolType>::tokenize(&self.amount), - ::tokenize( - &self.to, - ), - as alloy_sol_types::SolType>::tokenize(&self.committeeEpoch), - ::tokenize( - &self.aggregatedSignatures, - ), - ::tokenize( - &self.proof, - ), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - claimReturn::_tokenize(ret) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(Into::into) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Into::into) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `configureToken(address,(uint256,uint256,uint256))` and selector `0x9267b153`. -```solidity -function configureToken(address token, IBridge.TokenLimits memory limits) external; -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct configureTokenCall { - #[allow(missing_docs)] - pub token: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub limits: ::RustType, - } - ///Container type for the return parameters of the [`configureToken(address,(uint256,uint256,uint256))`](configureTokenCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct configureTokenReturn {} - #[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::Address, - IBridge::TokenLimits, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::Address, - ::RustType, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: configureTokenCall) -> Self { - (value.token, value.limits) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for configureTokenCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - token: tuple.0, - limits: tuple.1, - } - } - } - } - { - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: configureTokenReturn) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for configureTokenReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self {} - } - } - } - impl configureTokenReturn { - fn _tokenize( - &self, - ) -> ::ReturnToken<'_> { - () - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for configureTokenCall { - type Parameters<'a> = ( - alloy::sol_types::sol_data::Address, - IBridge::TokenLimits, - ); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = configureTokenReturn; - type ReturnTuple<'a> = (); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "configureToken(address,(uint256,uint256,uint256))"; - const SELECTOR: [u8; 4] = [146u8, 103u8, 177u8, 83u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - ::tokenize( - &self.token, - ), - ::tokenize( - &self.limits, - ), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - configureTokenReturn::_tokenize(ret) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(Into::into) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Into::into) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `deposit(address,uint256,address)` and selector `0xf45346dc`. -```solidity -function deposit(address token, uint256 amount, address to) external payable returns (bytes32); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct depositCall { - #[allow(missing_docs)] - pub token: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub amount: alloy::sol_types::private::primitives::aliases::U256, - #[allow(missing_docs)] - pub to: alloy::sol_types::private::Address, - } - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`deposit(address,uint256,address)`](depositCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct depositReturn { - #[allow(missing_docs)] - pub _0: alloy::sol_types::private::FixedBytes<32>, - } - #[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::Address, - alloy::sol_types::sol_data::Uint<256>, - alloy::sol_types::sol_data::Address, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::Address, - alloy::sol_types::private::primitives::aliases::U256, - alloy::sol_types::private::Address, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: depositCall) -> Self { - (value.token, value.amount, value.to) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for depositCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - token: tuple.0, - amount: tuple.1, - to: tuple.2, - } - } - } - } - { - #[doc(hidden)] - #[allow(dead_code)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<32>,); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: depositReturn) -> Self { - (value._0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for depositReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for depositCall { - type Parameters<'a> = ( - alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Uint<256>, - alloy::sol_types::sol_data::Address, - ); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = alloy::sol_types::private::FixedBytes<32>; - type ReturnTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "deposit(address,uint256,address)"; - const SELECTOR: [u8; 4] = [244u8, 83u8, 70u8, 220u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - ::tokenize( - &self.token, - ), - as alloy_sol_types::SolType>::tokenize(&self.amount), - ::tokenize( - &self.to, - ), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - ( - as alloy_sol_types::SolType>::tokenize(ret), - ) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: depositReturn = r.into(); - r._0 - }) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: depositReturn = r.into(); - r._0 - }) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `depositIndex()` and selector `0x7b898939`. -```solidity -function depositIndex() external view returns (uint256); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct depositIndexCall; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`depositIndex()`](depositIndexCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct depositIndexReturn { - #[allow(missing_docs)] - pub _0: 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> = (); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = (); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: depositIndexCall) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for depositIndexCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - } - { - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: depositIndexReturn) -> Self { - (value._0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for depositIndexReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for depositIndexCall { - type Parameters<'a> = (); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = alloy::sol_types::private::primitives::aliases::U256; - type ReturnTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "depositIndex()"; - const SELECTOR: [u8; 4] = [123u8, 137u8, 137u8, 57u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - ( - as alloy_sol_types::SolType>::tokenize(ret), - ) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: depositIndexReturn = r.into(); - r._0 - }) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: depositIndexReturn = r.into(); - r._0 - }) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `getRoleAdmin(bytes32)` and selector `0x248a9ca3`. -```solidity -function getRoleAdmin(bytes32 role) external view returns (bytes32); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct getRoleAdminCall { - #[allow(missing_docs)] - pub role: alloy::sol_types::private::FixedBytes<32>, - } - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`getRoleAdmin(bytes32)`](getRoleAdminCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct getRoleAdminReturn { - #[allow(missing_docs)] - pub _0: alloy::sol_types::private::FixedBytes<32>, - } - #[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::FixedBytes<32>,); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<32>,); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: getRoleAdminCall) -> Self { - (value.role,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for getRoleAdminCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { role: tuple.0 } - } - } - } - { - #[doc(hidden)] - #[allow(dead_code)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<32>,); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: getRoleAdminReturn) -> Self { - (value._0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for getRoleAdminReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for getRoleAdminCall { - type Parameters<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = alloy::sol_types::private::FixedBytes<32>; - type ReturnTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "getRoleAdmin(bytes32)"; - const SELECTOR: [u8; 4] = [36u8, 138u8, 156u8, 163u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - as alloy_sol_types::SolType>::tokenize(&self.role), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - ( - as alloy_sol_types::SolType>::tokenize(ret), - ) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: getRoleAdminReturn = r.into(); - r._0 - }) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: getRoleAdminReturn = r.into(); - r._0 - }) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `grantRole(bytes32,address)` and selector `0x2f2ff15d`. -```solidity -function grantRole(bytes32 role, address account) external; -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct grantRoleCall { - #[allow(missing_docs)] - pub role: alloy::sol_types::private::FixedBytes<32>, - #[allow(missing_docs)] - pub account: alloy::sol_types::private::Address, - } - ///Container type for the return parameters of the [`grantRole(bytes32,address)`](grantRoleCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct grantRoleReturn {} - #[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::FixedBytes<32>, - alloy::sol_types::sol_data::Address, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::FixedBytes<32>, - alloy::sol_types::private::Address, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: grantRoleCall) -> Self { - (value.role, value.account) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for grantRoleCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - role: tuple.0, - account: tuple.1, - } - } - } - } - { - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: grantRoleReturn) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for grantRoleReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self {} - } - } - } - impl grantRoleReturn { - fn _tokenize( - &self, - ) -> ::ReturnToken<'_> { - () - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for grantRoleCall { - type Parameters<'a> = ( - alloy::sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::Address, - ); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = grantRoleReturn; - type ReturnTuple<'a> = (); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "grantRole(bytes32,address)"; - const SELECTOR: [u8; 4] = [47u8, 47u8, 241u8, 93u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - as alloy_sol_types::SolType>::tokenize(&self.role), - ::tokenize( - &self.account, - ), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - grantRoleReturn::_tokenize(ret) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(Into::into) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Into::into) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `hasRole(bytes32,address)` and selector `0x91d14854`. -```solidity -function hasRole(bytes32 role, address account) external view returns (bool); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct hasRoleCall { - #[allow(missing_docs)] - pub role: alloy::sol_types::private::FixedBytes<32>, - #[allow(missing_docs)] - pub account: alloy::sol_types::private::Address, - } - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`hasRole(bytes32,address)`](hasRoleCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct hasRoleReturn { - #[allow(missing_docs)] - pub _0: bool, - } - #[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::FixedBytes<32>, - alloy::sol_types::sol_data::Address, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::FixedBytes<32>, - alloy::sol_types::private::Address, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: hasRoleCall) -> Self { - (value.role, value.account) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for hasRoleCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - role: tuple.0, - account: tuple.1, - } - } - } - } - { - #[doc(hidden)] - #[allow(dead_code)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Bool,); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = (bool,); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: hasRoleReturn) -> Self { - (value._0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for hasRoleReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for hasRoleCall { - type Parameters<'a> = ( - alloy::sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::Address, - ); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = bool; - type ReturnTuple<'a> = (alloy::sol_types::sol_data::Bool,); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "hasRole(bytes32,address)"; - const SELECTOR: [u8; 4] = [145u8, 209u8, 72u8, 84u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - as alloy_sol_types::SolType>::tokenize(&self.role), - ::tokenize( - &self.account, - ), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - ( - ::tokenize( - ret, - ), - ) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: hasRoleReturn = r.into(); - r._0 - }) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: hasRoleReturn = r.into(); - r._0 - }) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `migrate(address)` and selector `0xce5494bb`. -```solidity -function migrate(address _newContract) external; -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct migrateCall { - #[allow(missing_docs)] - pub _newContract: alloy::sol_types::private::Address, - } - ///Container type for the return parameters of the [`migrate(address)`](migrateCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct migrateReturn {} - #[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::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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: migrateCall) -> Self { - (value._newContract,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for migrateCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _newContract: 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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: migrateReturn) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for migrateReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self {} - } - } - } - impl migrateReturn { - fn _tokenize( - &self, - ) -> ::ReturnToken<'_> { - () - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for migrateCall { - type Parameters<'a> = (alloy::sol_types::sol_data::Address,); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = migrateReturn; - type ReturnTuple<'a> = (); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "migrate(address)"; - const SELECTOR: [u8; 4] = [206u8, 84u8, 148u8, 187u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - ::tokenize( - &self._newContract, - ), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - migrateReturn::_tokenize(ret) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(Into::into) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Into::into) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `migratedContract()` and selector `0x7486fa4e`. -```solidity -function migratedContract() external view returns (address); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct migratedContractCall; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`migratedContract()`](migratedContractCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct migratedContractReturn { - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: migratedContractCall) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for migratedContractCall { - 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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: migratedContractReturn) -> Self { - (value._0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for migratedContractReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for migratedContractCall { - type Parameters<'a> = (); - type Token<'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> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "migratedContract()"; - const SELECTOR: [u8; 4] = [116u8, 134u8, 250u8, 78u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - ( - ::tokenize( - ret, - ), - ) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: migratedContractReturn = r.into(); - r._0 - }) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: migratedContractReturn = r.into(); - r._0 - }) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `mirrorTokens(address)` and selector `0xfeaeb43e`. -```solidity -function mirrorTokens(address) external view returns (address); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct mirrorTokensCall(pub alloy::sol_types::private::Address); - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`mirrorTokens(address)`](mirrorTokensCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct mirrorTokensReturn { - #[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> = (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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: mirrorTokensCall) -> Self { - (value.0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for mirrorTokensCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self(tuple.0) - } - } - } - { - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: mirrorTokensReturn) -> Self { - (value._0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for mirrorTokensReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for mirrorTokensCall { - type Parameters<'a> = (alloy::sol_types::sol_data::Address,); - type Token<'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> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "mirrorTokens(address)"; - const SELECTOR: [u8; 4] = [254u8, 174u8, 180u8, 62u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - ::tokenize( - &self.0, - ), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - ( - ::tokenize( - ret, - ), - ) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: mirrorTokensReturn = r.into(); - r._0 - }) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: mirrorTokensReturn = r.into(); - r._0 - }) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `pause()` and selector `0x8456cb59`. -```solidity -function pause() external; -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct pauseCall; - ///Container type for the return parameters of the [`pause()`](pauseCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct pauseReturn {} - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: pauseCall) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for pauseCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - } - { - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: pauseReturn) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for pauseReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self {} - } - } - } - impl pauseReturn { - fn _tokenize( - &self, - ) -> ::ReturnToken<'_> { - () - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for pauseCall { - type Parameters<'a> = (); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = pauseReturn; - type ReturnTuple<'a> = (); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "pause()"; - const SELECTOR: [u8; 4] = [132u8, 86u8, 203u8, 89u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - pauseReturn::_tokenize(ret) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(Into::into) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Into::into) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `paused()` and selector `0x5c975abb`. -```solidity -function paused() external view returns (bool); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct pausedCall; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`paused()`](pausedCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct pausedReturn { - #[allow(missing_docs)] - pub _0: bool, - } - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: pausedCall) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for pausedCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - } - { - #[doc(hidden)] - #[allow(dead_code)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Bool,); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = (bool,); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: pausedReturn) -> Self { - (value._0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for pausedReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for pausedCall { - type Parameters<'a> = (); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = bool; - type ReturnTuple<'a> = (alloy::sol_types::sol_data::Bool,); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "paused()"; - const SELECTOR: [u8; 4] = [92u8, 151u8, 90u8, 187u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - ( - ::tokenize( - ret, - ), - ) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: pausedReturn = r.into(); - r._0 - }) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: pausedReturn = r.into(); - r._0 - }) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `podConfig()` and selector `0xd328613b`. -```solidity -function podConfig() external view returns (uint8 thresholdNumerator, uint8 thresholdDenominator, address registry); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct podConfigCall; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`podConfig()`](podConfigCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct podConfigReturn { - #[allow(missing_docs)] - pub thresholdNumerator: u8, - #[allow(missing_docs)] - pub thresholdDenominator: u8, - #[allow(missing_docs)] - pub registry: 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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: podConfigCall) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for podConfigCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - } - { - #[doc(hidden)] - #[allow(dead_code)] - type UnderlyingSolTuple<'a> = ( - alloy::sol_types::sol_data::Uint<8>, - alloy::sol_types::sol_data::Uint<8>, - alloy::sol_types::sol_data::Address, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = (u8, u8, alloy::sol_types::private::Address); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: podConfigReturn) -> Self { - ( - value.thresholdNumerator, - value.thresholdDenominator, - value.registry, - ) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for podConfigReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - thresholdNumerator: tuple.0, - thresholdDenominator: tuple.1, - registry: tuple.2, - } - } - } - } - impl podConfigReturn { - fn _tokenize( - &self, - ) -> ::ReturnToken<'_> { - ( - as alloy_sol_types::SolType>::tokenize(&self.thresholdNumerator), - as alloy_sol_types::SolType>::tokenize(&self.thresholdDenominator), - ::tokenize( - &self.registry, - ), - ) - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for podConfigCall { - type Parameters<'a> = (); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = podConfigReturn; - type ReturnTuple<'a> = ( - alloy::sol_types::sol_data::Uint<8>, - alloy::sol_types::sol_data::Uint<8>, - alloy::sol_types::sol_data::Address, - ); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "podConfig()"; - const SELECTOR: [u8; 4] = [211u8, 40u8, 97u8, 59u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - podConfigReturn::_tokenize(ret) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(Into::into) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Into::into) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `processedRequests(bytes32)` and selector `0xce0fa5a9`. -```solidity -function processedRequests(bytes32) external view returns (bool); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct processedRequestsCall(pub alloy::sol_types::private::FixedBytes<32>); - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`processedRequests(bytes32)`](processedRequestsCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct processedRequestsReturn { - #[allow(missing_docs)] - pub _0: bool, - } - #[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::FixedBytes<32>,); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<32>,); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: processedRequestsCall) -> Self { - (value.0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for processedRequestsCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self(tuple.0) - } - } - } - { - #[doc(hidden)] - #[allow(dead_code)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Bool,); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = (bool,); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: processedRequestsReturn) -> Self { - (value._0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for processedRequestsReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for processedRequestsCall { - type Parameters<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = bool; - type ReturnTuple<'a> = (alloy::sol_types::sol_data::Bool,); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "processedRequests(bytes32)"; - const SELECTOR: [u8; 4] = [206u8, 15u8, 165u8, 169u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - as alloy_sol_types::SolType>::tokenize(&self.0), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - ( - ::tokenize( - ret, - ), - ) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: processedRequestsReturn = r.into(); - r._0 - }) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: processedRequestsReturn = r.into(); - r._0 - }) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `renounceRole(bytes32,address)` and selector `0x36568abe`. -```solidity -function renounceRole(bytes32 role, address callerConfirmation) external; -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct renounceRoleCall { - #[allow(missing_docs)] - pub role: alloy::sol_types::private::FixedBytes<32>, - #[allow(missing_docs)] - pub callerConfirmation: alloy::sol_types::private::Address, - } - ///Container type for the return parameters of the [`renounceRole(bytes32,address)`](renounceRoleCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct renounceRoleReturn {} - #[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::FixedBytes<32>, - alloy::sol_types::sol_data::Address, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::FixedBytes<32>, - alloy::sol_types::private::Address, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: renounceRoleCall) -> Self { - (value.role, value.callerConfirmation) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for renounceRoleCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - role: tuple.0, - callerConfirmation: tuple.1, - } - } - } - } - { - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: renounceRoleReturn) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for renounceRoleReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self {} - } - } - } - impl renounceRoleReturn { - fn _tokenize( - &self, - ) -> ::ReturnToken<'_> { - () - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for renounceRoleCall { - type Parameters<'a> = ( - alloy::sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::Address, - ); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = renounceRoleReturn; - type ReturnTuple<'a> = (); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "renounceRole(bytes32,address)"; - const SELECTOR: [u8; 4] = [54u8, 86u8, 138u8, 190u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - as alloy_sol_types::SolType>::tokenize(&self.role), - ::tokenize( - &self.callerConfirmation, - ), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - renounceRoleReturn::_tokenize(ret) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(Into::into) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Into::into) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `revokeRole(bytes32,address)` and selector `0xd547741f`. -```solidity -function revokeRole(bytes32 role, address account) external; -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct revokeRoleCall { - #[allow(missing_docs)] - pub role: alloy::sol_types::private::FixedBytes<32>, - #[allow(missing_docs)] - pub account: alloy::sol_types::private::Address, - } - ///Container type for the return parameters of the [`revokeRole(bytes32,address)`](revokeRoleCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct revokeRoleReturn {} - #[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::FixedBytes<32>, - alloy::sol_types::sol_data::Address, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::FixedBytes<32>, - alloy::sol_types::private::Address, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: revokeRoleCall) -> Self { - (value.role, value.account) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for revokeRoleCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - role: tuple.0, - account: tuple.1, - } - } - } - } - { - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: revokeRoleReturn) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for revokeRoleReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self {} - } - } - } - impl revokeRoleReturn { - fn _tokenize( - &self, - ) -> ::ReturnToken<'_> { - () - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for revokeRoleCall { - type Parameters<'a> = ( - alloy::sol_types::sol_data::FixedBytes<32>, - alloy::sol_types::sol_data::Address, - ); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = revokeRoleReturn; - type ReturnTuple<'a> = (); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "revokeRole(bytes32,address)"; - const SELECTOR: [u8; 4] = [213u8, 71u8, 116u8, 31u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - as alloy_sol_types::SolType>::tokenize(&self.role), - ::tokenize( - &self.account, - ), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - revokeRoleReturn::_tokenize(ret) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(Into::into) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Into::into) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `supportsInterface(bytes4)` and selector `0x01ffc9a7`. -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct supportsInterfaceCall { - #[allow(missing_docs)] - pub interfaceId: alloy::sol_types::private::FixedBytes<4>, - } - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`supportsInterface(bytes4)`](supportsInterfaceCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct supportsInterfaceReturn { - #[allow(missing_docs)] - pub _0: bool, - } - #[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::FixedBytes<4>,); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<4>,); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: supportsInterfaceCall) -> Self { - (value.interfaceId,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for supportsInterfaceCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { interfaceId: tuple.0 } - } - } - } - { - #[doc(hidden)] - #[allow(dead_code)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Bool,); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = (bool,); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: supportsInterfaceReturn) -> Self { - (value._0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for supportsInterfaceReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for supportsInterfaceCall { - type Parameters<'a> = (alloy::sol_types::sol_data::FixedBytes<4>,); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = bool; - type ReturnTuple<'a> = (alloy::sol_types::sol_data::Bool,); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "supportsInterface(bytes4)"; - const SELECTOR: [u8; 4] = [1u8, 255u8, 201u8, 167u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - as alloy_sol_types::SolType>::tokenize(&self.interfaceId), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - ( - ::tokenize( - ret, - ), - ) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: supportsInterfaceReturn = r.into(); - r._0 - }) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: supportsInterfaceReturn = r.into(); - r._0 - }) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `tokenData(address)` and selector `0x27e45c2c`. -```solidity -function tokenData(address) external view returns (IBridge.TokenLimits memory limits, IBridge.TokenUsage memory deposit, IBridge.TokenUsage memory claim); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct tokenDataCall(pub alloy::sol_types::private::Address); - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`tokenData(address)`](tokenDataCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct tokenDataReturn { - #[allow(missing_docs)] - pub limits: ::RustType, - #[allow(missing_docs)] - pub deposit: ::RustType, - #[allow(missing_docs)] - pub claim: ::RustType, - } - #[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::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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: tokenDataCall) -> Self { - (value.0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for tokenDataCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self(tuple.0) - } - } - } - { - #[doc(hidden)] - #[allow(dead_code)] - type UnderlyingSolTuple<'a> = ( - IBridge::TokenLimits, - IBridge::TokenUsage, - IBridge::TokenUsage, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - ::RustType, - ::RustType, - ::RustType, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: tokenDataReturn) -> Self { - (value.limits, value.deposit, value.claim) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for tokenDataReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - limits: tuple.0, - deposit: tuple.1, - claim: tuple.2, - } - } - } - } - impl tokenDataReturn { - fn _tokenize( - &self, - ) -> ::ReturnToken<'_> { - ( - ::tokenize( - &self.limits, - ), - ::tokenize( - &self.deposit, - ), - ::tokenize( - &self.claim, - ), - ) - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for tokenDataCall { - type Parameters<'a> = (alloy::sol_types::sol_data::Address,); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = tokenDataReturn; - type ReturnTuple<'a> = ( - IBridge::TokenLimits, - IBridge::TokenUsage, - IBridge::TokenUsage, - ); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "tokenData(address)"; - const SELECTOR: [u8; 4] = [39u8, 228u8, 92u8, 44u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - ::tokenize( - &self.0, - ), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - tokenDataReturn::_tokenize(ret) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(Into::into) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Into::into) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `unpause()` and selector `0x3f4ba83a`. -```solidity -function unpause() external; -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct unpauseCall; - ///Container type for the return parameters of the [`unpause()`](unpauseCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct unpauseReturn {} - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: unpauseCall) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for unpauseCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self - } - } - } - { - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: unpauseReturn) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for unpauseReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self {} - } - } - } - impl unpauseReturn { - fn _tokenize( - &self, - ) -> ::ReturnToken<'_> { - () - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for unpauseCall { - type Parameters<'a> = (); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = unpauseReturn; - type ReturnTuple<'a> = (); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "unpause()"; - const SELECTOR: [u8; 4] = [63u8, 75u8, 168u8, 58u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - () - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - unpauseReturn::_tokenize(ret) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(Into::into) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Into::into) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `whiteListToken(address,address,(uint256,uint256,uint256))` and selector `0xfc5c5cb3`. -```solidity -function whiteListToken(address token, address mirrorToken, IBridge.TokenLimits memory limits) external; -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct whiteListTokenCall { - #[allow(missing_docs)] - pub token: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub mirrorToken: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub limits: ::RustType, - } - ///Container type for the return parameters of the [`whiteListToken(address,address,(uint256,uint256,uint256))`](whiteListTokenCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct whiteListTokenReturn {} - #[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::Address, - alloy::sol_types::sol_data::Address, - IBridge::TokenLimits, - ); - #[doc(hidden)] - type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::Address, - alloy::sol_types::private::Address, - ::RustType, - ); - #[cfg(test)] - #[allow(dead_code, unreachable_patterns)] - fn _type_assertion( - _t: alloy_sol_types::private::AssertTypeEq, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: whiteListTokenCall) -> Self { - (value.token, value.mirrorToken, value.limits) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> for whiteListTokenCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { - token: tuple.0, - mirrorToken: tuple.1, - limits: tuple.2, - } - } - } - } - { - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: whiteListTokenReturn) -> Self { - () - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for whiteListTokenReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self {} - } - } - } - impl whiteListTokenReturn { - fn _tokenize( - &self, - ) -> ::ReturnToken<'_> { - () - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for whiteListTokenCall { - type Parameters<'a> = ( - alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Address, - IBridge::TokenLimits, - ); - type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = whiteListTokenReturn; - type ReturnTuple<'a> = (); - type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "whiteListToken(address,address,(uint256,uint256,uint256))"; - const SELECTOR: [u8; 4] = [252u8, 92u8, 92u8, 179u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - ::tokenize( - &self.token, - ), - ::tokenize( - &self.mirrorToken, - ), - ::tokenize( - &self.limits, - ), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - whiteListTokenReturn::_tokenize(ret) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(Into::into) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(Into::into) - } - } - }; - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `whitelistedTokens(uint256)` and selector `0x2154bc44`. -```solidity -function whitelistedTokens(uint256) external view returns (address); -```*/ - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct whitelistedTokensCall( - pub alloy::sol_types::private::primitives::aliases::U256, - ); - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`whitelistedTokens(uint256)`](whitelistedTokensCall) function. - #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] - #[derive(Clone)] - pub struct whitelistedTokensReturn { - #[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> = (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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: whitelistedTokensCall) -> Self { - (value.0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for whitelistedTokensCall { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self(tuple.0) - } - } - } - { - #[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, - ) { - match _t { - alloy_sol_types::private::AssertTypeEq::< - ::RustType, - >(_) => {} - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: whitelistedTokensReturn) -> Self { - (value._0,) - } - } - #[automatically_derived] - #[doc(hidden)] - impl ::core::convert::From> - for whitelistedTokensReturn { - fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } - } - } - } - #[automatically_derived] - impl alloy_sol_types::SolCall for whitelistedTokensCall { - type Parameters<'a> = (alloy::sol_types::sol_data::Uint<256>,); - type Token<'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> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "whitelistedTokens(uint256)"; - const SELECTOR: [u8; 4] = [33u8, 84u8, 188u8, 68u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } - #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - as alloy_sol_types::SolType>::tokenize(&self.0), - ) - } - #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - ( - ::tokenize( - ret, - ), - ) - } - #[inline] - fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: whitelistedTokensReturn = r.into(); - r._0 - }) - } - #[inline] - fn abi_decode_returns_validate( - data: &[u8], - ) -> alloy_sol_types::Result { - as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: whitelistedTokensReturn = r.into(); - r._0 - }) - } - } - }; - ///Container for all the [`BridgeDepositWithdraw`](self) function calls. - #[derive(Clone)] - #[derive(serde::Serialize, serde::Deserialize)] - #[derive()] - pub enum BridgeDepositWithdrawCalls { - #[allow(missing_docs)] - DEFAULT_ADMIN_ROLE(DEFAULT_ADMIN_ROLECall), - #[allow(missing_docs)] - PAUSER_ROLE(PAUSER_ROLECall), - #[allow(missing_docs)] - bridgeContract(bridgeContractCall), - #[allow(missing_docs)] - claim(claimCall), - #[allow(missing_docs)] - configureToken(configureTokenCall), - #[allow(missing_docs)] - deposit(depositCall), - #[allow(missing_docs)] - depositIndex(depositIndexCall), - #[allow(missing_docs)] - getRoleAdmin(getRoleAdminCall), - #[allow(missing_docs)] - grantRole(grantRoleCall), - #[allow(missing_docs)] - hasRole(hasRoleCall), - #[allow(missing_docs)] - migrate(migrateCall), - #[allow(missing_docs)] - migratedContract(migratedContractCall), - #[allow(missing_docs)] - mirrorTokens(mirrorTokensCall), - #[allow(missing_docs)] - pause(pauseCall), - #[allow(missing_docs)] - paused(pausedCall), - #[allow(missing_docs)] - podConfig(podConfigCall), - #[allow(missing_docs)] - processedRequests(processedRequestsCall), - #[allow(missing_docs)] - renounceRole(renounceRoleCall), - #[allow(missing_docs)] - revokeRole(revokeRoleCall), - #[allow(missing_docs)] - supportsInterface(supportsInterfaceCall), - #[allow(missing_docs)] - tokenData(tokenDataCall), - #[allow(missing_docs)] - unpause(unpauseCall), - #[allow(missing_docs)] - whiteListToken(whiteListTokenCall), - #[allow(missing_docs)] - whitelistedTokens(whitelistedTokensCall), - } - impl BridgeDepositWithdrawCalls { - /// 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]] = &[ - [1u8, 255u8, 201u8, 167u8], - [33u8, 84u8, 188u8, 68u8], - [36u8, 138u8, 156u8, 163u8], - [39u8, 228u8, 92u8, 44u8], - [47u8, 47u8, 241u8, 93u8], - [54u8, 86u8, 138u8, 190u8], - [63u8, 75u8, 168u8, 58u8], - [92u8, 151u8, 90u8, 187u8], - [116u8, 134u8, 250u8, 78u8], - [118u8, 131u8, 245u8, 158u8], - [123u8, 137u8, 137u8, 57u8], - [132u8, 86u8, 203u8, 89u8], - [145u8, 209u8, 72u8, 84u8], - [146u8, 103u8, 177u8, 83u8], - [162u8, 23u8, 253u8, 223u8], - [205u8, 89u8, 101u8, 131u8], - [206u8, 15u8, 165u8, 169u8], - [206u8, 84u8, 148u8, 187u8], - [211u8, 40u8, 97u8, 59u8], - [213u8, 71u8, 116u8, 31u8], - [230u8, 58u8, 177u8, 233u8], - [244u8, 83u8, 70u8, 220u8], - [252u8, 92u8, 92u8, 179u8], - [254u8, 174u8, 180u8, 62u8], - ]; - /// The names of the variants in the same order as `SELECTORS`. - pub const VARIANT_NAMES: &'static [&'static str] = &[ - ::core::stringify!(supportsInterface), - ::core::stringify!(whitelistedTokens), - ::core::stringify!(getRoleAdmin), - ::core::stringify!(tokenData), - ::core::stringify!(grantRole), - ::core::stringify!(renounceRole), - ::core::stringify!(unpause), - ::core::stringify!(paused), - ::core::stringify!(migratedContract), - ::core::stringify!(claim), - ::core::stringify!(depositIndex), - ::core::stringify!(pause), - ::core::stringify!(hasRole), - ::core::stringify!(configureToken), - ::core::stringify!(DEFAULT_ADMIN_ROLE), - ::core::stringify!(bridgeContract), - ::core::stringify!(processedRequests), - ::core::stringify!(migrate), - ::core::stringify!(podConfig), - ::core::stringify!(revokeRole), - ::core::stringify!(PAUSER_ROLE), - ::core::stringify!(deposit), - ::core::stringify!(whiteListToken), - ::core::stringify!(mirrorTokens), - ]; - /// The signatures in the same order as `SELECTORS`. - pub const SIGNATURES: &'static [&'static str] = &[ - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::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 BridgeDepositWithdrawCalls { - const NAME: &'static str = "BridgeDepositWithdrawCalls"; - const MIN_DATA_LENGTH: usize = 0usize; - const COUNT: usize = 24usize; - #[inline] - fn selector(&self) -> [u8; 4] { - match self { - Self::DEFAULT_ADMIN_ROLE(_) => { - ::SELECTOR - } - Self::PAUSER_ROLE(_) => { - ::SELECTOR - } - Self::bridgeContract(_) => { - ::SELECTOR - } - Self::claim(_) => ::SELECTOR, - Self::configureToken(_) => { - ::SELECTOR - } - Self::deposit(_) => ::SELECTOR, - Self::depositIndex(_) => { - ::SELECTOR - } - Self::getRoleAdmin(_) => { - ::SELECTOR - } - Self::grantRole(_) => { - ::SELECTOR - } - Self::hasRole(_) => ::SELECTOR, - Self::migrate(_) => ::SELECTOR, - Self::migratedContract(_) => { - ::SELECTOR - } - Self::mirrorTokens(_) => { - ::SELECTOR - } - Self::pause(_) => ::SELECTOR, - Self::paused(_) => ::SELECTOR, - Self::podConfig(_) => { - ::SELECTOR - } - Self::processedRequests(_) => { - ::SELECTOR - } - Self::renounceRole(_) => { - ::SELECTOR - } - Self::revokeRole(_) => { - ::SELECTOR - } - Self::supportsInterface(_) => { - ::SELECTOR - } - Self::tokenData(_) => { - ::SELECTOR - } - Self::unpause(_) => ::SELECTOR, - Self::whiteListToken(_) => { - ::SELECTOR - } - Self::whitelistedTokens(_) => { - ::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 { - static DECODE_SHIMS: &[fn( - &[u8], - ) -> alloy_sol_types::Result] = &[ - { - fn supportsInterface( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::supportsInterface) - } - supportsInterface - }, - { - fn whitelistedTokens( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::whitelistedTokens) - } - whitelistedTokens - }, - { - fn getRoleAdmin( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::getRoleAdmin) - } - getRoleAdmin - }, - { - fn tokenData( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw(data) - .map(BridgeDepositWithdrawCalls::tokenData) - } - tokenData - }, - { - fn grantRole( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw(data) - .map(BridgeDepositWithdrawCalls::grantRole) - } - grantRole - }, - { - fn renounceRole( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::renounceRole) - } - renounceRole - }, - { - fn unpause( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw(data) - .map(BridgeDepositWithdrawCalls::unpause) - } - unpause - }, - { - fn paused( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw(data) - .map(BridgeDepositWithdrawCalls::paused) - } - paused - }, - { - fn migratedContract( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::migratedContract) - } - migratedContract - }, - { - fn claim( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw(data) - .map(BridgeDepositWithdrawCalls::claim) - } - claim - }, - { - fn depositIndex( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::depositIndex) - } - depositIndex - }, - { - fn pause( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw(data) - .map(BridgeDepositWithdrawCalls::pause) - } - pause - }, - { - fn hasRole( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw(data) - .map(BridgeDepositWithdrawCalls::hasRole) - } - hasRole - }, - { - fn configureToken( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::configureToken) - } - configureToken - }, - { - fn DEFAULT_ADMIN_ROLE( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::DEFAULT_ADMIN_ROLE) - } - DEFAULT_ADMIN_ROLE - }, - { - fn bridgeContract( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::bridgeContract) - } - bridgeContract - }, - { - fn processedRequests( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::processedRequests) - } - processedRequests - }, - { - fn migrate( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw(data) - .map(BridgeDepositWithdrawCalls::migrate) - } - migrate - }, - { - fn podConfig( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw(data) - .map(BridgeDepositWithdrawCalls::podConfig) - } - podConfig - }, - { - fn revokeRole( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::revokeRole) - } - revokeRole - }, - { - fn PAUSER_ROLE( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::PAUSER_ROLE) - } - PAUSER_ROLE - }, - { - fn deposit( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw(data) - .map(BridgeDepositWithdrawCalls::deposit) - } - deposit - }, - { - fn whiteListToken( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::whiteListToken) - } - whiteListToken - }, - { - fn mirrorTokens( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawCalls::mirrorTokens) - } - mirrorTokens - }, - ]; - let Ok(idx) = Self::SELECTORS.binary_search(&selector) else { - return Err( - alloy_sol_types::Error::unknown_selector( - ::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 { - static DECODE_VALIDATE_SHIMS: &[fn( - &[u8], - ) -> alloy_sol_types::Result] = &[ - { - fn supportsInterface( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::supportsInterface) - } - supportsInterface - }, - { - fn whitelistedTokens( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::whitelistedTokens) - } - whitelistedTokens - }, - { - fn getRoleAdmin( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::getRoleAdmin) - } - getRoleAdmin - }, - { - fn tokenData( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::tokenData) - } - tokenData - }, - { - fn grantRole( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::grantRole) - } - grantRole - }, - { - fn renounceRole( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::renounceRole) - } - renounceRole - }, - { - fn unpause( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::unpause) - } - unpause - }, - { - fn paused( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::paused) - } - paused - }, - { - fn migratedContract( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::migratedContract) - } - migratedContract - }, - { - fn claim( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::claim) - } - claim - }, - { - fn depositIndex( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::depositIndex) - } - depositIndex - }, - { - fn pause( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::pause) - } - pause - }, - { - fn hasRole( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::hasRole) - } - hasRole - }, - { - fn configureToken( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::configureToken) - } - configureToken - }, - { - fn DEFAULT_ADMIN_ROLE( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::DEFAULT_ADMIN_ROLE) - } - DEFAULT_ADMIN_ROLE - }, - { - fn bridgeContract( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::bridgeContract) - } - bridgeContract - }, - { - fn processedRequests( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::processedRequests) - } - processedRequests - }, - { - fn migrate( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::migrate) - } - migrate - }, - { - fn podConfig( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::podConfig) - } - podConfig - }, - { - fn revokeRole( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::revokeRole) - } - revokeRole - }, - { - fn PAUSER_ROLE( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::PAUSER_ROLE) - } - PAUSER_ROLE - }, - { - fn deposit( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::deposit) - } - deposit - }, - { - fn whiteListToken( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::whiteListToken) - } - whiteListToken - }, - { - fn mirrorTokens( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawCalls::mirrorTokens) - } - mirrorTokens - }, - ]; - let Ok(idx) = Self::SELECTORS.binary_search(&selector) else { - return Err( - alloy_sol_types::Error::unknown_selector( - ::NAME, - selector, - ), - ); - }; - DECODE_VALIDATE_SHIMS[idx](data) - } - #[inline] - fn abi_encoded_size(&self) -> usize { - match self { - Self::DEFAULT_ADMIN_ROLE(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::PAUSER_ROLE(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::bridgeContract(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::claim(inner) => { - ::abi_encoded_size(inner) - } - Self::configureToken(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::deposit(inner) => { - ::abi_encoded_size(inner) - } - Self::depositIndex(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::getRoleAdmin(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::grantRole(inner) => { - ::abi_encoded_size(inner) - } - Self::hasRole(inner) => { - ::abi_encoded_size(inner) - } - Self::migrate(inner) => { - ::abi_encoded_size(inner) - } - Self::migratedContract(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::mirrorTokens(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::pause(inner) => { - ::abi_encoded_size(inner) - } - Self::paused(inner) => { - ::abi_encoded_size(inner) - } - Self::podConfig(inner) => { - ::abi_encoded_size(inner) - } - Self::processedRequests(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::renounceRole(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::revokeRole(inner) => { - ::abi_encoded_size(inner) - } - Self::supportsInterface(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::tokenData(inner) => { - ::abi_encoded_size(inner) - } - Self::unpause(inner) => { - ::abi_encoded_size(inner) - } - Self::whiteListToken(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::whitelistedTokens(inner) => { - ::abi_encoded_size( - inner, - ) - } - } - } - #[inline] - fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec) { - match self { - Self::DEFAULT_ADMIN_ROLE(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::PAUSER_ROLE(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::bridgeContract(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::claim(inner) => { - ::abi_encode_raw(inner, out) - } - Self::configureToken(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::deposit(inner) => { - ::abi_encode_raw(inner, out) - } - Self::depositIndex(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::getRoleAdmin(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::grantRole(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::hasRole(inner) => { - ::abi_encode_raw(inner, out) - } - Self::migrate(inner) => { - ::abi_encode_raw(inner, out) - } - Self::migratedContract(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::mirrorTokens(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::pause(inner) => { - ::abi_encode_raw(inner, out) - } - Self::paused(inner) => { - ::abi_encode_raw(inner, out) - } - Self::podConfig(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::processedRequests(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::renounceRole(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::revokeRole(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::supportsInterface(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::tokenData(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::unpause(inner) => { - ::abi_encode_raw(inner, out) - } - Self::whiteListToken(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::whitelistedTokens(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - } - } - } - ///Container for all the [`BridgeDepositWithdraw`](self) custom errors. - #[derive(Clone)] - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Debug, PartialEq, Eq, Hash)] - pub enum BridgeDepositWithdrawErrors { - #[allow(missing_docs)] - AccessControlBadConfirmation(AccessControlBadConfirmation), - #[allow(missing_docs)] - AccessControlUnauthorizedAccount(AccessControlUnauthorizedAccount), - #[allow(missing_docs)] - ContractMigrated(ContractMigrated), - #[allow(missing_docs)] - DailyLimitExhausted(DailyLimitExhausted), - #[allow(missing_docs)] - EnforcedPause(EnforcedPause), - #[allow(missing_docs)] - ExpectedPause(ExpectedPause), - #[allow(missing_docs)] - InvalidBridgeContract(InvalidBridgeContract), - #[allow(missing_docs)] - InvalidToAddress(InvalidToAddress), - #[allow(missing_docs)] - InvalidTokenAmount(InvalidTokenAmount), - #[allow(missing_docs)] - InvalidTokenConfig(InvalidTokenConfig), - #[allow(missing_docs)] - MirrorTokenNotFound(MirrorTokenNotFound), - #[allow(missing_docs)] - NativeDepositNotSupported(NativeDepositNotSupported), - #[allow(missing_docs)] - RequestAlreadyProcessed(RequestAlreadyProcessed), - #[allow(missing_docs)] - SafeERC20FailedOperation(SafeERC20FailedOperation), - } - impl BridgeDepositWithdrawErrors { - /// 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]] = &[ - [7u8, 254u8, 123u8, 174u8], - [33u8, 96u8, 115u8, 57u8], - [63u8, 79u8, 104u8, 150u8], - [82u8, 116u8, 175u8, 231u8], - [102u8, 151u8, 178u8, 50u8], - [102u8, 218u8, 128u8, 55u8], - [138u8, 163u8, 167u8, 47u8], - [141u8, 252u8, 32u8, 43u8], - [146u8, 98u8, 73u8, 179u8], - [166u8, 188u8, 116u8, 196u8], - [168u8, 221u8, 182u8, 77u8], - [189u8, 196u8, 223u8, 114u8], - [217u8, 60u8, 6u8, 101u8], - [226u8, 81u8, 125u8, 63u8], - ]; - /// The names of the variants in the same order as `SELECTORS`. - pub const VARIANT_NAMES: &'static [&'static str] = &[ - ::core::stringify!(InvalidTokenConfig), - ::core::stringify!(InvalidTokenAmount), - ::core::stringify!(ContractMigrated), - ::core::stringify!(SafeERC20FailedOperation), - ::core::stringify!(AccessControlBadConfirmation), - ::core::stringify!(InvalidBridgeContract), - ::core::stringify!(InvalidToAddress), - ::core::stringify!(ExpectedPause), - ::core::stringify!(NativeDepositNotSupported), - ::core::stringify!(RequestAlreadyProcessed), - ::core::stringify!(MirrorTokenNotFound), - ::core::stringify!(DailyLimitExhausted), - ::core::stringify!(EnforcedPause), - ::core::stringify!(AccessControlUnauthorizedAccount), - ]; - /// The signatures in the same order as `SELECTORS`. - pub const SIGNATURES: &'static [&'static str] = &[ - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::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 BridgeDepositWithdrawErrors { - const NAME: &'static str = "BridgeDepositWithdrawErrors"; - const MIN_DATA_LENGTH: usize = 0usize; - const COUNT: usize = 14usize; - #[inline] - fn selector(&self) -> [u8; 4] { - match self { - Self::AccessControlBadConfirmation(_) => { - ::SELECTOR - } - Self::AccessControlUnauthorizedAccount(_) => { - ::SELECTOR - } - Self::ContractMigrated(_) => { - ::SELECTOR - } - Self::DailyLimitExhausted(_) => { - ::SELECTOR - } - Self::EnforcedPause(_) => { - ::SELECTOR - } - Self::ExpectedPause(_) => { - ::SELECTOR - } - Self::InvalidBridgeContract(_) => { - ::SELECTOR - } - Self::InvalidToAddress(_) => { - ::SELECTOR - } - Self::InvalidTokenAmount(_) => { - ::SELECTOR - } - Self::InvalidTokenConfig(_) => { - ::SELECTOR - } - Self::MirrorTokenNotFound(_) => { - ::SELECTOR - } - Self::NativeDepositNotSupported(_) => { - ::SELECTOR - } - Self::RequestAlreadyProcessed(_) => { - ::SELECTOR - } - Self::SafeERC20FailedOperation(_) => { - ::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 { - static DECODE_SHIMS: &[fn( - &[u8], - ) -> alloy_sol_types::Result] = &[ - { - fn InvalidTokenConfig( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawErrors::InvalidTokenConfig) - } - InvalidTokenConfig - }, - { - fn InvalidTokenAmount( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawErrors::InvalidTokenAmount) - } - InvalidTokenAmount - }, - { - fn ContractMigrated( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawErrors::ContractMigrated) - } - ContractMigrated - }, - { - fn SafeERC20FailedOperation( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawErrors::SafeERC20FailedOperation) - } - SafeERC20FailedOperation - }, - { - fn AccessControlBadConfirmation( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map( - BridgeDepositWithdrawErrors::AccessControlBadConfirmation, - ) - } - AccessControlBadConfirmation - }, - { - fn InvalidBridgeContract( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawErrors::InvalidBridgeContract) - } - InvalidBridgeContract - }, - { - fn InvalidToAddress( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawErrors::InvalidToAddress) - } - InvalidToAddress - }, - { - fn ExpectedPause( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawErrors::ExpectedPause) - } - ExpectedPause - }, - { - fn NativeDepositNotSupported( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawErrors::NativeDepositNotSupported) - } - NativeDepositNotSupported - }, - { - fn RequestAlreadyProcessed( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawErrors::RequestAlreadyProcessed) - } - RequestAlreadyProcessed - }, - { - fn MirrorTokenNotFound( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawErrors::MirrorTokenNotFound) - } - MirrorTokenNotFound - }, - { - fn DailyLimitExhausted( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawErrors::DailyLimitExhausted) - } - DailyLimitExhausted - }, - { - fn EnforcedPause( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(BridgeDepositWithdrawErrors::EnforcedPause) - } - EnforcedPause - }, - { - fn AccessControlUnauthorizedAccount( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map( - BridgeDepositWithdrawErrors::AccessControlUnauthorizedAccount, - ) - } - AccessControlUnauthorizedAccount - }, - ]; - let Ok(idx) = Self::SELECTORS.binary_search(&selector) else { - return Err( - alloy_sol_types::Error::unknown_selector( - ::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 { - static DECODE_VALIDATE_SHIMS: &[fn( - &[u8], - ) -> alloy_sol_types::Result] = &[ - { - fn InvalidTokenConfig( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawErrors::InvalidTokenConfig) - } - InvalidTokenConfig - }, - { - fn InvalidTokenAmount( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawErrors::InvalidTokenAmount) - } - InvalidTokenAmount - }, - { - fn ContractMigrated( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawErrors::ContractMigrated) - } - ContractMigrated - }, - { - fn SafeERC20FailedOperation( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawErrors::SafeERC20FailedOperation) - } - SafeERC20FailedOperation - }, - { - fn AccessControlBadConfirmation( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map( - BridgeDepositWithdrawErrors::AccessControlBadConfirmation, - ) - } - AccessControlBadConfirmation - }, - { - fn InvalidBridgeContract( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawErrors::InvalidBridgeContract) - } - InvalidBridgeContract - }, - { - fn InvalidToAddress( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawErrors::InvalidToAddress) - } - InvalidToAddress - }, - { - fn ExpectedPause( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawErrors::ExpectedPause) - } - ExpectedPause - }, - { - fn NativeDepositNotSupported( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawErrors::NativeDepositNotSupported) - } - NativeDepositNotSupported - }, - { - fn RequestAlreadyProcessed( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawErrors::RequestAlreadyProcessed) - } - RequestAlreadyProcessed - }, - { - fn MirrorTokenNotFound( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawErrors::MirrorTokenNotFound) - } - MirrorTokenNotFound - }, - { - fn DailyLimitExhausted( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawErrors::DailyLimitExhausted) - } - DailyLimitExhausted - }, - { - fn EnforcedPause( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map(BridgeDepositWithdrawErrors::EnforcedPause) - } - EnforcedPause - }, - { - fn AccessControlUnauthorizedAccount( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( - data, - ) - .map( - BridgeDepositWithdrawErrors::AccessControlUnauthorizedAccount, - ) - } - AccessControlUnauthorizedAccount - }, - ]; - let Ok(idx) = Self::SELECTORS.binary_search(&selector) else { - return Err( - alloy_sol_types::Error::unknown_selector( - ::NAME, - selector, - ), - ); - }; - DECODE_VALIDATE_SHIMS[idx](data) - } - #[inline] - fn abi_encoded_size(&self) -> usize { - match self { - Self::AccessControlBadConfirmation(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::AccessControlUnauthorizedAccount(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::ContractMigrated(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::DailyLimitExhausted(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::EnforcedPause(inner) => { - ::abi_encoded_size(inner) - } - Self::ExpectedPause(inner) => { - ::abi_encoded_size(inner) - } - Self::InvalidBridgeContract(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::InvalidToAddress(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::InvalidTokenAmount(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::InvalidTokenConfig(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::MirrorTokenNotFound(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::NativeDepositNotSupported(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::RequestAlreadyProcessed(inner) => { - ::abi_encoded_size( - inner, - ) - } - Self::SafeERC20FailedOperation(inner) => { - ::abi_encoded_size( - inner, - ) - } - } - } - #[inline] - fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec) { - match self { - Self::AccessControlBadConfirmation(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::AccessControlUnauthorizedAccount(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::ContractMigrated(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::DailyLimitExhausted(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::EnforcedPause(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::ExpectedPause(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::InvalidBridgeContract(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::InvalidToAddress(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::InvalidTokenAmount(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::InvalidTokenConfig(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::MirrorTokenNotFound(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::NativeDepositNotSupported(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::RequestAlreadyProcessed(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - Self::SafeERC20FailedOperation(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } - } - } - } - ///Container for all the [`BridgeDepositWithdraw`](self) events. - #[derive(Clone)] - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Debug, PartialEq, Eq, Hash)] - pub enum BridgeDepositWithdrawEvents { - #[allow(missing_docs)] - Claim(Claim), - #[allow(missing_docs)] - Deposit(Deposit), - #[allow(missing_docs)] - Paused(Paused), - #[allow(missing_docs)] - RoleAdminChanged(RoleAdminChanged), - #[allow(missing_docs)] - RoleGranted(RoleGranted), - #[allow(missing_docs)] - RoleRevoked(RoleRevoked), - #[allow(missing_docs)] - Unpaused(Unpaused), - } - impl BridgeDepositWithdrawEvents { - /// 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; 32usize]] = &[ - [ - 47u8, 135u8, 136u8, 17u8, 126u8, 126u8, 255u8, 29u8, 130u8, 233u8, 38u8, - 236u8, 121u8, 73u8, 1u8, 209u8, 124u8, 120u8, 2u8, 74u8, 80u8, 39u8, 9u8, - 64u8, 48u8, 69u8, 64u8, 167u8, 51u8, 101u8, 111u8, 13u8, - ], - [ - 93u8, 185u8, 238u8, 10u8, 73u8, 91u8, 242u8, 230u8, 255u8, 156u8, 145u8, - 167u8, 131u8, 76u8, 27u8, 164u8, 253u8, 210u8, 68u8, 165u8, 232u8, 170u8, - 78u8, 83u8, 123u8, 211u8, 138u8, 234u8, 228u8, 176u8, 115u8, 170u8, - ], - [ - 98u8, 231u8, 140u8, 234u8, 1u8, 190u8, 227u8, 32u8, 205u8, 78u8, 66u8, - 2u8, 112u8, 181u8, 234u8, 116u8, 0u8, 13u8, 17u8, 176u8, 201u8, 247u8, - 71u8, 84u8, 235u8, 219u8, 252u8, 84u8, 75u8, 5u8, 162u8, 88u8, - ], - [ - 160u8, 185u8, 156u8, 15u8, 223u8, 195u8, 149u8, 114u8, 77u8, 123u8, - 129u8, 168u8, 138u8, 109u8, 116u8, 133u8, 36u8, 97u8, 247u8, 105u8, 19u8, - 113u8, 175u8, 226u8, 131u8, 155u8, 184u8, 104u8, 132u8, 117u8, 120u8, - 140u8, - ], - [ - 178u8, 88u8, 23u8, 213u8, 27u8, 241u8, 250u8, 240u8, 36u8, 243u8, 131u8, - 55u8, 19u8, 111u8, 102u8, 250u8, 119u8, 142u8, 125u8, 165u8, 162u8, 8u8, - 136u8, 236u8, 88u8, 86u8, 13u8, 101u8, 94u8, 216u8, 36u8, 71u8, - ], - [ - 189u8, 121u8, 184u8, 111u8, 254u8, 10u8, 184u8, 232u8, 119u8, 97u8, 81u8, - 81u8, 66u8, 23u8, 205u8, 124u8, 172u8, 213u8, 44u8, 144u8, 159u8, 102u8, - 71u8, 92u8, 58u8, 244u8, 78u8, 18u8, 159u8, 11u8, 0u8, 255u8, - ], - [ - 246u8, 57u8, 31u8, 92u8, 50u8, 217u8, 198u8, 157u8, 42u8, 71u8, 234u8, - 103u8, 11u8, 68u8, 41u8, 116u8, 181u8, 57u8, 53u8, 209u8, 237u8, 199u8, - 253u8, 100u8, 235u8, 33u8, 224u8, 71u8, 168u8, 57u8, 23u8, 27u8, - ], - ]; - /// The names of the variants in the same order as `SELECTORS`. - pub const VARIANT_NAMES: &'static [&'static str] = &[ - ::core::stringify!(RoleGranted), - ::core::stringify!(Unpaused), - ::core::stringify!(Paused), - ::core::stringify!(Claim), - ::core::stringify!(Deposit), - ::core::stringify!(RoleAdminChanged), - ::core::stringify!(RoleRevoked), - ]; - /// The signatures in the same order as `SELECTORS`. - pub const SIGNATURES: &'static [&'static str] = &[ - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ::SIGNATURE, - ]; - /// Returns the signature for the given selector, if known. - #[inline] - pub fn signature_by_selector( - selector: [u8; 32usize], - ) -> ::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; 32usize], - ) -> ::core::option::Option<&'static str> { - let sig = Self::signature_by_selector(selector)?; - sig.split_once('(').map(|(name, _)| name) - } - } - #[automatically_derived] - impl alloy_sol_types::SolEventInterface for BridgeDepositWithdrawEvents { - const NAME: &'static str = "BridgeDepositWithdrawEvents"; - const COUNT: usize = 7usize; - fn decode_raw_log( - topics: &[alloy_sol_types::Word], - data: &[u8], - ) -> alloy_sol_types::Result { - match topics.first().copied() { - Some(::SIGNATURE_HASH) => { - ::decode_raw_log(topics, data) - .map(Self::Claim) - } - Some(::SIGNATURE_HASH) => { - ::decode_raw_log(topics, data) - .map(Self::Deposit) - } - Some(::SIGNATURE_HASH) => { - ::decode_raw_log(topics, data) - .map(Self::Paused) - } - Some(::SIGNATURE_HASH) => { - ::decode_raw_log( - topics, - data, - ) - .map(Self::RoleAdminChanged) - } - Some(::SIGNATURE_HASH) => { - ::decode_raw_log( - topics, - data, - ) - .map(Self::RoleGranted) - } - Some(::SIGNATURE_HASH) => { - ::decode_raw_log( - topics, - data, - ) - .map(Self::RoleRevoked) - } - Some(::SIGNATURE_HASH) => { - ::decode_raw_log(topics, data) - .map(Self::Unpaused) - } - _ => { - alloy_sol_types::private::Err(alloy_sol_types::Error::InvalidLog { - name: ::NAME, - log: alloy_sol_types::private::Box::new( - alloy_sol_types::private::LogData::new_unchecked( - topics.to_vec(), - data.to_vec().into(), - ), - ), - }) - } - } - } - } - #[automatically_derived] - impl alloy_sol_types::private::IntoLogData for BridgeDepositWithdrawEvents { - fn to_log_data(&self) -> alloy_sol_types::private::LogData { - match self { - Self::Claim(inner) => { - alloy_sol_types::private::IntoLogData::to_log_data(inner) - } - Self::Deposit(inner) => { - alloy_sol_types::private::IntoLogData::to_log_data(inner) - } - Self::Paused(inner) => { - alloy_sol_types::private::IntoLogData::to_log_data(inner) - } - Self::RoleAdminChanged(inner) => { - alloy_sol_types::private::IntoLogData::to_log_data(inner) - } - Self::RoleGranted(inner) => { - alloy_sol_types::private::IntoLogData::to_log_data(inner) - } - Self::RoleRevoked(inner) => { - alloy_sol_types::private::IntoLogData::to_log_data(inner) - } - Self::Unpaused(inner) => { - alloy_sol_types::private::IntoLogData::to_log_data(inner) - } - } - } - fn into_log_data(self) -> alloy_sol_types::private::LogData { - match self { - Self::Claim(inner) => { - alloy_sol_types::private::IntoLogData::into_log_data(inner) - } - Self::Deposit(inner) => { - alloy_sol_types::private::IntoLogData::into_log_data(inner) - } - Self::Paused(inner) => { - alloy_sol_types::private::IntoLogData::into_log_data(inner) - } - Self::RoleAdminChanged(inner) => { - alloy_sol_types::private::IntoLogData::into_log_data(inner) - } - Self::RoleGranted(inner) => { - alloy_sol_types::private::IntoLogData::into_log_data(inner) - } - Self::RoleRevoked(inner) => { - alloy_sol_types::private::IntoLogData::into_log_data(inner) - } - Self::Unpaused(inner) => { - alloy_sol_types::private::IntoLogData::into_log_data(inner) - } - } - } - } - use alloy::contract as alloy_contract; - /**Creates a new wrapper around an on-chain [`BridgeDepositWithdraw`](self) contract instance. - -See the [wrapper's documentation](`BridgeDepositWithdrawInstance`) for more details.*/ - #[inline] - pub const fn new< - P: alloy_contract::private::Provider, - N: alloy_contract::private::Network, - >( - address: alloy_sol_types::private::Address, - __provider: P, - ) -> BridgeDepositWithdrawInstance { - BridgeDepositWithdrawInstance::::new(address, __provider) - } - /**A [`BridgeDepositWithdraw`](self) instance. - -Contains type-safe methods for interacting with an on-chain instance of the -[`BridgeDepositWithdraw`](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 BridgeDepositWithdrawInstance { - address: alloy_sol_types::private::Address, - provider: P, - _network: ::core::marker::PhantomData, - } - #[automatically_derived] - impl ::core::fmt::Debug for BridgeDepositWithdrawInstance { - #[inline] - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_tuple("BridgeDepositWithdrawInstance").field(&self.address).finish() - } - } - /// Instantiation and getters/setters. - impl< - P: alloy_contract::private::Provider, - N: alloy_contract::private::Network, - > BridgeDepositWithdrawInstance { - /**Creates a new wrapper around an on-chain [`BridgeDepositWithdraw`](self) contract instance. - -See the [wrapper's documentation](`BridgeDepositWithdrawInstance`) 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, - } - } - /// 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 BridgeDepositWithdrawInstance<&P, N> { - /// Clones the provider and returns a new instance with the cloned provider. - #[inline] - pub fn with_cloned_provider(self) -> BridgeDepositWithdrawInstance { - BridgeDepositWithdrawInstance { - address: self.address, - provider: ::core::clone::Clone::clone(&self.provider), - _network: ::core::marker::PhantomData, - } - } - } - /// Function calls. - impl< - P: alloy_contract::private::Provider, - N: alloy_contract::private::Network, - > BridgeDepositWithdrawInstance { - /// 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( - &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 [`DEFAULT_ADMIN_ROLE`] function. - pub fn DEFAULT_ADMIN_ROLE( - &self, - ) -> alloy_contract::SolCallBuilder<&P, DEFAULT_ADMIN_ROLECall, N> { - self.call_builder(&DEFAULT_ADMIN_ROLECall) - } - ///Creates a new call builder for the [`PAUSER_ROLE`] function. - pub fn PAUSER_ROLE( - &self, - ) -> alloy_contract::SolCallBuilder<&P, PAUSER_ROLECall, N> { - self.call_builder(&PAUSER_ROLECall) - } - ///Creates a new call builder for the [`bridgeContract`] function. - pub fn bridgeContract( - &self, - ) -> alloy_contract::SolCallBuilder<&P, bridgeContractCall, N> { - self.call_builder(&bridgeContractCall) - } - ///Creates a new call builder for the [`claim`] function. - pub fn claim( - &self, - token: alloy::sol_types::private::Address, - amount: alloy::sol_types::private::primitives::aliases::U256, - to: alloy::sol_types::private::Address, - committeeEpoch: u64, - aggregatedSignatures: alloy::sol_types::private::Bytes, - proof: ::RustType, - ) -> alloy_contract::SolCallBuilder<&P, claimCall, N> { - self.call_builder( - &claimCall { - token, - amount, - to, - committeeEpoch, - aggregatedSignatures, - proof, - }, - ) - } - ///Creates a new call builder for the [`configureToken`] function. - pub fn configureToken( - &self, - token: alloy::sol_types::private::Address, - limits: ::RustType, - ) -> alloy_contract::SolCallBuilder<&P, configureTokenCall, N> { - self.call_builder( - &configureTokenCall { - token, - limits, - }, - ) - } - ///Creates a new call builder for the [`deposit`] function. - pub fn deposit( - &self, - token: alloy::sol_types::private::Address, - amount: alloy::sol_types::private::primitives::aliases::U256, - to: alloy::sol_types::private::Address, - ) -> alloy_contract::SolCallBuilder<&P, depositCall, N> { - self.call_builder(&depositCall { token, amount, to }) - } - ///Creates a new call builder for the [`depositIndex`] function. - pub fn depositIndex( - &self, - ) -> alloy_contract::SolCallBuilder<&P, depositIndexCall, N> { - self.call_builder(&depositIndexCall) - } - ///Creates a new call builder for the [`getRoleAdmin`] function. - pub fn getRoleAdmin( - &self, - role: alloy::sol_types::private::FixedBytes<32>, - ) -> alloy_contract::SolCallBuilder<&P, getRoleAdminCall, N> { - self.call_builder(&getRoleAdminCall { role }) - } - ///Creates a new call builder for the [`grantRole`] function. - pub fn grantRole( - &self, - role: alloy::sol_types::private::FixedBytes<32>, - account: alloy::sol_types::private::Address, - ) -> alloy_contract::SolCallBuilder<&P, grantRoleCall, N> { - self.call_builder(&grantRoleCall { role, account }) - } - ///Creates a new call builder for the [`hasRole`] function. - pub fn hasRole( - &self, - role: alloy::sol_types::private::FixedBytes<32>, - account: alloy::sol_types::private::Address, - ) -> alloy_contract::SolCallBuilder<&P, hasRoleCall, N> { - self.call_builder(&hasRoleCall { role, account }) - } - ///Creates a new call builder for the [`migrate`] function. - pub fn migrate( - &self, - _newContract: alloy::sol_types::private::Address, - ) -> alloy_contract::SolCallBuilder<&P, migrateCall, N> { - self.call_builder(&migrateCall { _newContract }) - } - ///Creates a new call builder for the [`migratedContract`] function. - pub fn migratedContract( - &self, - ) -> alloy_contract::SolCallBuilder<&P, migratedContractCall, N> { - self.call_builder(&migratedContractCall) - } - ///Creates a new call builder for the [`mirrorTokens`] function. - pub fn mirrorTokens( - &self, - _0: alloy::sol_types::private::Address, - ) -> alloy_contract::SolCallBuilder<&P, mirrorTokensCall, N> { - self.call_builder(&mirrorTokensCall(_0)) - } - ///Creates a new call builder for the [`pause`] function. - pub fn pause(&self) -> alloy_contract::SolCallBuilder<&P, pauseCall, N> { - self.call_builder(&pauseCall) - } - ///Creates a new call builder for the [`paused`] function. - pub fn paused(&self) -> alloy_contract::SolCallBuilder<&P, pausedCall, N> { - self.call_builder(&pausedCall) - } - ///Creates a new call builder for the [`podConfig`] function. - pub fn podConfig(&self) -> alloy_contract::SolCallBuilder<&P, podConfigCall, N> { - self.call_builder(&podConfigCall) - } - ///Creates a new call builder for the [`processedRequests`] function. - pub fn processedRequests( - &self, - _0: alloy::sol_types::private::FixedBytes<32>, - ) -> alloy_contract::SolCallBuilder<&P, processedRequestsCall, N> { - self.call_builder(&processedRequestsCall(_0)) - } - ///Creates a new call builder for the [`renounceRole`] function. - pub fn renounceRole( - &self, - role: alloy::sol_types::private::FixedBytes<32>, - callerConfirmation: alloy::sol_types::private::Address, - ) -> alloy_contract::SolCallBuilder<&P, renounceRoleCall, N> { - self.call_builder( - &renounceRoleCall { - role, - callerConfirmation, - }, - ) - } - ///Creates a new call builder for the [`revokeRole`] function. - pub fn revokeRole( - &self, - role: alloy::sol_types::private::FixedBytes<32>, - account: alloy::sol_types::private::Address, - ) -> alloy_contract::SolCallBuilder<&P, revokeRoleCall, N> { - self.call_builder(&revokeRoleCall { role, account }) - } - ///Creates a new call builder for the [`supportsInterface`] function. - pub fn supportsInterface( - &self, - interfaceId: alloy::sol_types::private::FixedBytes<4>, - ) -> alloy_contract::SolCallBuilder<&P, supportsInterfaceCall, N> { - self.call_builder( - &supportsInterfaceCall { - interfaceId, - }, - ) - } - ///Creates a new call builder for the [`tokenData`] function. - pub fn tokenData( - &self, - _0: alloy::sol_types::private::Address, - ) -> alloy_contract::SolCallBuilder<&P, tokenDataCall, N> { - self.call_builder(&tokenDataCall(_0)) - } - ///Creates a new call builder for the [`unpause`] function. - pub fn unpause(&self) -> alloy_contract::SolCallBuilder<&P, unpauseCall, N> { - self.call_builder(&unpauseCall) - } - ///Creates a new call builder for the [`whiteListToken`] function. - pub fn whiteListToken( - &self, - token: alloy::sol_types::private::Address, - mirrorToken: alloy::sol_types::private::Address, - limits: ::RustType, - ) -> alloy_contract::SolCallBuilder<&P, whiteListTokenCall, N> { - self.call_builder( - &whiteListTokenCall { - token, - mirrorToken, - limits, - }, - ) - } - ///Creates a new call builder for the [`whitelistedTokens`] function. - pub fn whitelistedTokens( - &self, - _0: alloy::sol_types::private::primitives::aliases::U256, - ) -> alloy_contract::SolCallBuilder<&P, whitelistedTokensCall, N> { - self.call_builder(&whitelistedTokensCall(_0)) - } - } - /// Event filters. - impl< - P: alloy_contract::private::Provider, - N: alloy_contract::private::Network, - > BridgeDepositWithdrawInstance { - /// 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( - &self, - ) -> alloy_contract::Event<&P, E, N> { - alloy_contract::Event::new_sol(&self.provider, &self.address) - } - ///Creates a new event filter for the [`Claim`] event. - pub fn Claim_filter(&self) -> alloy_contract::Event<&P, Claim, N> { - self.event_filter::() - } - ///Creates a new event filter for the [`Deposit`] event. - pub fn Deposit_filter(&self) -> alloy_contract::Event<&P, Deposit, N> { - self.event_filter::() - } - ///Creates a new event filter for the [`Paused`] event. - pub fn Paused_filter(&self) -> alloy_contract::Event<&P, Paused, N> { - self.event_filter::() - } - ///Creates a new event filter for the [`RoleAdminChanged`] event. - pub fn RoleAdminChanged_filter( - &self, - ) -> alloy_contract::Event<&P, RoleAdminChanged, N> { - self.event_filter::() - } - ///Creates a new event filter for the [`RoleGranted`] event. - pub fn RoleGranted_filter(&self) -> alloy_contract::Event<&P, RoleGranted, N> { - self.event_filter::() - } - ///Creates a new event filter for the [`RoleRevoked`] event. - pub fn RoleRevoked_filter(&self) -> alloy_contract::Event<&P, RoleRevoked, N> { - self.event_filter::() - } - ///Creates a new event filter for the [`Unpaused`] event. - pub fn Unpaused_filter(&self) -> alloy_contract::Event<&P, Unpaused, N> { - self.event_filter::() - } - } -} diff --git a/protocol/bindings/src/i_bridge_mint_burn.rs b/protocol/bindings/src/i_bridge.rs similarity index 80% rename from protocol/bindings/src/i_bridge_mint_burn.rs rename to protocol/bindings/src/i_bridge.rs index d56f165b..46b28f0f 100644 --- a/protocol/bindings/src/i_bridge_mint_burn.rs +++ b/protocol/bindings/src/i_bridge.rs @@ -2,8 +2,8 @@ /** ```solidity -library IBridge { - struct TokenLimits { uint256 minAmount; uint256 deposit; uint256 claim; } +library MerkleTree { + struct MultiProof { bytes32[] path; bool[] flags; } } ```*/ #[allow( @@ -13,23 +13,23 @@ library IBridge { clippy::style, clippy::empty_structs_with_brackets )] -pub mod IBridge { +pub mod MerkleTree { use super::*; use alloy::sol_types as alloy_sol_types; #[derive(serde::Serialize, serde::Deserialize)] #[derive(Default, Debug, PartialEq, Eq, Hash)] /**```solidity -struct TokenLimits { uint256 minAmount; uint256 deposit; uint256 claim; } +struct MultiProof { bytes32[] path; bool[] flags; } ```*/ #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] #[derive(Clone)] - pub struct TokenLimits { - #[allow(missing_docs)] - pub minAmount: alloy::sol_types::private::primitives::aliases::U256, + pub struct MultiProof { #[allow(missing_docs)] - pub deposit: alloy::sol_types::private::primitives::aliases::U256, + pub path: alloy::sol_types::private::Vec< + alloy::sol_types::private::FixedBytes<32>, + >, #[allow(missing_docs)] - pub claim: alloy::sol_types::private::primitives::aliases::U256, + pub flags: alloy::sol_types::private::Vec, } #[allow( non_camel_case_types, @@ -42,15 +42,15 @@ struct TokenLimits { uint256 minAmount; uint256 deposit; uint256 claim; } #[doc(hidden)] #[allow(dead_code)] type UnderlyingSolTuple<'a> = ( - alloy::sol_types::sol_data::Uint<256>, - alloy::sol_types::sol_data::Uint<256>, - alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Array< + alloy::sol_types::sol_data::FixedBytes<32>, + >, + alloy::sol_types::sol_data::Array, ); #[doc(hidden)] type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::primitives::aliases::U256, - alloy::sol_types::private::primitives::aliases::U256, - alloy::sol_types::private::primitives::aliases::U256, + alloy::sol_types::private::Vec>, + alloy::sol_types::private::Vec, ); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] @@ -65,40 +65,36 @@ struct TokenLimits { uint256 minAmount; uint256 deposit; uint256 claim; } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: TokenLimits) -> Self { - (value.minAmount, value.deposit, value.claim) + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: MultiProof) -> Self { + (value.path, value.flags) } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for TokenLimits { + impl ::core::convert::From> for MultiProof { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { - minAmount: tuple.0, - deposit: tuple.1, - claim: tuple.2, + path: tuple.0, + flags: tuple.1, } } } #[automatically_derived] - impl alloy_sol_types::SolValue for TokenLimits { + impl alloy_sol_types::SolValue for MultiProof { type SolType = Self; } #[automatically_derived] - impl alloy_sol_types::private::SolTypeValue for TokenLimits { + impl alloy_sol_types::private::SolTypeValue for MultiProof { #[inline] fn stv_to_tokens(&self) -> ::Token<'_> { ( - as alloy_sol_types::SolType>::tokenize(&self.minAmount), - as alloy_sol_types::SolType>::tokenize(&self.deposit), - as alloy_sol_types::SolType>::tokenize(&self.claim), + , + > as alloy_sol_types::SolType>::tokenize(&self.path), + as alloy_sol_types::SolType>::tokenize(&self.flags), ) } #[inline] @@ -143,7 +139,7 @@ struct TokenLimits { uint256 minAmount; uint256 deposit; uint256 claim; } } } #[automatically_derived] - impl alloy_sol_types::SolType for TokenLimits { + impl alloy_sol_types::SolType for MultiProof { type RustType = Self; type Token<'a> = alloy_sol_types::private::Cow<'static, str> { alloy_sol_types::private::Cow::Borrowed( - "TokenLimits(uint256 minAmount,uint256 deposit,uint256 claim)", + "MultiProof(bytes32[] path,bool[] flags)", ) } #[inline] @@ -189,40 +185,29 @@ struct TokenLimits { uint256 minAmount; uint256 deposit; uint256 claim; } #[inline] fn eip712_encode_data(&self) -> alloy_sol_types::private::Vec { [ - as alloy_sol_types::SolType>::eip712_data_word(&self.minAmount) + , + > as alloy_sol_types::SolType>::eip712_data_word(&self.path) .0, - as alloy_sol_types::SolType>::eip712_data_word(&self.deposit) - .0, - as alloy_sol_types::SolType>::eip712_data_word(&self.claim) + as alloy_sol_types::SolType>::eip712_data_word(&self.flags) .0, ] .concat() } } #[automatically_derived] - impl alloy_sol_types::EventTopic for TokenLimits { + impl alloy_sol_types::EventTopic for MultiProof { #[inline] fn topic_preimage_length(rust: &Self::RustType) -> usize { 0usize - + as alloy_sol_types::EventTopic>::topic_preimage_length( - &rust.minAmount, - ) - + as alloy_sol_types::EventTopic>::topic_preimage_length( - &rust.deposit, - ) - + as alloy_sol_types::EventTopic>::topic_preimage_length(&rust.claim) + + , + > as alloy_sol_types::EventTopic>::topic_preimage_length(&rust.path) + + as alloy_sol_types::EventTopic>::topic_preimage_length(&rust.flags) } #[inline] fn encode_topic_preimage( @@ -232,22 +217,16 @@ struct TokenLimits { uint256 minAmount; uint256 deposit; uint256 claim; } out.reserve( ::topic_preimage_length(rust), ); - as alloy_sol_types::EventTopic>::encode_topic_preimage( - &rust.minAmount, - out, - ); - , > as alloy_sol_types::EventTopic>::encode_topic_preimage( - &rust.deposit, + &rust.path, out, ); - as alloy_sol_types::EventTopic>::encode_topic_preimage( - &rust.claim, + &rust.flags, out, ); } @@ -267,9 +246,9 @@ struct TokenLimits { uint256 minAmount; uint256 deposit; uint256 claim; } } }; use alloy::contract as alloy_contract; - /**Creates a new wrapper around an on-chain [`IBridge`](self) contract instance. + /**Creates a new wrapper around an on-chain [`MerkleTree`](self) contract instance. -See the [wrapper's documentation](`IBridgeInstance`) for more details.*/ +See the [wrapper's documentation](`MerkleTreeInstance`) for more details.*/ #[inline] pub const fn new< P: alloy_contract::private::Provider, @@ -277,13 +256,13 @@ See the [wrapper's documentation](`IBridgeInstance`) for more details.*/ >( address: alloy_sol_types::private::Address, __provider: P, - ) -> IBridgeInstance { - IBridgeInstance::::new(address, __provider) + ) -> MerkleTreeInstance { + MerkleTreeInstance::::new(address, __provider) } - /**A [`IBridge`](self) instance. + /**A [`MerkleTree`](self) instance. Contains type-safe methods for interacting with an on-chain instance of the -[`IBridge`](self) contract located at a given `address`, using a given +[`MerkleTree`](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!) @@ -292,26 +271,26 @@ 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 IBridgeInstance { + pub struct MerkleTreeInstance { address: alloy_sol_types::private::Address, provider: P, _network: ::core::marker::PhantomData, } #[automatically_derived] - impl ::core::fmt::Debug for IBridgeInstance { + impl ::core::fmt::Debug for MerkleTreeInstance { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_tuple("IBridgeInstance").field(&self.address).finish() + f.debug_tuple("MerkleTreeInstance").field(&self.address).finish() } } /// Instantiation and getters/setters. impl< P: alloy_contract::private::Provider, N: alloy_contract::private::Network, - > IBridgeInstance { - /**Creates a new wrapper around an on-chain [`IBridge`](self) contract instance. + > MerkleTreeInstance { + /**Creates a new wrapper around an on-chain [`MerkleTree`](self) contract instance. -See the [wrapper's documentation](`IBridgeInstance`) for more details.*/ +See the [wrapper's documentation](`MerkleTreeInstance`) for more details.*/ #[inline] pub const fn new( address: alloy_sol_types::private::Address, @@ -344,11 +323,11 @@ See the [wrapper's documentation](`IBridgeInstance`) for more details.*/ &self.provider } } - impl IBridgeInstance<&P, N> { + impl MerkleTreeInstance<&P, N> { /// Clones the provider and returns a new instance with the cloned provider. #[inline] - pub fn with_cloned_provider(self) -> IBridgeInstance { - IBridgeInstance { + pub fn with_cloned_provider(self) -> MerkleTreeInstance { + MerkleTreeInstance { address: self.address, provider: ::core::clone::Clone::clone(&self.provider), _network: ::core::marker::PhantomData, @@ -359,7 +338,7 @@ See the [wrapper's documentation](`IBridgeInstance`) for more details.*/ impl< P: alloy_contract::private::Provider, N: alloy_contract::private::Network, - > IBridgeInstance { + > MerkleTreeInstance { /// 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 @@ -375,7 +354,7 @@ See the [wrapper's documentation](`IBridgeInstance`) for more details.*/ impl< P: alloy_contract::private::Provider, N: alloy_contract::private::Network, - > IBridgeInstance { + > MerkleTreeInstance { /// 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. @@ -391,15 +370,20 @@ See the [wrapper's documentation](`IBridgeInstance`) for more details.*/ Generated by the following Solidity interface... ```solidity -library IBridge { +library MerkleTree { + struct MultiProof { + bytes32[] path; + bool[] flags; + } +} + +interface IBridge { struct TokenLimits { uint256 minAmount; uint256 deposit; uint256 claim; } -} -interface IBridgeMintBurn { error ContractMigrated(); error DailyLimitExhausted(); error InvalidBridgeContract(); @@ -413,12 +397,13 @@ interface IBridgeMintBurn { event Claim(bytes32 indexed id, address mirrorToken, address token, uint256 amount, address indexed to); event Deposit(bytes32 indexed id, address indexed token, uint256 amount, address indexed to); - function configureToken(address token, IBridge.TokenLimits memory limits) external; - function createAndWhitelistMirrorToken(string memory tokenName, string memory tokenSymbol, address existingToken, address mirrorToken, uint8 mirrorTokenDecimals, IBridge.TokenLimits memory limits) external returns (address); + function claim(address token, uint256 amount, address to, uint64 committeeEpoch, bytes memory aggregatedSignatures, MerkleTree.MultiProof memory proof) external; + function configureToken(address token, TokenLimits memory limits) external; function deposit(address token, uint256 amount, address to) external payable returns (bytes32); function migrate(address _newContract) external; function pause() external; function unpause() external; + function whiteListToken(address token, address mirrorToken, TokenLimits memory limits) external; } ``` @@ -427,7 +412,7 @@ interface IBridgeMintBurn { [ { "type": "function", - "name": "configureToken", + "name": "claim", "inputs": [ { "name": "token", @@ -435,24 +420,39 @@ interface IBridgeMintBurn { "internalType": "address" }, { - "name": "limits", + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "to", + "type": "address", + "internalType": "address" + }, + { + "name": "committeeEpoch", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "aggregatedSignatures", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "proof", "type": "tuple", - "internalType": "struct IBridge.TokenLimits", + "internalType": "struct MerkleTree.MultiProof", "components": [ { - "name": "minAmount", - "type": "uint256", - "internalType": "uint256" + "name": "path", + "type": "bytes32[]", + "internalType": "bytes32[]" }, { - "name": "deposit", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "claim", - "type": "uint256", - "internalType": "uint256" + "name": "flags", + "type": "bool[]", + "internalType": "bool[]" } ] } @@ -462,33 +462,13 @@ interface IBridgeMintBurn { }, { "type": "function", - "name": "createAndWhitelistMirrorToken", + "name": "configureToken", "inputs": [ { - "name": "tokenName", - "type": "string", - "internalType": "string" - }, - { - "name": "tokenSymbol", - "type": "string", - "internalType": "string" - }, - { - "name": "existingToken", - "type": "address", - "internalType": "address" - }, - { - "name": "mirrorToken", + "name": "token", "type": "address", "internalType": "address" }, - { - "name": "mirrorTokenDecimals", - "type": "uint8", - "internalType": "uint8" - }, { "name": "limits", "type": "tuple", @@ -512,13 +492,7 @@ interface IBridgeMintBurn { ] } ], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], + "outputs": [], "stateMutability": "nonpayable" }, { @@ -577,6 +551,46 @@ interface IBridgeMintBurn { "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "whiteListToken", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "mirrorToken", + "type": "address", + "internalType": "address" + }, + { + "name": "limits", + "type": "tuple", + "internalType": "struct IBridge.TokenLimits", + "components": [ + { + "name": "minAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "deposit", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "claim", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "event", "name": "Claim", @@ -699,7 +713,7 @@ interface IBridgeMintBurn { clippy::style, clippy::empty_structs_with_brackets )] -pub mod IBridgeMintBurn { +pub mod IBridge { use super::*; use alloy::sol_types as alloy_sol_types; /// The creation / init bytecode of the contract. @@ -724,6 +738,256 @@ pub mod IBridgeMintBurn { ); #[derive(serde::Serialize, serde::Deserialize)] #[derive(Default, Debug, PartialEq, Eq, Hash)] + /**```solidity +struct TokenLimits { uint256 minAmount; uint256 deposit; uint256 claim; } +```*/ + #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] + #[derive(Clone)] + pub struct TokenLimits { + #[allow(missing_docs)] + pub minAmount: alloy::sol_types::private::primitives::aliases::U256, + #[allow(missing_docs)] + pub deposit: alloy::sol_types::private::primitives::aliases::U256, + #[allow(missing_docs)] + pub claim: 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>, + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Uint<256>, + ); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = ( + alloy::sol_types::private::primitives::aliases::U256, + alloy::sol_types::private::primitives::aliases::U256, + alloy::sol_types::private::primitives::aliases::U256, + ); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion( + _t: alloy_sol_types::private::AssertTypeEq, + ) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: TokenLimits) -> Self { + (value.minAmount, value.deposit, value.claim) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for TokenLimits { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { + minAmount: tuple.0, + deposit: tuple.1, + claim: tuple.2, + } + } + } + #[automatically_derived] + impl alloy_sol_types::SolValue for TokenLimits { + type SolType = Self; + } + #[automatically_derived] + impl alloy_sol_types::private::SolTypeValue for TokenLimits { + #[inline] + fn stv_to_tokens(&self) -> ::Token<'_> { + ( + as alloy_sol_types::SolType>::tokenize(&self.minAmount), + as alloy_sol_types::SolType>::tokenize(&self.deposit), + as alloy_sol_types::SolType>::tokenize(&self.claim), + ) + } + #[inline] + fn stv_abi_encoded_size(&self) -> usize { + if let Some(size) = ::ENCODED_SIZE { + return size; + } + let tuple = as ::core::convert::From>::from(self.clone()); + as alloy_sol_types::SolType>::abi_encoded_size(&tuple) + } + #[inline] + fn stv_eip712_data_word(&self) -> alloy_sol_types::Word { + ::eip712_hash_struct(self) + } + #[inline] + fn stv_abi_encode_packed_to( + &self, + out: &mut alloy_sol_types::private::Vec, + ) { + let tuple = as ::core::convert::From>::from(self.clone()); + as alloy_sol_types::SolType>::abi_encode_packed_to(&tuple, out) + } + #[inline] + fn stv_abi_packed_encoded_size(&self) -> usize { + if let Some(size) = ::PACKED_ENCODED_SIZE { + return size; + } + let tuple = as ::core::convert::From>::from(self.clone()); + as alloy_sol_types::SolType>::abi_packed_encoded_size(&tuple) + } + } + #[automatically_derived] + impl alloy_sol_types::SolType for TokenLimits { + type RustType = Self; + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + const SOL_NAME: &'static str = ::NAME; + const ENCODED_SIZE: Option = as alloy_sol_types::SolType>::ENCODED_SIZE; + const PACKED_ENCODED_SIZE: Option = as alloy_sol_types::SolType>::PACKED_ENCODED_SIZE; + #[inline] + fn valid_token(token: &Self::Token<'_>) -> bool { + as alloy_sol_types::SolType>::valid_token(token) + } + #[inline] + fn detokenize(token: Self::Token<'_>) -> Self::RustType { + let tuple = as alloy_sol_types::SolType>::detokenize(token); + >>::from(tuple) + } + } + #[automatically_derived] + impl alloy_sol_types::SolStruct for TokenLimits { + const NAME: &'static str = "TokenLimits"; + #[inline] + fn eip712_root_type() -> alloy_sol_types::private::Cow<'static, str> { + alloy_sol_types::private::Cow::Borrowed( + "TokenLimits(uint256 minAmount,uint256 deposit,uint256 claim)", + ) + } + #[inline] + fn eip712_components() -> alloy_sol_types::private::Vec< + alloy_sol_types::private::Cow<'static, str>, + > { + alloy_sol_types::private::Vec::new() + } + #[inline] + fn eip712_encode_type() -> alloy_sol_types::private::Cow<'static, str> { + ::eip712_root_type() + } + #[inline] + fn eip712_encode_data(&self) -> alloy_sol_types::private::Vec { + [ + as alloy_sol_types::SolType>::eip712_data_word(&self.minAmount) + .0, + as alloy_sol_types::SolType>::eip712_data_word(&self.deposit) + .0, + as alloy_sol_types::SolType>::eip712_data_word(&self.claim) + .0, + ] + .concat() + } + } + #[automatically_derived] + impl alloy_sol_types::EventTopic for TokenLimits { + #[inline] + fn topic_preimage_length(rust: &Self::RustType) -> usize { + 0usize + + as alloy_sol_types::EventTopic>::topic_preimage_length( + &rust.minAmount, + ) + + as alloy_sol_types::EventTopic>::topic_preimage_length( + &rust.deposit, + ) + + as alloy_sol_types::EventTopic>::topic_preimage_length(&rust.claim) + } + #[inline] + fn encode_topic_preimage( + rust: &Self::RustType, + out: &mut alloy_sol_types::private::Vec, + ) { + out.reserve( + ::topic_preimage_length(rust), + ); + as alloy_sol_types::EventTopic>::encode_topic_preimage( + &rust.minAmount, + out, + ); + as alloy_sol_types::EventTopic>::encode_topic_preimage( + &rust.deposit, + out, + ); + as alloy_sol_types::EventTopic>::encode_topic_preimage( + &rust.claim, + out, + ); + } + #[inline] + fn encode_topic( + rust: &Self::RustType, + ) -> alloy_sol_types::abi::token::WordToken { + let mut out = alloy_sol_types::private::Vec::new(); + ::encode_topic_preimage( + rust, + &mut out, + ); + alloy_sol_types::abi::token::WordToken( + alloy_sol_types::private::keccak256(out), + ) + } + } + }; + #[derive(serde::Serialize, serde::Deserialize)] + #[derive(Default, Debug, PartialEq, Eq, Hash)] /**Custom error with signature `ContractMigrated()` and selector `0x3f4f6896`. ```solidity error ContractMigrated(); @@ -1667,22 +1931,30 @@ event Deposit(bytes32 indexed id, address indexed token, uint256 amount, address }; #[derive(serde::Serialize, serde::Deserialize)] #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `configureToken(address,(uint256,uint256,uint256))` and selector `0x9267b153`. + /**Function with signature `claim(address,uint256,address,uint64,bytes,(bytes32[],bool[]))` and selector `0x7683f59e`. ```solidity -function configureToken(address token, IBridge.TokenLimits memory limits) external; +function claim(address token, uint256 amount, address to, uint64 committeeEpoch, bytes memory aggregatedSignatures, MerkleTree.MultiProof memory proof) external; ```*/ #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] #[derive(Clone)] - pub struct configureTokenCall { + pub struct claimCall { #[allow(missing_docs)] pub token: alloy::sol_types::private::Address, #[allow(missing_docs)] - pub limits: ::RustType, + pub amount: alloy::sol_types::private::primitives::aliases::U256, + #[allow(missing_docs)] + pub to: alloy::sol_types::private::Address, + #[allow(missing_docs)] + pub committeeEpoch: u64, + #[allow(missing_docs)] + pub aggregatedSignatures: alloy::sol_types::private::Bytes, + #[allow(missing_docs)] + pub proof: ::RustType, } - ///Container type for the return parameters of the [`configureToken(address,(uint256,uint256,uint256))`](configureTokenCall) function. + ///Container type for the return parameters of the [`claim(address,uint256,address,uint64,bytes,(bytes32[],bool[]))`](claimCall) function. #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] #[derive(Clone)] - pub struct configureTokenReturn {} + pub struct claimReturn {} #[allow( non_camel_case_types, non_snake_case, @@ -1696,12 +1968,20 @@ function configureToken(address token, IBridge.TokenLimits memory limits) extern #[allow(dead_code)] type UnderlyingSolTuple<'a> = ( alloy::sol_types::sol_data::Address, - IBridge::TokenLimits, + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Address, + alloy::sol_types::sol_data::Uint<64>, + alloy::sol_types::sol_data::Bytes, + MerkleTree::MultiProof, ); #[doc(hidden)] type UnderlyingRustTuple<'a> = ( alloy::sol_types::private::Address, - ::RustType, + alloy::sol_types::private::primitives::aliases::U256, + alloy::sol_types::private::Address, + u64, + alloy::sol_types::private::Bytes, + ::RustType, ); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] @@ -1716,18 +1996,29 @@ function configureToken(address token, IBridge.TokenLimits memory limits) extern } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: configureTokenCall) -> Self { - (value.token, value.limits) + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: claimCall) -> Self { + ( + value.token, + value.amount, + value.to, + value.committeeEpoch, + value.aggregatedSignatures, + value.proof, + ) } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> for configureTokenCall { + impl ::core::convert::From> for claimCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { token: tuple.0, - limits: tuple.1, + amount: tuple.1, + to: tuple.2, + committeeEpoch: tuple.3, + aggregatedSignatures: tuple.4, + proof: tuple.5, } } } @@ -1751,44 +2042,46 @@ function configureToken(address token, IBridge.TokenLimits memory limits) extern } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: configureTokenReturn) -> Self { + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: claimReturn) -> Self { () } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> - for configureTokenReturn { + impl ::core::convert::From> for claimReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self {} } } } - impl configureTokenReturn { + impl claimReturn { fn _tokenize( &self, - ) -> ::ReturnToken<'_> { + ) -> ::ReturnToken<'_> { () } } #[automatically_derived] - impl alloy_sol_types::SolCall for configureTokenCall { + impl alloy_sol_types::SolCall for claimCall { type Parameters<'a> = ( alloy::sol_types::sol_data::Address, - IBridge::TokenLimits, + alloy::sol_types::sol_data::Uint<256>, + alloy::sol_types::sol_data::Address, + alloy::sol_types::sol_data::Uint<64>, + alloy::sol_types::sol_data::Bytes, + MerkleTree::MultiProof, ); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; - type Return = configureTokenReturn; + type Return = claimReturn; type ReturnTuple<'a> = (); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "configureToken(address,(uint256,uint256,uint256))"; - const SELECTOR: [u8; 4] = [146u8, 103u8, 177u8, 83u8]; + const SIGNATURE: &'static str = "claim(address,uint256,address,uint64,bytes,(bytes32[],bool[]))"; + const SELECTOR: [u8; 4] = [118u8, 131u8, 245u8, 158u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, @@ -1801,14 +2094,26 @@ function configureToken(address token, IBridge.TokenLimits memory limits) extern ::tokenize( &self.token, ), - ::tokenize( - &self.limits, + as alloy_sol_types::SolType>::tokenize(&self.amount), + ::tokenize( + &self.to, + ), + as alloy_sol_types::SolType>::tokenize(&self.committeeEpoch), + ::tokenize( + &self.aggregatedSignatures, + ), + ::tokenize( + &self.proof, ), ) } #[inline] fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { - configureTokenReturn::_tokenize(ret) + claimReturn::_tokenize(ret) } #[inline] fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { @@ -1830,35 +2135,22 @@ function configureToken(address token, IBridge.TokenLimits memory limits) extern }; #[derive(serde::Serialize, serde::Deserialize)] #[derive(Default, Debug, PartialEq, Eq, Hash)] - /**Function with signature `createAndWhitelistMirrorToken(string,string,address,address,uint8,(uint256,uint256,uint256))` and selector `0xdf6b022b`. + /**Function with signature `configureToken(address,(uint256,uint256,uint256))` and selector `0x9267b153`. ```solidity -function createAndWhitelistMirrorToken(string memory tokenName, string memory tokenSymbol, address existingToken, address mirrorToken, uint8 mirrorTokenDecimals, IBridge.TokenLimits memory limits) external returns (address); +function configureToken(address token, TokenLimits memory limits) external; ```*/ #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] #[derive(Clone)] - pub struct createAndWhitelistMirrorTokenCall { - #[allow(missing_docs)] - pub tokenName: alloy::sol_types::private::String, - #[allow(missing_docs)] - pub tokenSymbol: alloy::sol_types::private::String, - #[allow(missing_docs)] - pub existingToken: alloy::sol_types::private::Address, - #[allow(missing_docs)] - pub mirrorToken: alloy::sol_types::private::Address, + pub struct configureTokenCall { #[allow(missing_docs)] - pub mirrorTokenDecimals: u8, + pub token: alloy::sol_types::private::Address, #[allow(missing_docs)] - pub limits: ::RustType, + pub limits: ::RustType, } - #[derive(serde::Serialize, serde::Deserialize)] - #[derive(Default, Debug, PartialEq, Eq, Hash)] - ///Container type for the return parameters of the [`createAndWhitelistMirrorToken(string,string,address,address,uint8,(uint256,uint256,uint256))`](createAndWhitelistMirrorTokenCall) function. + ///Container type for the return parameters of the [`configureToken(address,(uint256,uint256,uint256))`](configureTokenCall) function. #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] #[derive(Clone)] - pub struct createAndWhitelistMirrorTokenReturn { - #[allow(missing_docs)] - pub _0: alloy::sol_types::private::Address, - } + pub struct configureTokenReturn {} #[allow( non_camel_case_types, non_snake_case, @@ -1871,21 +2163,13 @@ function createAndWhitelistMirrorToken(string memory tokenName, string memory to #[doc(hidden)] #[allow(dead_code)] type UnderlyingSolTuple<'a> = ( - alloy::sol_types::sol_data::String, - alloy::sol_types::sol_data::String, - alloy::sol_types::sol_data::Address, alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Uint<8>, - IBridge::TokenLimits, + TokenLimits, ); #[doc(hidden)] type UnderlyingRustTuple<'a> = ( - alloy::sol_types::private::String, - alloy::sol_types::private::String, alloy::sol_types::private::Address, - alloy::sol_types::private::Address, - u8, - ::RustType, + ::RustType, ); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] @@ -1900,31 +2184,18 @@ function createAndWhitelistMirrorToken(string memory tokenName, string memory to } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From - for UnderlyingRustTuple<'_> { - fn from(value: createAndWhitelistMirrorTokenCall) -> Self { - ( - value.tokenName, - value.tokenSymbol, - value.existingToken, - value.mirrorToken, - value.mirrorTokenDecimals, - value.limits, - ) + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: configureTokenCall) -> Self { + (value.token, value.limits) } } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From> - for createAndWhitelistMirrorTokenCall { + impl ::core::convert::From> for configureTokenCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { - tokenName: tuple.0, - tokenSymbol: tuple.1, - existingToken: tuple.2, - mirrorToken: tuple.3, - mirrorTokenDecimals: tuple.4, - limits: tuple.5, + token: tuple.0, + limits: tuple.1, } } } @@ -1932,9 +2203,9 @@ function createAndWhitelistMirrorToken(string memory tokenName, string memory to { #[doc(hidden)] #[allow(dead_code)] - type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,); + type UnderlyingSolTuple<'a> = (); #[doc(hidden)] - type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,); + type UnderlyingRustTuple<'a> = (); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( @@ -1948,87 +2219,66 @@ function createAndWhitelistMirrorToken(string memory tokenName, string memory to } #[automatically_derived] #[doc(hidden)] - impl ::core::convert::From + impl ::core::convert::From for UnderlyingRustTuple<'_> { - fn from(value: createAndWhitelistMirrorTokenReturn) -> Self { - (value._0,) + fn from(value: configureTokenReturn) -> Self { + () } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> - for createAndWhitelistMirrorTokenReturn { + for configureTokenReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { - Self { _0: tuple.0 } + Self {} } } } + impl configureTokenReturn { + fn _tokenize( + &self, + ) -> ::ReturnToken<'_> { + () + } + } #[automatically_derived] - impl alloy_sol_types::SolCall for createAndWhitelistMirrorTokenCall { - type Parameters<'a> = ( - alloy::sol_types::sol_data::String, - alloy::sol_types::sol_data::String, - alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Address, - alloy::sol_types::sol_data::Uint<8>, - IBridge::TokenLimits, - ); + impl alloy_sol_types::SolCall for configureTokenCall { + type Parameters<'a> = (alloy::sol_types::sol_data::Address, TokenLimits); type Token<'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 Return = configureTokenReturn; + type ReturnTuple<'a> = (); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; - const SIGNATURE: &'static str = "createAndWhitelistMirrorToken(string,string,address,address,uint8,(uint256,uint256,uint256))"; - const SELECTOR: [u8; 4] = [223u8, 107u8, 2u8, 43u8]; - #[inline] - fn new<'a>( - tuple: as alloy_sol_types::SolType>::RustType, - ) -> Self { - tuple.into() - } + const SIGNATURE: &'static str = "configureToken(address,(uint256,uint256,uint256))"; + const SELECTOR: [u8; 4] = [146u8, 103u8, 177u8, 83u8]; #[inline] - fn tokenize(&self) -> Self::Token<'_> { - ( - ::tokenize( - &self.tokenName, - ), - ::tokenize( - &self.tokenSymbol, - ), - ::tokenize( - &self.existingToken, - ), - ::tokenize( - &self.mirrorToken, - ), - as alloy_sol_types::SolType>::tokenize(&self.mirrorTokenDecimals), - ::tokenize( - &self.limits, - ), - ) + fn new<'a>( + tuple: as alloy_sol_types::SolType>::RustType, + ) -> Self { + tuple.into() } #[inline] - fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { + fn tokenize(&self) -> Self::Token<'_> { ( ::tokenize( - ret, + &self.token, ), + ::tokenize(&self.limits), ) } #[inline] + fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { + configureTokenReturn::_tokenize(ret) + } + #[inline] fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { as alloy_sol_types::SolType>::abi_decode_sequence(data) - .map(|r| { - let r: createAndWhitelistMirrorTokenReturn = r.into(); - r._0 - }) + .map(Into::into) } #[inline] fn abi_decode_returns_validate( @@ -2037,10 +2287,7 @@ function createAndWhitelistMirrorToken(string memory tokenName, string memory to as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) - .map(|r| { - let r: createAndWhitelistMirrorTokenReturn = r.into(); - r._0 - }) + .map(Into::into) } } }; @@ -2640,15 +2887,185 @@ function unpause() external; } } }; - ///Container for all the [`IBridgeMintBurn`](self) function calls. + #[derive(serde::Serialize, serde::Deserialize)] + #[derive(Default, Debug, PartialEq, Eq, Hash)] + /**Function with signature `whiteListToken(address,address,(uint256,uint256,uint256))` and selector `0xfc5c5cb3`. +```solidity +function whiteListToken(address token, address mirrorToken, TokenLimits memory limits) external; +```*/ + #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] + #[derive(Clone)] + pub struct whiteListTokenCall { + #[allow(missing_docs)] + pub token: alloy::sol_types::private::Address, + #[allow(missing_docs)] + pub mirrorToken: alloy::sol_types::private::Address, + #[allow(missing_docs)] + pub limits: ::RustType, + } + ///Container type for the return parameters of the [`whiteListToken(address,address,(uint256,uint256,uint256))`](whiteListTokenCall) function. + #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] + #[derive(Clone)] + pub struct whiteListTokenReturn {} + #[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::Address, + alloy::sol_types::sol_data::Address, + TokenLimits, + ); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = ( + alloy::sol_types::private::Address, + alloy::sol_types::private::Address, + ::RustType, + ); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion( + _t: alloy_sol_types::private::AssertTypeEq, + ) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: whiteListTokenCall) -> Self { + (value.token, value.mirrorToken, value.limits) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for whiteListTokenCall { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { + token: tuple.0, + mirrorToken: tuple.1, + limits: tuple.2, + } + } + } + } + { + #[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, + ) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From + for UnderlyingRustTuple<'_> { + fn from(value: whiteListTokenReturn) -> Self { + () + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> + for whiteListTokenReturn { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self {} + } + } + } + impl whiteListTokenReturn { + fn _tokenize( + &self, + ) -> ::ReturnToken<'_> { + () + } + } + #[automatically_derived] + impl alloy_sol_types::SolCall for whiteListTokenCall { + type Parameters<'a> = ( + alloy::sol_types::sol_data::Address, + alloy::sol_types::sol_data::Address, + TokenLimits, + ); + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + type Return = whiteListTokenReturn; + type ReturnTuple<'a> = (); + type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; + const SIGNATURE: &'static str = "whiteListToken(address,address,(uint256,uint256,uint256))"; + const SELECTOR: [u8; 4] = [252u8, 92u8, 92u8, 179u8]; + #[inline] + fn new<'a>( + tuple: as alloy_sol_types::SolType>::RustType, + ) -> Self { + tuple.into() + } + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + ( + ::tokenize( + &self.token, + ), + ::tokenize( + &self.mirrorToken, + ), + ::tokenize(&self.limits), + ) + } + #[inline] + fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> { + whiteListTokenReturn::_tokenize(ret) + } + #[inline] + fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result { + as alloy_sol_types::SolType>::abi_decode_sequence(data) + .map(Into::into) + } + #[inline] + fn abi_decode_returns_validate( + data: &[u8], + ) -> alloy_sol_types::Result { + as alloy_sol_types::SolType>::abi_decode_sequence_validate(data) + .map(Into::into) + } + } + }; + ///Container for all the [`IBridge`](self) function calls. #[derive(Clone)] #[derive(serde::Serialize, serde::Deserialize)] #[derive()] - pub enum IBridgeMintBurnCalls { + pub enum IBridgeCalls { #[allow(missing_docs)] - configureToken(configureTokenCall), + claim(claimCall), #[allow(missing_docs)] - createAndWhitelistMirrorToken(createAndWhitelistMirrorTokenCall), + configureToken(configureTokenCall), #[allow(missing_docs)] deposit(depositCall), #[allow(missing_docs)] @@ -2657,8 +3074,10 @@ function unpause() external; pause(pauseCall), #[allow(missing_docs)] unpause(unpauseCall), + #[allow(missing_docs)] + whiteListToken(whiteListTokenCall), } - impl IBridgeMintBurnCalls { + impl IBridgeCalls { /// All the selectors of this enum. /// /// Note that the selectors might not be in the same order as the variants. @@ -2667,29 +3086,32 @@ function unpause() external; /// Prefer using `SolInterface` methods instead. pub const SELECTORS: &'static [[u8; 4usize]] = &[ [63u8, 75u8, 168u8, 58u8], + [118u8, 131u8, 245u8, 158u8], [132u8, 86u8, 203u8, 89u8], [146u8, 103u8, 177u8, 83u8], [206u8, 84u8, 148u8, 187u8], - [223u8, 107u8, 2u8, 43u8], [244u8, 83u8, 70u8, 220u8], + [252u8, 92u8, 92u8, 179u8], ]; /// The names of the variants in the same order as `SELECTORS`. pub const VARIANT_NAMES: &'static [&'static str] = &[ ::core::stringify!(unpause), + ::core::stringify!(claim), ::core::stringify!(pause), ::core::stringify!(configureToken), ::core::stringify!(migrate), - ::core::stringify!(createAndWhitelistMirrorToken), ::core::stringify!(deposit), + ::core::stringify!(whiteListToken), ]; /// The signatures in the same order as `SELECTORS`. pub const SIGNATURES: &'static [&'static str] = &[ ::SIGNATURE, + ::SIGNATURE, ::SIGNATURE, ::SIGNATURE, ::SIGNATURE, - ::SIGNATURE, ::SIGNATURE, + ::SIGNATURE, ]; /// Returns the signature for the given selector, if known. #[inline] @@ -2713,23 +3135,24 @@ function unpause() external; } } #[automatically_derived] - impl alloy_sol_types::SolInterface for IBridgeMintBurnCalls { - const NAME: &'static str = "IBridgeMintBurnCalls"; + impl alloy_sol_types::SolInterface for IBridgeCalls { + const NAME: &'static str = "IBridgeCalls"; const MIN_DATA_LENGTH: usize = 0usize; - const COUNT: usize = 6usize; + const COUNT: usize = 7usize; #[inline] fn selector(&self) -> [u8; 4] { match self { + Self::claim(_) => ::SELECTOR, Self::configureToken(_) => { ::SELECTOR } - Self::createAndWhitelistMirrorToken(_) => { - ::SELECTOR - } Self::deposit(_) => ::SELECTOR, Self::migrate(_) => ::SELECTOR, Self::pause(_) => ::SELECTOR, Self::unpause(_) => ::SELECTOR, + Self::whiteListToken(_) => { + ::SELECTOR + } } } #[inline] @@ -2746,66 +3169,63 @@ function unpause() external; selector: [u8; 4], data: &[u8], ) -> alloy_sol_types::Result { - static DECODE_SHIMS: &[fn( - &[u8], - ) -> alloy_sol_types::Result] = &[ + static DECODE_SHIMS: &[fn(&[u8]) -> alloy_sol_types::Result] = &[ { - fn unpause( - data: &[u8], - ) -> alloy_sol_types::Result { + fn unpause(data: &[u8]) -> alloy_sol_types::Result { ::abi_decode_raw(data) - .map(IBridgeMintBurnCalls::unpause) + .map(IBridgeCalls::unpause) } unpause }, { - fn pause( - data: &[u8], - ) -> alloy_sol_types::Result { + fn claim(data: &[u8]) -> alloy_sol_types::Result { + ::abi_decode_raw(data) + .map(IBridgeCalls::claim) + } + claim + }, + { + fn pause(data: &[u8]) -> alloy_sol_types::Result { ::abi_decode_raw(data) - .map(IBridgeMintBurnCalls::pause) + .map(IBridgeCalls::pause) } pause }, { fn configureToken( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw( data, ) - .map(IBridgeMintBurnCalls::configureToken) + .map(IBridgeCalls::configureToken) } configureToken }, { - fn migrate( - data: &[u8], - ) -> alloy_sol_types::Result { + fn migrate(data: &[u8]) -> alloy_sol_types::Result { ::abi_decode_raw(data) - .map(IBridgeMintBurnCalls::migrate) + .map(IBridgeCalls::migrate) } migrate }, { - fn createAndWhitelistMirrorToken( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw( - data, - ) - .map(IBridgeMintBurnCalls::createAndWhitelistMirrorToken) + fn deposit(data: &[u8]) -> alloy_sol_types::Result { + ::abi_decode_raw(data) + .map(IBridgeCalls::deposit) } - createAndWhitelistMirrorToken + deposit }, { - fn deposit( + fn whiteListToken( data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw(data) - .map(IBridgeMintBurnCalls::deposit) + ) -> alloy_sol_types::Result { + ::abi_decode_raw( + data, + ) + .map(IBridgeCalls::whiteListToken) } - deposit + whiteListToken }, ]; let Ok(idx) = Self::SELECTORS.binary_search(&selector) else { @@ -2826,72 +3246,73 @@ function unpause() external; ) -> alloy_sol_types::Result { static DECODE_VALIDATE_SHIMS: &[fn( &[u8], - ) -> alloy_sol_types::Result] = &[ + ) -> alloy_sol_types::Result] = &[ { - fn unpause( - data: &[u8], - ) -> alloy_sol_types::Result { + fn unpause(data: &[u8]) -> alloy_sol_types::Result { ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnCalls::unpause) + .map(IBridgeCalls::unpause) } unpause }, { - fn pause( - data: &[u8], - ) -> alloy_sol_types::Result { + fn claim(data: &[u8]) -> alloy_sol_types::Result { + ::abi_decode_raw_validate( + data, + ) + .map(IBridgeCalls::claim) + } + claim + }, + { + fn pause(data: &[u8]) -> alloy_sol_types::Result { ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnCalls::pause) + .map(IBridgeCalls::pause) } pause }, { fn configureToken( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnCalls::configureToken) + .map(IBridgeCalls::configureToken) } configureToken }, { - fn migrate( - data: &[u8], - ) -> alloy_sol_types::Result { + fn migrate(data: &[u8]) -> alloy_sol_types::Result { ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnCalls::migrate) + .map(IBridgeCalls::migrate) } migrate }, { - fn createAndWhitelistMirrorToken( - data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( + fn deposit(data: &[u8]) -> alloy_sol_types::Result { + ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnCalls::createAndWhitelistMirrorToken) + .map(IBridgeCalls::deposit) } - createAndWhitelistMirrorToken + deposit }, { - fn deposit( + fn whiteListToken( data: &[u8], - ) -> alloy_sol_types::Result { - ::abi_decode_raw_validate( + ) -> alloy_sol_types::Result { + ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnCalls::deposit) + .map(IBridgeCalls::whiteListToken) } - deposit + whiteListToken }, ]; let Ok(idx) = Self::SELECTORS.binary_search(&selector) else { @@ -2907,16 +3328,14 @@ function unpause() external; #[inline] fn abi_encoded_size(&self) -> usize { match self { + Self::claim(inner) => { + ::abi_encoded_size(inner) + } Self::configureToken(inner) => { ::abi_encoded_size( inner, ) } - Self::createAndWhitelistMirrorToken(inner) => { - ::abi_encoded_size( - inner, - ) - } Self::deposit(inner) => { ::abi_encoded_size(inner) } @@ -2929,23 +3348,25 @@ function unpause() external; Self::unpause(inner) => { ::abi_encoded_size(inner) } + Self::whiteListToken(inner) => { + ::abi_encoded_size( + inner, + ) + } } } #[inline] fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec) { match self { + Self::claim(inner) => { + ::abi_encode_raw(inner, out) + } Self::configureToken(inner) => { ::abi_encode_raw( inner, out, ) } - Self::createAndWhitelistMirrorToken(inner) => { - ::abi_encode_raw( - inner, - out, - ) - } Self::deposit(inner) => { ::abi_encode_raw(inner, out) } @@ -2958,14 +3379,20 @@ function unpause() external; Self::unpause(inner) => { ::abi_encode_raw(inner, out) } + Self::whiteListToken(inner) => { + ::abi_encode_raw( + inner, + out, + ) + } } } } - ///Container for all the [`IBridgeMintBurn`](self) custom errors. + ///Container for all the [`IBridge`](self) custom errors. #[derive(Clone)] #[derive(serde::Serialize, serde::Deserialize)] #[derive(Debug, PartialEq, Eq, Hash)] - pub enum IBridgeMintBurnErrors { + pub enum IBridgeErrors { #[allow(missing_docs)] ContractMigrated(ContractMigrated), #[allow(missing_docs)] @@ -2985,7 +3412,7 @@ function unpause() external; #[allow(missing_docs)] RequestAlreadyProcessed(RequestAlreadyProcessed), } - impl IBridgeMintBurnErrors { + impl IBridgeErrors { /// All the selectors of this enum. /// /// Note that the selectors might not be in the same order as the variants. @@ -3049,8 +3476,8 @@ function unpause() external; } } #[automatically_derived] - impl alloy_sol_types::SolInterface for IBridgeMintBurnErrors { - const NAME: &'static str = "IBridgeMintBurnErrors"; + impl alloy_sol_types::SolInterface for IBridgeErrors { + const NAME: &'static str = "IBridgeErrors"; const MIN_DATA_LENGTH: usize = 0usize; const COUNT: usize = 9usize; #[inline] @@ -3101,103 +3528,103 @@ function unpause() external; ) -> alloy_sol_types::Result { static DECODE_SHIMS: &[fn( &[u8], - ) -> alloy_sol_types::Result] = &[ + ) -> alloy_sol_types::Result] = &[ { fn InvalidTokenConfig( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw( data, ) - .map(IBridgeMintBurnErrors::InvalidTokenConfig) + .map(IBridgeErrors::InvalidTokenConfig) } InvalidTokenConfig }, { fn InvalidTokenAmount( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw( data, ) - .map(IBridgeMintBurnErrors::InvalidTokenAmount) + .map(IBridgeErrors::InvalidTokenAmount) } InvalidTokenAmount }, { fn ContractMigrated( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw( data, ) - .map(IBridgeMintBurnErrors::ContractMigrated) + .map(IBridgeErrors::ContractMigrated) } ContractMigrated }, { fn InvalidBridgeContract( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw( data, ) - .map(IBridgeMintBurnErrors::InvalidBridgeContract) + .map(IBridgeErrors::InvalidBridgeContract) } InvalidBridgeContract }, { fn InvalidToAddress( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw( data, ) - .map(IBridgeMintBurnErrors::InvalidToAddress) + .map(IBridgeErrors::InvalidToAddress) } InvalidToAddress }, { fn NativeDepositNotSupported( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw( data, ) - .map(IBridgeMintBurnErrors::NativeDepositNotSupported) + .map(IBridgeErrors::NativeDepositNotSupported) } NativeDepositNotSupported }, { fn RequestAlreadyProcessed( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw( data, ) - .map(IBridgeMintBurnErrors::RequestAlreadyProcessed) + .map(IBridgeErrors::RequestAlreadyProcessed) } RequestAlreadyProcessed }, { fn MirrorTokenNotFound( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw( data, ) - .map(IBridgeMintBurnErrors::MirrorTokenNotFound) + .map(IBridgeErrors::MirrorTokenNotFound) } MirrorTokenNotFound }, { fn DailyLimitExhausted( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw( data, ) - .map(IBridgeMintBurnErrors::DailyLimitExhausted) + .map(IBridgeErrors::DailyLimitExhausted) } DailyLimitExhausted }, @@ -3220,103 +3647,103 @@ function unpause() external; ) -> alloy_sol_types::Result { static DECODE_VALIDATE_SHIMS: &[fn( &[u8], - ) -> alloy_sol_types::Result] = &[ + ) -> alloy_sol_types::Result] = &[ { fn InvalidTokenConfig( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnErrors::InvalidTokenConfig) + .map(IBridgeErrors::InvalidTokenConfig) } InvalidTokenConfig }, { fn InvalidTokenAmount( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnErrors::InvalidTokenAmount) + .map(IBridgeErrors::InvalidTokenAmount) } InvalidTokenAmount }, { fn ContractMigrated( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnErrors::ContractMigrated) + .map(IBridgeErrors::ContractMigrated) } ContractMigrated }, { fn InvalidBridgeContract( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnErrors::InvalidBridgeContract) + .map(IBridgeErrors::InvalidBridgeContract) } InvalidBridgeContract }, { fn InvalidToAddress( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnErrors::InvalidToAddress) + .map(IBridgeErrors::InvalidToAddress) } InvalidToAddress }, { fn NativeDepositNotSupported( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnErrors::NativeDepositNotSupported) + .map(IBridgeErrors::NativeDepositNotSupported) } NativeDepositNotSupported }, { fn RequestAlreadyProcessed( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnErrors::RequestAlreadyProcessed) + .map(IBridgeErrors::RequestAlreadyProcessed) } RequestAlreadyProcessed }, { fn MirrorTokenNotFound( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnErrors::MirrorTokenNotFound) + .map(IBridgeErrors::MirrorTokenNotFound) } MirrorTokenNotFound }, { fn DailyLimitExhausted( data: &[u8], - ) -> alloy_sol_types::Result { + ) -> alloy_sol_types::Result { ::abi_decode_raw_validate( data, ) - .map(IBridgeMintBurnErrors::DailyLimitExhausted) + .map(IBridgeErrors::DailyLimitExhausted) } DailyLimitExhausted }, @@ -3441,17 +3868,17 @@ function unpause() external; } } } - ///Container for all the [`IBridgeMintBurn`](self) events. + ///Container for all the [`IBridge`](self) events. #[derive(Clone)] #[derive(serde::Serialize, serde::Deserialize)] #[derive(Debug, PartialEq, Eq, Hash)] - pub enum IBridgeMintBurnEvents { + pub enum IBridgeEvents { #[allow(missing_docs)] Claim(Claim), #[allow(missing_docs)] Deposit(Deposit), } - impl IBridgeMintBurnEvents { + impl IBridgeEvents { /// All the selectors of this enum. /// /// Note that the selectors might not be in the same order as the variants. @@ -3503,8 +3930,8 @@ function unpause() external; } } #[automatically_derived] - impl alloy_sol_types::SolEventInterface for IBridgeMintBurnEvents { - const NAME: &'static str = "IBridgeMintBurnEvents"; + impl alloy_sol_types::SolEventInterface for IBridgeEvents { + const NAME: &'static str = "IBridgeEvents"; const COUNT: usize = 2usize; fn decode_raw_log( topics: &[alloy_sol_types::Word], @@ -3534,7 +3961,7 @@ function unpause() external; } } #[automatically_derived] - impl alloy_sol_types::private::IntoLogData for IBridgeMintBurnEvents { + impl alloy_sol_types::private::IntoLogData for IBridgeEvents { fn to_log_data(&self) -> alloy_sol_types::private::LogData { match self { Self::Claim(inner) => { @@ -3557,9 +3984,9 @@ function unpause() external; } } use alloy::contract as alloy_contract; - /**Creates a new wrapper around an on-chain [`IBridgeMintBurn`](self) contract instance. + /**Creates a new wrapper around an on-chain [`IBridge`](self) contract instance. -See the [wrapper's documentation](`IBridgeMintBurnInstance`) for more details.*/ +See the [wrapper's documentation](`IBridgeInstance`) for more details.*/ #[inline] pub const fn new< P: alloy_contract::private::Provider, @@ -3567,8 +3994,8 @@ See the [wrapper's documentation](`IBridgeMintBurnInstance`) for more details.*/ >( address: alloy_sol_types::private::Address, __provider: P, - ) -> IBridgeMintBurnInstance { - IBridgeMintBurnInstance::::new(address, __provider) + ) -> IBridgeInstance { + IBridgeInstance::::new(address, __provider) } /**Deploys this contract using the given `provider` and constructor arguments, if any. @@ -3582,9 +4009,9 @@ For more fine-grained control over the deployment process, use [`deploy_builder` >( __provider: P, ) -> impl ::core::future::Future< - Output = alloy_contract::Result>, + Output = alloy_contract::Result>, > { - IBridgeMintBurnInstance::::deploy(__provider) + IBridgeInstance::::deploy(__provider) } /**Creates a `RawCallBuilder` for deploying this contract using the given `provider` and constructor arguments, if any. @@ -3596,12 +4023,12 @@ the bytecode concatenated with the constructor's ABI-encoded arguments.*/ P: alloy_contract::private::Provider, N: alloy_contract::private::Network, >(__provider: P) -> alloy_contract::RawCallBuilder { - IBridgeMintBurnInstance::::deploy_builder(__provider) + IBridgeInstance::::deploy_builder(__provider) } - /**A [`IBridgeMintBurn`](self) instance. + /**A [`IBridge`](self) instance. Contains type-safe methods for interacting with an on-chain instance of the -[`IBridgeMintBurn`](self) contract located at a given `address`, using a given +[`IBridge`](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!) @@ -3610,26 +4037,26 @@ 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 IBridgeMintBurnInstance { + pub struct IBridgeInstance { address: alloy_sol_types::private::Address, provider: P, _network: ::core::marker::PhantomData, } #[automatically_derived] - impl ::core::fmt::Debug for IBridgeMintBurnInstance { + impl ::core::fmt::Debug for IBridgeInstance { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_tuple("IBridgeMintBurnInstance").field(&self.address).finish() + f.debug_tuple("IBridgeInstance").field(&self.address).finish() } } /// Instantiation and getters/setters. impl< P: alloy_contract::private::Provider, N: alloy_contract::private::Network, - > IBridgeMintBurnInstance { - /**Creates a new wrapper around an on-chain [`IBridgeMintBurn`](self) contract instance. + > IBridgeInstance { + /**Creates a new wrapper around an on-chain [`IBridge`](self) contract instance. -See the [wrapper's documentation](`IBridgeMintBurnInstance`) for more details.*/ +See the [wrapper's documentation](`IBridgeInstance`) for more details.*/ #[inline] pub const fn new( address: alloy_sol_types::private::Address, @@ -3649,7 +4076,7 @@ For more fine-grained control over the deployment process, use [`deploy_builder` #[inline] pub async fn deploy( __provider: P, - ) -> alloy_contract::Result> { + ) -> alloy_contract::Result> { let call_builder = Self::deploy_builder(__provider); let contract_address = call_builder.deploy().await?; Ok(Self::new(contract_address, call_builder.provider)) @@ -3687,11 +4114,11 @@ the bytecode concatenated with the constructor's ABI-encoded arguments.*/ &self.provider } } - impl IBridgeMintBurnInstance<&P, N> { + impl IBridgeInstance<&P, N> { /// Clones the provider and returns a new instance with the cloned provider. #[inline] - pub fn with_cloned_provider(self) -> IBridgeMintBurnInstance { - IBridgeMintBurnInstance { + pub fn with_cloned_provider(self) -> IBridgeInstance { + IBridgeInstance { address: self.address, provider: ::core::clone::Clone::clone(&self.provider), _network: ::core::marker::PhantomData, @@ -3702,7 +4129,7 @@ the bytecode concatenated with the constructor's ABI-encoded arguments.*/ impl< P: alloy_contract::private::Provider, N: alloy_contract::private::Network, - > IBridgeMintBurnInstance { + > IBridgeInstance { /// 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 @@ -3713,36 +4140,36 @@ the bytecode concatenated with the constructor's ABI-encoded arguments.*/ ) -> alloy_contract::SolCallBuilder<&P, C, N> { alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call) } - ///Creates a new call builder for the [`configureToken`] function. - pub fn configureToken( + ///Creates a new call builder for the [`claim`] function. + pub fn claim( &self, token: alloy::sol_types::private::Address, - limits: ::RustType, - ) -> alloy_contract::SolCallBuilder<&P, configureTokenCall, N> { + amount: alloy::sol_types::private::primitives::aliases::U256, + to: alloy::sol_types::private::Address, + committeeEpoch: u64, + aggregatedSignatures: alloy::sol_types::private::Bytes, + proof: ::RustType, + ) -> alloy_contract::SolCallBuilder<&P, claimCall, N> { self.call_builder( - &configureTokenCall { + &claimCall { token, - limits, + amount, + to, + committeeEpoch, + aggregatedSignatures, + proof, }, ) } - ///Creates a new call builder for the [`createAndWhitelistMirrorToken`] function. - pub fn createAndWhitelistMirrorToken( + ///Creates a new call builder for the [`configureToken`] function. + pub fn configureToken( &self, - tokenName: alloy::sol_types::private::String, - tokenSymbol: alloy::sol_types::private::String, - existingToken: alloy::sol_types::private::Address, - mirrorToken: alloy::sol_types::private::Address, - mirrorTokenDecimals: u8, - limits: ::RustType, - ) -> alloy_contract::SolCallBuilder<&P, createAndWhitelistMirrorTokenCall, N> { + token: alloy::sol_types::private::Address, + limits: ::RustType, + ) -> alloy_contract::SolCallBuilder<&P, configureTokenCall, N> { self.call_builder( - &createAndWhitelistMirrorTokenCall { - tokenName, - tokenSymbol, - existingToken, - mirrorToken, - mirrorTokenDecimals, + &configureTokenCall { + token, limits, }, ) @@ -3771,12 +4198,27 @@ the bytecode concatenated with the constructor's ABI-encoded arguments.*/ pub fn unpause(&self) -> alloy_contract::SolCallBuilder<&P, unpauseCall, N> { self.call_builder(&unpauseCall) } + ///Creates a new call builder for the [`whiteListToken`] function. + pub fn whiteListToken( + &self, + token: alloy::sol_types::private::Address, + mirrorToken: alloy::sol_types::private::Address, + limits: ::RustType, + ) -> alloy_contract::SolCallBuilder<&P, whiteListTokenCall, N> { + self.call_builder( + &whiteListTokenCall { + token, + mirrorToken, + limits, + }, + ) + } } /// Event filters. impl< P: alloy_contract::private::Provider, N: alloy_contract::private::Network, - > IBridgeMintBurnInstance { + > IBridgeInstance { /// 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. diff --git a/protocol/bindings/src/lib.rs b/protocol/bindings/src/lib.rs index b6dcff5f..d49b16d7 100644 --- a/protocol/bindings/src/lib.rs +++ b/protocol/bindings/src/lib.rs @@ -3,6 +3,5 @@ //! This is autogenerated code. //! Do not manually edit these files. //! These files may be overwritten by the codegen system at any time. -pub mod r#bridge_deposit_withdraw; -pub mod r#i_bridge_mint_burn; +pub mod r#i_bridge; pub mod r#wrapped_token; diff --git a/protocol/foundry.toml b/protocol/foundry.toml index 3c83deb9..8e6be08a 100644 --- a/protocol/foundry.toml +++ b/protocol/foundry.toml @@ -13,6 +13,8 @@ remappings = [ ] allow_paths = ["../solidity-sdk"] via_ir = true +optimizer = true +optimizer_runs = 4294967295 # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options @@ -21,4 +23,3 @@ exclude = ["lib/**"] [lint] exclude_lints = ["incorrect-shift"] - diff --git a/protocol/script/DeployDepositWithdraw.s.sol b/protocol/script/DeployBridge.s.sol similarity index 69% rename from protocol/script/DeployDepositWithdraw.s.sol rename to protocol/script/DeployBridge.s.sol index 4d4bbc2a..b037346d 100644 --- a/protocol/script/DeployDepositWithdraw.s.sol +++ b/protocol/script/DeployBridge.s.sol @@ -3,15 +3,16 @@ pragma solidity ^0.8.20; import {BaseDeployer} from "./BaseDeployer.s.sol"; import {console} from "forge-std/console.sol"; -import {BridgeDepositWithdraw} from "pod-protocol/BridgeDepositWithdraw.sol"; +import {Bridge} from "pod-protocol/Bridge.sol"; import {PodRegistry} from "pod-protocol/PodRegistry.sol"; -contract DeployDepositWithdraw is BaseDeployer { +contract Deploy is BaseDeployer { function run(address podBridgeAddr) external returns (address podRegistry, address depositWithdraw) { address[] memory initialValidators = getValidatorAddresses(); vm.startBroadcast(); - PodRegistry reg = new PodRegistry(initialValidators); - BridgeDepositWithdraw bdw = new BridgeDepositWithdraw(address(reg), podBridgeAddr); + uint8 f = uint8((initialValidators.length - 1) / 3); + PodRegistry reg = new PodRegistry(initialValidators, f); + Bridge bdw = new Bridge(address(reg), podBridgeAddr); vm.stopBroadcast(); console.log("PodRegistry deployed at:", address(reg)); console.log("BridgeDepositWithdraw deployed at:", address(bdw)); diff --git a/protocol/script/PodRegistryDeployer.s.sol b/protocol/script/PodRegistryDeployer.s.sol index 3eea022c..9a41db3e 100644 --- a/protocol/script/PodRegistryDeployer.s.sol +++ b/protocol/script/PodRegistryDeployer.s.sol @@ -9,9 +9,10 @@ import {PodRegistry} from "../src/PodRegistry.sol"; contract PodRegistryDeployer is BaseDeployer { function run() public { address[] memory initialValidators = getValidatorAddresses(); + uint256 f = (initialValidators.length - 1) / 3; vm.startBroadcast(); - PodRegistry podRegistry = new PodRegistry(initialValidators); + PodRegistry podRegistry = new PodRegistry(initialValidators, uint8(f)); vm.stopBroadcast(); console.log("PodRegistry deployed:"); diff --git a/protocol/script/benchmark.sh b/protocol/script/benchmark.sh index 9063889f..b69e175c 100755 --- a/protocol/script/benchmark.sh +++ b/protocol/script/benchmark.sh @@ -13,7 +13,7 @@ echo "Running BridgeDepositWithdraw benchmarks..." echo "" # Run forge test and capture output (need -vv for logs) -OUTPUT=$(forge test --match-contract BridgeDepositWithdrawBenchmark -vv 2>&1) +OUTPUT=$(forge test --match-contract BridgeBenchmark -vv 2>&1) # Extract gas values using grep and awk declare -A claim_gas diff --git a/protocol/script/deploy_bridge.bash b/protocol/script/deploy_bridge.bash index 8c145e48..123f96b3 100755 --- a/protocol/script/deploy_bridge.bash +++ b/protocol/script/deploy_bridge.bash @@ -18,7 +18,7 @@ echo "POD_BRIDGE_ADDR: $POD_BRIDGE_ADDR" echo "POD_COMMITTEE_KEYS: $POD_COMMITTEE_KEYS" # Deploy BridgeDepositWithdraw on Source chain (Anvil/Sepolia) -OUTPUT=$(forge script ./script/DeployDepositWithdraw.s.sol:DeployDepositWithdraw \ +OUTPUT=$(forge script ./script/DeployBridge.s.sol:Deploy \ --rpc-url "$SOURCE_CHAIN_RPC" --private-key "$PK_SOURCE_CHAIN" --broadcast --slow \ --json \ --sig "run(address)" \ diff --git a/protocol/src/Bridge.sol b/protocol/src/Bridge.sol new file mode 100644 index 00000000..26cc786b --- /dev/null +++ b/protocol/src/Bridge.sol @@ -0,0 +1,233 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {IBridge} from "./interfaces/IBridge.sol"; +import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; +import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol"; + +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import {PodECDSA} from "pod-sdk/verifier/PodECDSA.sol"; +import {ECDSA} from "pod-sdk/verifier/ECDSA.sol"; +import {MerkleTree} from "pod-sdk/verifier/MerkleTree.sol"; +import {IPodRegistry} from "pod-protocol/interfaces/IPodRegistry.sol"; +import {AttestedTx} from "pod-protocol/libraries/AttestedTx.sol"; + +/** + * @title BridgeDepositWithdraw + * @notice Implementation of the deposit-withdraw bridge. + * @dev This contract implements the IBridgeDepositWithdraw interface and provides the functionality for + * depositing and withdrawing tokens between chains. + */ +contract Bridge is IBridge, AccessControl, Pausable { + using SafeERC20 for IERC20; + + bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); + + // The mock address for native deposit. EIP-7528 + address constant MOCK_ADDRESS_FOR_NATIVE_DEPOSIT = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); + + mapping(address => TokenData) public tokenData; + mapping(address => address) public mirrorTokens; + mapping(bytes32 => bool) public processedRequests; + + address[] public whitelistedTokens; + address public migratedContract; + address public bridgeContract; // bridge contract on the other chain + + uint256 public depositIndex; + + IPodRegistry immutable public podRegistry; + bytes32 private immutable BRIDGE_CONTRACT_HASH; // keccak256(abi.encode(bridgeContract)) + + /** + * @dev Constructor. + * @param _podRegistry The address of the PodRegistry to use. + * @param _bridgeContract The address of the bridge contract on the other chain. + */ + constructor(address _podRegistry, address _bridgeContract) { + if (_bridgeContract == address(0)) revert InvalidBridgeContract(); + _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); + _grantRole(PAUSER_ROLE, msg.sender); + bridgeContract = _bridgeContract; + + podRegistry = IPodRegistry(_podRegistry); + BRIDGE_CONTRACT_HASH = keccak256(abi.encode(_bridgeContract)); + } + + modifier notMigrated() { + _notMigrated(); + _; + } + + function _notMigrated() internal view { + if (migratedContract != address(0)) { + revert ContractMigrated(); + } + } + + function checkInLimits(TokenUsage storage usage, uint256 minAmount, uint256 maxTotalAmount, uint256 amount) + internal + { + uint256 consumed = usage.consumed; + if (amount < minAmount) { + revert InvalidTokenAmount(); + } + if (block.timestamp >= usage.lastUpdated + 1 days) { + usage.lastUpdated = block.timestamp; + consumed = 0; + } + + if (consumed + amount > maxTotalAmount) { + revert DailyLimitExhausted(); + } + usage.consumed = consumed + amount; + } + + function deposit(address token, uint256 amount, address to) + external + payable + whenNotPaused + returns (bytes32) + { + if (to == address(0)) revert InvalidToAddress(); + + TokenData storage t = tokenData[token]; + if (t.limits.minAmount == 0) { + revert InvalidTokenAmount(); + } + checkInLimits(t.deposit, t.limits.minAmount, t.limits.deposit, amount); + + bytes32 id = _getDepositId(); + IERC20(token).safeTransferFrom(msg.sender, address(this), amount); + + emit Deposit(id, token, amount, to); + return id; + } + + function _configureTokenData(address token, TokenLimits memory limits, bool newToken) internal { + uint256 currMinAmount = tokenData[token].limits.minAmount; + if (limits.minAmount == 0 || (newToken ? currMinAmount != 0 : currMinAmount == 0)) { + revert InvalidTokenConfig(); + } + + TokenUsage memory usage = TokenUsage({consumed: 0, lastUpdated: block.timestamp}); + TokenData memory data = TokenData({limits: limits, deposit: usage, claim: usage}); + tokenData[token] = data; + } + + + function configureToken(address token, TokenLimits memory limits) external onlyRole(DEFAULT_ADMIN_ROLE) { + _configureTokenData(token, limits, false); + } + + function _whitelistToken(address token, address mirrorToken, TokenLimits memory limits) internal { + if (mirrorTokens[mirrorToken] != address(0)) { + revert InvalidTokenConfig(); + } + + _configureTokenData(token, limits, true); + whitelistedTokens.push(token); + mirrorTokens[mirrorToken] = token; + } + + + function pause() external onlyRole(PAUSER_ROLE) { + _pause(); + } + + function unpause() external notMigrated onlyRole(DEFAULT_ADMIN_ROLE) { + _unpause(); + } + + function migrate(address _newContract) public whenPaused notMigrated onlyRole(DEFAULT_ADMIN_ROLE) { + handleMigrate(_newContract); + migratedContract = _newContract; + } + + + function _getDepositId() internal returns (bytes32) { + return bytes32(depositIndex++); + } + + + function handleMigrate(address _newContract) internal { + for (uint256 i = 0; i < whitelistedTokens.length; i++) { + address token = whitelistedTokens[i]; + uint256 tokenBalance = IERC20(token).balanceOf(address(this)); + if (tokenBalance > 0) { + IERC20(token).safeTransfer(_newContract, tokenBalance); + } + } + } + + /// @dev Hashes deposit input: selector + token + amount + to (100 bytes) using inline assembly + /// Equivalent to keccak256(abi.encodePacked(bytes4(keccak256("deposit(address,uint256,address)")), abi.encode(token, amount, to))) + function _hashDepositInput(address token, uint256 amount, address to) internal pure returns (bytes32 result) { + bytes4 selector = bytes4(keccak256("deposit(address,uint256,address)")); + assembly { + let ptr := mload(0x40) + // Store selector in first 4 bytes + mstore(ptr, selector) + // Store token (32 bytes) starting at byte 4 + mstore(add(ptr, 0x04), token) + // Store amount (32 bytes) starting at byte 36 + mstore(add(ptr, 0x24), amount) + // Store to (32 bytes) starting at byte 68 + mstore(add(ptr, 0x44), to) + result := keccak256(ptr, 0x64) // 100 bytes = 0x64 + } + } + + function claim( + address token, + uint256 amount, + address to, + uint64 committeeEpoch, + bytes calldata aggregatedSignatures, + MerkleTree.MultiProof calldata proof + ) public whenNotPaused { + address localToken = mirrorTokens[token]; + if (localToken == address(0)) revert MirrorTokenNotFound(); + + TokenData storage t = tokenData[localToken]; + checkInLimits(t.claim, t.limits.minAmount, t.limits.claim, amount); + + // Build leaves for validating merkle proof (no 'from' verification - anyone can claim) + bytes32[] memory leaves = new bytes32[](2); + leaves[0] = MerkleTree.hashLeaf("to", BRIDGE_CONTRACT_HASH); + leaves[1] = MerkleTree.hashLeaf("input", _hashDepositInput(token, amount, to)); + + // Compute the merkle root from leaves and proof + bytes32 txHash = MerkleTree.processMulti(leaves, proof); + + // Check if already processed + if (processedRequests[txHash]) revert RequestAlreadyProcessed(); + + // Reconstruct AttestedTx and verify signatures + bytes32 signedHash = AttestedTx.digest(txHash, committeeEpoch); + address[] memory validators = ECDSA.recoverSigners(signedHash, aggregatedSignatures); + + // TODO: compute weight assumes that its the latest validator set! + (uint256 weight, uint256 n, uint256 f) = podRegistry.computeWeightWithConfig(validators); + require(weight >= n - f, "Not enough validator weight"); + + processedRequests[txHash] = true; + + IERC20(localToken).safeTransfer(to, amount); + emit Claim(txHash, localToken, token, amount, to); + } + + /** + * @param token Token that will be deposited in the contract (local/destination token). + * @param mirrorToken Token that will be deposited in the mirror contract (source token). + * @param limits Token limits associated with the token. + */ + function whiteListToken(address token, address mirrorToken, TokenLimits calldata limits) + external + onlyRole(DEFAULT_ADMIN_ROLE) + { + require(token != address(0), "Token address cannot be zero"); + _whitelistToken(token, mirrorToken, limits); + } +} diff --git a/protocol/src/BridgeDepositWithdraw.sol b/protocol/src/BridgeDepositWithdraw.sol deleted file mode 100644 index 399c0f0c..00000000 --- a/protocol/src/BridgeDepositWithdraw.sol +++ /dev/null @@ -1,160 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; - -import {IBridgeDepositWithdraw} from "pod-protocol/interfaces/IBridgeDepositWithdraw.sol"; -import {Bridge} from "pod-protocol/abstract/Bridge.sol"; -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import {PodECDSA} from "pod-sdk/verifier/PodECDSA.sol"; -import {ECDSA} from "pod-sdk/verifier/ECDSA.sol"; -import {MerkleTree} from "pod-sdk/verifier/MerkleTree.sol"; -import {IPodRegistry} from "pod-protocol/interfaces/IPodRegistry.sol"; -import {AttestedTx} from "pod-protocol/libraries/AttestedTx.sol"; -import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; - -/** - * @title BridgeDepositWithdraw - * @notice Implementation of the deposit-withdraw bridge. - * @dev This contract implements the IBridgeDepositWithdraw interface and provides the functionality for - * depositing and withdrawing tokens between chains. - */ -contract BridgeDepositWithdraw is Bridge, IBridgeDepositWithdraw { - using SafeERC20 for IERC20; - - /** - * @dev The PodConfig for the bridge. The config defines the required number - * of signatures to consider a certificate valid and the PodRegistry to use. - */ - PodECDSA.PodConfig public podConfig; - - /** - * @dev The index of the next deposit. - */ - uint256 public depositIndex; - - /** - * @dev Pre-computed hash of bridgeContract for merkle leaf construction. - */ - bytes32 private immutable BRIDGE_CONTRACT_HASH; - - /** - * @dev Constructor. - * @param _podRegistry The address of the PodRegistry to use. - * @param _bridgeContract The address of the bridge contract on the other chain. - */ - constructor(address _podRegistry, address _bridgeContract) Bridge(_bridgeContract) { - podConfig = - PodECDSA.PodConfig({thresholdNumerator: 1, thresholdDenominator: 1, registry: IPodRegistry(_podRegistry)}); - BRIDGE_CONTRACT_HASH = keccak256(abi.encode(_bridgeContract)); - } - - /** - * @dev Handles the deposit of tokens. The tokens are transferred from the msg.sender to the contract. - * @dev Native deposits are not supported on this bridge. - * @param token The token to deposit. - * @param amount The amount of tokens to deposit. - */ - function handleDeposit(address token, uint256 amount) internal override { - IERC20(token).safeTransferFrom(msg.sender, address(this), amount); - } - - /** - * @dev Internal function to get the deposit ID. - * @return id The request ID of the deposit. - */ - function _getDepositId() internal override returns (bytes32) { - return bytes32(depositIndex++); - } - - /** - * @dev Handles the migration of tokens. The tokens are transferred from the contract to the new contract. - * @param _newContract The address of the new contract. - */ - function handleMigrate(address _newContract) internal override { - for (uint256 i = 0; i < whitelistedTokens.length; i++) { - address token = whitelistedTokens[i]; - uint256 tokenBalance = IERC20(token).balanceOf(address(this)); - if (tokenBalance > 0) { - IERC20(token).safeTransfer(_newContract, tokenBalance); - } - } - } - - /// @dev Hashes deposit input: selector + token + amount + to (100 bytes) using inline assembly - /// Equivalent to keccak256(abi.encodePacked(bytes4(keccak256("deposit(address,uint256,address)")), abi.encode(token, amount, to))) - function _hashDepositInput(address token, uint256 amount, address to) internal pure returns (bytes32 result) { - bytes4 selector = bytes4(keccak256("deposit(address,uint256,address)")); - assembly { - let ptr := mload(0x40) - // Store selector in first 4 bytes - mstore(ptr, selector) - // Store token (32 bytes) starting at byte 4 - mstore(add(ptr, 0x04), token) - // Store amount (32 bytes) starting at byte 36 - mstore(add(ptr, 0x24), amount) - // Store to (32 bytes) starting at byte 68 - mstore(add(ptr, 0x44), to) - result := keccak256(ptr, 0x64) // 100 bytes = 0x64 - } - } - - /** - * @inheritdoc IBridgeDepositWithdraw - */ - function claim( - address token, - uint256 amount, - address to, - uint64 committeeEpoch, - bytes calldata aggregatedSignatures, - MerkleTree.MultiProof calldata proof - ) public override whenNotPaused { - address localToken = mirrorTokens[token]; - if (localToken == address(0)) revert MirrorTokenNotFound(); - checkValidClaim(localToken, amount); - - // Build leaves for validating merkle proof (no 'from' verification - anyone can claim) - bytes32[] memory leaves = new bytes32[](2); - leaves[0] = MerkleTree.hashLeaf("to", BRIDGE_CONTRACT_HASH); - leaves[1] = MerkleTree.hashLeaf("input", _hashDepositInput(token, amount, to)); - - // Compute the merkle root from leaves and proof - bytes32 txHash = MerkleTree.processMulti(leaves, proof); - - // Check if already processed - if (processedRequests[txHash]) revert RequestAlreadyProcessed(); - - // Reconstruct AttestedTx and verify signatures - bytes32 signedHash = AttestedTx.digest(txHash, committeeEpoch); - address[] memory validators = ECDSA.recoverSigners(signedHash, aggregatedSignatures); - - uint256 weight = podConfig.registry.computeWeight(validators); - - uint256 threshold = Math.mulDiv( - podConfig.registry.getValidatorCountAtIndex(committeeEpoch), - podConfig.thresholdNumerator, - podConfig.thresholdDenominator, - Math.Rounding.Ceil - ); - require(weight >= threshold, "Not enough validator weight"); - - processedRequests[txHash] = true; - - IERC20(localToken).safeTransfer(to, amount); - emit Claim(txHash, localToken, token, amount, to); - } - - /** - * @inheritdoc IBridgeDepositWithdraw - * @param token Token that will be deposited in the contract (local/destination token). - * @param mirrorToken Token that will be deposited in the mirror contract (source token). - * @param limits Token limits associated with the token. - */ - function whiteListToken(address token, address mirrorToken, TokenLimits calldata limits) - external - onlyRole(DEFAULT_ADMIN_ROLE) - { - require(token != address(0), "Token address cannot be zero"); - _whitelistToken(token, mirrorToken, limits); - } -} diff --git a/protocol/src/PodRegistry.sol b/protocol/src/PodRegistry.sol index 9e9d445b..650cb3ce 100644 --- a/protocol/src/PodRegistry.sol +++ b/protocol/src/PodRegistry.sol @@ -35,31 +35,13 @@ contract PodRegistry is IPodRegistry, Ownable { */ uint256 constant CHECK_COUNT = 3; - /** - * @notice Array of historical snapshots for time-based verification - */ Snapshot[] public history; - - /** - * @notice Mapping from validator address to their 1-based index - */ - mapping(address => uint8) public validatorIndex; - - /** - * @notice Array of validators in the registry. We also use `validators.length + 1` to track the 1-based - * index of the next validator to add. - */ + mapping(address => uint8) public validatorIndex; // validator address to their 1-based index address[] public validators; - /** - * @notice Bitmap of the currently active validators - */ uint256 public activeValidatorBitmap; - - /** - * @notice Bitmap of the currently banned validators - */ uint256 public bannedValidatorBitmap; + uint8 public latestAdverserialResilience; /** * @notice Initialize the registry with a set of initial validators. Only creates one snapshot @@ -67,11 +49,12 @@ contract PodRegistry is IPodRegistry, Ownable { * @param initialValidators Array of validator addresses to initialize with * @dev The contract owner will be set to msg.sender */ - constructor(address[] memory initialValidators) Ownable(msg.sender) { + constructor(address[] memory initialValidators, uint8 adverserialResilience) Ownable(msg.sender) { for (uint8 i = 0; i < initialValidators.length; i++) { _addValidator(initialValidators[i]); activeValidatorBitmap |= (1 << i); } + latestAdverserialResilience = adverserialResilience; _createSnapshot(); } @@ -108,6 +91,10 @@ contract PodRegistry is IPodRegistry, Ownable { emit ValidatorAdded(validator); } + function updateResilience(uint8 newResilience) external onlyOwner { + latestAdverserialResilience = newResilience; + } + /** * @inheritdoc IPodRegistry */ @@ -185,7 +172,12 @@ contract PodRegistry is IPodRegistry, Ownable { function _createSnapshot() internal { uint8 count = _popCount(activeValidatorBitmap); history.push( - Snapshot({activeAsOfTimestamp: block.timestamp, bitmap: activeValidatorBitmap, validatorCount: count}) + Snapshot({ + activeAsOfTimestamp: block.timestamp, + bitmap: activeValidatorBitmap, + validatorCount: count, + adverserialResilience: latestAdverserialResilience + }) ); emit SnapshotCreated(block.timestamp, activeValidatorBitmap); } @@ -194,11 +186,24 @@ contract PodRegistry is IPodRegistry, Ownable { * @inheritdoc IPodRegistry */ function computeWeight(address[] memory subset) public view returns (uint256 weight) { - if (history.length == 0) { + uint256 historyLength = history.length; + if (historyLength == 0) { return 0; } - return computeWeight(subset, block.timestamp, history.length - 1); + return _computeWeight(subset, history[historyLength - 1].bitmap); + } + + function computeWeightWithConfig(address[] memory subset) public view returns (uint256 weight, uint256 n, uint256 f) { + uint256 historyLength = history.length; + if (historyLength == 0) { + return (0, 0, 0); + } + + Snapshot memory curr = history[historyLength - 1]; + weight = _computeWeight(subset, curr.bitmap); + n = curr.validatorCount; + f = curr.adverserialResilience; } /** @@ -220,7 +225,15 @@ contract PodRegistry is IPodRegistry, Ownable { revert SnapshotTooOld(); } - uint256 counted = 0; + return _computeWeight(subset, snapshot.bitmap); + } + + + function _computeWeight(address[] memory subset, uint256 validatorBitmap) + internal + view + returns (uint256 weight) + { for (uint256 i = 0; i < subset.length; i++) { uint8 index = validatorIndex[subset[i]]; if (index == 0) { @@ -228,13 +241,14 @@ contract PodRegistry is IPodRegistry, Ownable { } index = index - 1; - if (_isBitSet(snapshot.bitmap, index) && !_isBitSet(counted, index)) { - counted = _setBit(counted, index); - weight++; - } + uint256 mask = (1 << index); + if ((validatorBitmap & mask) != 0) weight++; // found an active validator + validatorBitmap &= ~mask; // clear bit to avoid double counting } } + + /** * @inheritdoc IPodRegistry */ diff --git a/protocol/src/abstract/Bridge.sol b/protocol/src/abstract/Bridge.sol deleted file mode 100644 index 3cb2f737..00000000 --- a/protocol/src/abstract/Bridge.sol +++ /dev/null @@ -1,218 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; - -import {IBridge} from "../interfaces/IBridge.sol"; -import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; -import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol"; - -/** - * @title Bridge - * @notice Abstract base contract for cross-chain token bridging implementations. - * @dev This contract implements the IBridge interface and provides common functionality - * for bridging tokens between chains. It serves as a base contract for both - * BridgeMintBurn and BridgeDepositWithdraw concrete implementations. - * - * The contract uses the Template Method design pattern (https://refactoring.guru/design-patterns/template-method) - * where the core deposit and migrate functions are implemented here, but delegate specific token handling logic to - * the callback functions (handleDeposit and handleMigrate) that must be implemented by concrete contracts. - */ -abstract contract Bridge is IBridge, AccessControl, Pausable { - /** - * @dev The role ID for addresses that can pause the contract. - */ - bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); - - /** - * @dev The mock address for native deposit. - * @notice Address as proposed in EIP-7528 - */ - address constant MOCK_ADDRESS_FOR_NATIVE_DEPOSIT = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); - - /** - * @dev Map token address to token data. - */ - mapping(address => TokenData) public tokenData; - - /** - * @dev Map source chain token address to destination chain token address. - */ - mapping(address => address) public mirrorTokens; - - /** - * @dev Map request hash to processed requests. - */ - mapping(bytes32 => bool) public processedRequests; - - /** - * @dev Array of all the whitelisted tokens. - * @notice A token in the list can be disabled. - */ - address[] public whitelistedTokens; - - /** - * @dev Address of the migrated contract. - */ - address public migratedContract; - - /** - * @dev The address of the bridge contract on the other chain. - */ - address public bridgeContract; - - /** - * @dev Constructor. - * @notice Grants the DEFAULT_ADMIN_ROLE and PAUSER_ROLE to the msg.sender. - */ - constructor(address _bridgeContract) { - if (_bridgeContract == address(0)) revert InvalidBridgeContract(); - _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); - _grantRole(PAUSER_ROLE, msg.sender); - bridgeContract = _bridgeContract; - } - - /** - * @dev Internal function to handle the deposit of tokens. - * This is a callback defining the different token handling logic for the different bridge contracts. - * @param token The token to deposit (address(0) for native). - * @param amount The amount of tokens to deposit. - */ - function handleDeposit(address token, uint256 amount) internal virtual; - - /** - * @dev Internal function to get the deposit ID. - * This is a callback defining the different deposit ID logic for the different bridge contracts. - * @return id The request ID of the deposit. - */ - function _getDepositId() internal virtual returns (bytes32); - - /** - * @dev Internal function to handle the migration of tokens. - * This is a callback defining the different token handling logic for the different bridge contracts. - * @param _newContract The address of the new contract. - */ - function handleMigrate(address _newContract) internal virtual; - - /** - * @dev Modifier to check that contract has not been migrated. - * @dev Reverts with ContractMigrated if the contract has already been migrated. - */ - modifier notMigrated() { - _notMigrated(); - _; - } - - function _notMigrated() internal view { - if (migratedContract != address(0)) { - revert ContractMigrated(); - } - } - - function checkValidDeposit(address token, uint256 amount) internal { - TokenData storage t = tokenData[token]; - checkInLimits(t.deposit, t.limits.minAmount, t.limits.deposit, amount); - } - - function checkValidClaim(address token, uint256 amount) internal { - TokenData storage t = tokenData[token]; - checkInLimits(t.claim, t.limits.minAmount, t.limits.claim, amount); - } - - function checkInLimits(TokenUsage storage usage, uint256 minAmount, uint256 maxTotalAmount, uint256 amount) - internal - { - if (minAmount == 0 || amount < minAmount) { - revert InvalidTokenAmount(); - } - if (block.timestamp >= usage.lastUpdated + 1 days) { - usage.lastUpdated = block.timestamp; - usage.consumed = 0; - } - - if (usage.consumed + amount > maxTotalAmount) { - revert DailyLimitExhausted(); - } - usage.consumed += amount; - } - - /** - * @inheritdoc IBridge - */ - function deposit(address token, uint256 amount, address to) - external - payable - override - whenNotPaused - returns (bytes32) - { - if (to == address(0)) revert InvalidToAddress(); - if (token == address(0)) revert NativeDepositNotSupported(); - - checkValidDeposit(token, amount); - bytes32 id = _getDepositId(); - handleDeposit(token, amount); - emit Deposit(id, token, amount, to); - return id; - } - - /** - * @dev Internal function to configure the token data. - * @param token The token to configure. - * @param limits The token limits to configure. - * @param newToken Whether the token is new. - */ - function _configureTokenData(address token, TokenLimits memory limits, bool newToken) internal { - uint256 currMinAmount = tokenData[token].limits.minAmount; - if (limits.minAmount == 0 || (newToken ? currMinAmount != 0 : currMinAmount == 0)) { - revert InvalidTokenConfig(); - } - - TokenUsage memory usage = TokenUsage({consumed: 0, lastUpdated: block.timestamp}); - TokenData memory data = TokenData({limits: limits, deposit: usage, claim: usage}); - tokenData[token] = data; - } - - /** - * @inheritdoc IBridge - */ - function configureToken(address token, TokenLimits memory limits) external onlyRole(DEFAULT_ADMIN_ROLE) { - _configureTokenData(token, limits, false); - } - - /** - * @dev Internal function to whitelist a new token. - * @param token Token that will be deposited in the contract. - * @param mirrorToken Token that will be deposited in the mirror contract. - * @param limits Token limits associated with the token. - */ - function _whitelistToken(address token, address mirrorToken, TokenLimits memory limits) internal { - if (mirrorTokens[mirrorToken] != address(0)) { - revert InvalidTokenConfig(); - } - - _configureTokenData(token, limits, true); - whitelistedTokens.push(token); - mirrorTokens[mirrorToken] = token; - } - - /** - * @inheritdoc IBridge - */ - function pause() external onlyRole(PAUSER_ROLE) { - _pause(); - } - - /** - * @inheritdoc IBridge - */ - function unpause() external notMigrated onlyRole(DEFAULT_ADMIN_ROLE) { - _unpause(); - } - - /** - * @inheritdoc IBridge - */ - function migrate(address _newContract) public whenPaused notMigrated onlyRole(DEFAULT_ADMIN_ROLE) { - handleMigrate(_newContract); - migratedContract = _newContract; - } -} diff --git a/protocol/src/interfaces/IBridge.sol b/protocol/src/interfaces/IBridge.sol index 6e511233..36e55e15 100644 --- a/protocol/src/interfaces/IBridge.sol +++ b/protocol/src/interfaces/IBridge.sol @@ -1,6 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.20; +import {MerkleTree} from "pod-sdk/verifier/MerkleTree.sol"; + /** * @title IBridge * @notice Interface for cross-chain token bridging contracts. @@ -49,11 +51,6 @@ interface IBridge { */ error InvalidBridgeContract(); - /** - * @dev Error thrown when attempting to deposit native tokens (not supported on this bridge). - */ - error NativeDepositNotSupported(); - /** * @dev Event emitted when a deposit is made. * @param id The request index. @@ -151,4 +148,36 @@ interface IBridge { * @notice Migration can only be done once on this contract */ function migrate(address _newContract) external; + + /** + * @notice Whitelist a token for bridging. + * @dev Use MOCK_ADDRESS_FOR_NATIVE_DEPOSIT for token to indicate native currency. + * - token=MOCK_ADDRESS_FOR_NATIVE_DEPOSIT: source mirrorToken maps to local native currency. + * @param token Token that will be deposited in the contract (local/destination token). + * @param mirrorToken Token that will be deposited in the mirror contract (source token). + * @param limits Daily limits for deposits and claims. + */ + function whiteListToken(address token, address mirrorToken, TokenLimits calldata limits) external; + + /** + * @notice Claim bridged tokens using an attested transaction proof from Pod. + * @dev Verifies the deposit transaction via merkle proof and aggregated validator signatures. + * The transaction hash (AttestedTx.hash) is computed from the merkle proof. + * Anyone can call this function to claim on behalf of the original depositor. + * If mirrorToken is address(0), native tokens are transferred; otherwise ERC20 tokens. + * @param token The token address on Pod that was deposited. + * @param amount The amount of tokens that were deposited on Pod (and to claim). + * @param to The address to receive the tokens (must match the 'to' specified in the deposit). + * @param committeeEpoch The committee epoch for validator signature verification. + * @param aggregatedSignatures Concatenated 65-byte ECDSA signatures (r,s,v) from validators. + * @param proof The Merkle multi-proof for verifying transaction fields (to, input). + */ + function claim( + address token, + uint256 amount, + address to, + uint64 committeeEpoch, + bytes calldata aggregatedSignatures, + MerkleTree.MultiProof calldata proof + ) external; } diff --git a/protocol/src/interfaces/IBridgeDepositWithdraw.sol b/protocol/src/interfaces/IBridgeDepositWithdraw.sol deleted file mode 100644 index 89ea81e8..00000000 --- a/protocol/src/interfaces/IBridgeDepositWithdraw.sol +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; - -import {IBridge} from "./IBridge.sol"; -import {MerkleTree} from "pod-sdk/verifier/MerkleTree.sol"; - -/** - * @title IBridgeDepositWithdraw - * @notice Interface for deposit-withdraw bridge implementation. - * @dev Extends IBridge to add token whitelisting and claiming through attested transaction verification. - * Supports token-to-token, token-to-native, and native-to-token bridging. - * Use MOCK_ADDRESS_FOR_NATIVE_DEPOSIT for token or mirrorToken to indicate native currency. - */ -interface IBridgeDepositWithdraw is IBridge { - /** - * @notice Whitelist a token for bridging. - * @dev Use MOCK_ADDRESS_FOR_NATIVE_DEPOSIT for token to indicate native currency. - * - token=MOCK_ADDRESS_FOR_NATIVE_DEPOSIT: source mirrorToken maps to local native currency. - * @param token Token that will be deposited in the contract (local/destination token). - * @param mirrorToken Token that will be deposited in the mirror contract (source token). - * @param limits Daily limits for deposits and claims. - */ - function whiteListToken(address token, address mirrorToken, TokenLimits calldata limits) external; - - /** - * @notice Claim bridged tokens using an attested transaction proof from Pod. - * @dev Verifies the deposit transaction via merkle proof and aggregated validator signatures. - * The transaction hash (AttestedTx.hash) is computed from the merkle proof. - * Anyone can call this function to claim on behalf of the original depositor. - * If mirrorToken is address(0), native tokens are transferred; otherwise ERC20 tokens. - * @param token The token address on Pod that was deposited. - * @param amount The amount of tokens that were deposited on Pod (and to claim). - * @param to The address to receive the tokens (must match the 'to' specified in the deposit). - * @param committeeEpoch The committee epoch for validator signature verification. - * @param aggregatedSignatures Concatenated 65-byte ECDSA signatures (r,s,v) from validators. - * @param proof The Merkle multi-proof for verifying transaction fields (to, input). - */ - function claim( - address token, - uint256 amount, - address to, - uint64 committeeEpoch, - bytes calldata aggregatedSignatures, - MerkleTree.MultiProof calldata proof - ) external; -} diff --git a/protocol/src/interfaces/IBridgeMintBurn.sol b/protocol/src/interfaces/IBridgeMintBurn.sol deleted file mode 100644 index 441009f2..00000000 --- a/protocol/src/interfaces/IBridgeMintBurn.sol +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; - -import {IBridge} from "./IBridge.sol"; - -/** - * @title IBridgeMintBurn - * @notice Interface for mint-burn bridge implementation. - * @dev Extends IBridge to add token creation and claiming through external precompile verification. - */ -interface IBridgeMintBurn is IBridge { - /** - * @notice Create and whitelist a mirror token for bridging. - * @param tokenName Name of the token to create. - * @param tokenSymbol Symbol of the token to create. - * @param existingToken Address of existing token (0 to create new). - * @param mirrorToken Source chain token address. - * @param mirrorTokenDecimals Decimals of the mirror token. - * @param limits Daily limits for deposits and claims. - * @return Address of the created or existing token. - */ - function createAndWhitelistMirrorToken( - string memory tokenName, - string memory tokenSymbol, - address existingToken, - address mirrorToken, - uint8 mirrorTokenDecimals, - TokenLimits calldata limits - ) external returns (address); -} diff --git a/protocol/src/interfaces/IPodRegistry.sol b/protocol/src/interfaces/IPodRegistry.sol index 21d35fdb..e9e53725 100644 --- a/protocol/src/interfaces/IPodRegistry.sol +++ b/protocol/src/interfaces/IPodRegistry.sol @@ -19,7 +19,8 @@ interface IPodRegistry { struct Snapshot { uint256 activeAsOfTimestamp; uint256 bitmap; - uint8 validatorCount; + uint8 validatorCount; // n + uint8 adverserialResilience; // f } /// @notice Error thrown when a validator is a zero address @@ -152,6 +153,19 @@ interface IPodRegistry { */ function computeWeight(address[] memory subset) external view returns (uint256 weight); + /** + * @notice Compute the weight of a subset of currently active validators + * @param subset Array of validator addresses to compute weight for + * @return weight The computed weight (count of unique active validators in the subset) + * @return n The total number of active validators + * @return f The adversarial resilience (maximum number of faulty validators tolerated) + * @dev Uses the most recent snapshot for computation + */ + function computeWeightWithConfig(address[] memory subset) + external + view + returns (uint256 weight, uint256 n, uint256 f); + /** * @notice Compute the weight of a subset of validators at a specific historical point * @param subset Array of validator addresses to compute weight for diff --git a/protocol/test/BridgeDepositWithdraw.benchmark.sol b/protocol/test/Bridge.benchmark.sol similarity index 89% rename from protocol/test/BridgeDepositWithdraw.benchmark.sol rename to protocol/test/Bridge.benchmark.sol index 4b364fae..67bc7444 100644 --- a/protocol/test/BridgeDepositWithdraw.benchmark.sol +++ b/protocol/test/Bridge.benchmark.sol @@ -3,14 +3,14 @@ pragma solidity ^0.8.20; import {console} from "forge-std/Test.sol"; import {BridgeClaimProofHelper} from "./abstract/BridgeClaimProofHelper.sol"; -import {BridgeDepositWithdraw} from "../src/BridgeDepositWithdraw.sol"; +import {Bridge} from "../src/Bridge.sol"; import {IBridge} from "../src/interfaces/IBridge.sol"; import {PodRegistry} from "../src/PodRegistry.sol"; import {MerkleTree} from "pod-sdk/verifier/MerkleTree.sol"; import {WrappedToken} from "../src/WrappedToken.sol"; -contract BridgeDepositWithdrawBenchmark is BridgeClaimProofHelper { - BridgeDepositWithdraw private bridge; +contract BridgeBenchmark is BridgeClaimProofHelper { + Bridge private bridge; PodRegistry private podRegistry; WrappedToken private token; @@ -35,8 +35,9 @@ contract BridgeDepositWithdrawBenchmark is BridgeClaimProofHelper { initialValidators[i] = vm.addr(validatorPrivateKeys[i]); } - podRegistry = new PodRegistry(initialValidators); - bridge = new BridgeDepositWithdraw(address(podRegistry), otherBridgeContract); + uint8 f = uint8((initialValidators.length - 1) / 3); + podRegistry = new PodRegistry(initialValidators, f); + bridge = new Bridge(address(podRegistry), otherBridgeContract); // Setup token for claim() benchmarks token = new WrappedToken("TestToken", "TKN", 18); diff --git a/protocol/test/BridgeDepositWithdraw.t.sol b/protocol/test/Bridge.t.sol similarity index 95% rename from protocol/test/BridgeDepositWithdraw.t.sol rename to protocol/test/Bridge.t.sol index 5bcbdb7b..c3965010 100644 --- a/protocol/test/BridgeDepositWithdraw.t.sol +++ b/protocol/test/Bridge.t.sol @@ -3,9 +3,8 @@ pragma solidity ^0.8.20; import {BridgeBehaviorTest} from "./abstract/Bridge.t.sol"; import {BridgeClaimProofHelper} from "./abstract/BridgeClaimProofHelper.sol"; -import {BridgeDepositWithdraw} from "../src/BridgeDepositWithdraw.sol"; +import {Bridge} from "../src/Bridge.sol"; import {IBridge} from "../src/interfaces/IBridge.sol"; -import {Bridge} from "../src/abstract/Bridge.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IPodRegistry} from "../src/interfaces/IPodRegistry.sol"; import {PodRegistry} from "../src/PodRegistry.sol"; @@ -13,8 +12,8 @@ import {MerkleTree} from "pod-sdk/verifier/MerkleTree.sol"; import {WrappedToken} from "../src/WrappedToken.sol"; import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol"; -contract BridgeDepositWithdrawTest is BridgeBehaviorTest, BridgeClaimProofHelper { - BridgeDepositWithdraw private _bridge; +contract BridgeTest is BridgeBehaviorTest, BridgeClaimProofHelper { + Bridge private _bridge; WrappedToken private _token; IPodRegistry podRegistry; uint256 constant NUMBER_OF_VALIDATORS = 4; @@ -30,6 +29,7 @@ contract BridgeDepositWithdrawTest is BridgeBehaviorTest, BridgeClaimProofHelper function setUpSuite() public override { vm.startPrank(admin); + uint8 f = uint8((NUMBER_OF_VALIDATORS - 1) / 3); address[] memory initialValidators = new address[](NUMBER_OF_VALIDATORS); validatorPrivateKeys = new uint256[](NUMBER_OF_VALIDATORS); @@ -40,8 +40,8 @@ contract BridgeDepositWithdrawTest is BridgeBehaviorTest, BridgeClaimProofHelper initialValidators[i] = vm.addr(validatorPrivateKeys[i]); } - podRegistry = new PodRegistry(initialValidators); - _bridge = new BridgeDepositWithdraw(address(podRegistry), otherBridgeContract); + podRegistry = new PodRegistry(initialValidators, f); + _bridge = new Bridge(address(podRegistry), otherBridgeContract); _token = new WrappedToken("InitialToken", "ITKN", 18); _token.mint(user, INITIAL_BALANCE); @@ -214,7 +214,7 @@ contract BridgeDepositWithdrawTest is BridgeBehaviorTest, BridgeClaimProofHelper function test_Migrate_NoWhitelistedTokens() public { vm.prank(admin); - BridgeDepositWithdraw fresh = new BridgeDepositWithdraw(address(podRegistry), otherBridgeContract); + Bridge fresh = new Bridge(address(podRegistry), otherBridgeContract); vm.prank(admin); fresh.pause(); vm.prank(admin); @@ -283,7 +283,7 @@ contract BridgeDepositWithdrawTest is BridgeBehaviorTest, BridgeClaimProofHelper function test_DepositNative_NotSupported() public { vm.deal(user, DEPOSIT_AMOUNT); vm.prank(user); - vm.expectRevert(abi.encodeWithSelector(IBridge.NativeDepositNotSupported.selector)); + vm.expectRevert(abi.encodeWithSelector(IBridge.InvalidTokenAmount.selector)); bridge().deposit{value: DEPOSIT_AMOUNT}(address(0), 0, user); } } diff --git a/protocol/test/PodRegistry.t.sol b/protocol/test/PodRegistry.t.sol index 389e224d..a38c7bcf 100644 --- a/protocol/test/PodRegistry.t.sol +++ b/protocol/test/PodRegistry.t.sol @@ -5,6 +5,8 @@ import {Test} from "forge-std/Test.sol"; import {PodRegistry} from "../src/PodRegistry.sol"; import {IPodRegistry} from "../src/interfaces/IPodRegistry.sol"; +import {console} from "forge-std/console.sol"; + contract PodRegistryTest is Test { PodRegistry public registry; address public owner = address(1); @@ -18,7 +20,7 @@ contract PodRegistryTest is Test { initialValidators[0] = validator1; initialValidators[1] = validator2; vm.prank(owner); - registry = new PodRegistry(initialValidators); + registry = new PodRegistry(initialValidators, 1); } function test_Initialization() public view { @@ -369,8 +371,11 @@ contract PodRegistryTest is Test { vm.prank(owner); registry.addValidator(validator3); // snapshot at index 1 uint256 timestampAtAdd = block.timestamp; + console.log(timestampAtAdd); + console.log(timestampAtAdd); vm.warp(block.timestamp + 5); + console.log(timestampAtAdd); vm.prank(owner); registry.banValidator(validator1); // snapshot at index 2 @@ -379,6 +384,7 @@ contract PodRegistryTest is Test { subset[0] = validator1; subset[1] = validator3; + console.log(timestampAtAdd); vm.expectRevert(abi.encodeWithSignature("SnapshotTooNew()")); registry.computeWeight(subset, timestampAtAdd, 2); } @@ -392,7 +398,7 @@ contract PodRegistryTest is Test { } function test_ComputeWeight_NoHistoryReturnsZero() public { - PodRegistry emptyRegistry = new PodRegistry(new address[](0)); + PodRegistry emptyRegistry = new PodRegistry(new address[](0), 0); address[] memory subset = new address[](1); subset[0] = validator1; assertEq(emptyRegistry.computeWeight(subset), 0); diff --git a/protocol/test/abstract/Bridge.t.sol b/protocol/test/abstract/Bridge.t.sol index 98a1eeaa..19d53224 100644 --- a/protocol/test/abstract/Bridge.t.sol +++ b/protocol/test/abstract/Bridge.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.20; import {PodTest} from "pod-sdk/test/podTest.sol"; -import {Bridge} from "../../src/abstract/Bridge.sol"; +import {Bridge} from "../../src/Bridge.sol"; import {IBridge} from "../../src/interfaces/IBridge.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol"; diff --git a/solidity-sdk/src/verifier/ECDSA.sol b/solidity-sdk/src/verifier/ECDSA.sol index 944a7fbe..fe1fdef7 100644 --- a/solidity-sdk/src/verifier/ECDSA.sol +++ b/solidity-sdk/src/verifier/ECDSA.sol @@ -70,41 +70,35 @@ library ECDSA { } } } + + function recoverSigner(bytes32 digest, Signature memory signature) internal pure returns (address) { + return ecrecover(digest, signature.v, signature.r, signature.s); + } - // Takes an aggregate signature and returns the decoded ECDSA signatures. - function disaggregate_signatures(bytes memory aggregate) internal pure returns (bytes[] memory signatures) { - require(aggregate.length % 65 == 0, "invalid aggregate length"); + function recoverSigners(bytes32 digest, bytes memory aggregateSignature) internal pure returns (address[] memory) { + require(aggregateSignature.length % 65 == 0, "invalid aggregate length"); - uint256 signatureCount = aggregate.length / 65; - signatures = new bytes[](signatureCount); + uint256 signatureCount = aggregateSignature.length / 65; + address[] memory signers = new address[](signatureCount); + uint256 offset; assembly { - let aggregatePtr := add(aggregate, 32) - - for { let i := 0 } lt(i, signatureCount) { i := add(i, 1) } { - let signature := mload(64) - mstore(signature, 65) + offset := add(aggregateSignature, 32) + } - mstore(add(signature, 32), mload(aggregatePtr)) - mstore(add(signature, 64), mload(add(aggregatePtr, 32))) - mstore8(add(signature, 96), byte(0, mload(add(aggregatePtr, 64)))) + for (uint256 i = 0; i < signatureCount; i++) { + bytes32 r; + bytes32 s; + uint8 v; - mstore(add(signatures, mul(32, add(i, 1))), signature) - aggregatePtr := add(aggregatePtr, 65) - mstore(64, add(signature, 97)) + assembly { + r := mload(offset) + s := mload(add(offset, 32)) + v := byte(0, mload(add(offset, 64))) } - } - } - - function recoverSigner(bytes32 digest, Signature memory signature) internal pure returns (address) { - return ecrecover(digest, signature.v, signature.r, signature.s); - } - function recoverSigners(bytes32 digest, bytes memory aggregateSignature) internal pure returns (address[] memory) { - bytes[] memory signatures = disaggregate_signatures(aggregateSignature); - address[] memory signers = new address[](signatures.length); - for (uint256 i = 0; i < signatures.length; i++) { - signers[i] = recoverSigner(digest, deserialize_signature(signatures[i])); + signers[i] = ecrecover(digest, v, r, s); + offset += 65; } return signers;