-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Francesco <[email protected]>
- Loading branch information
1 parent
03c21d4
commit 1bae322
Showing
11 changed files
with
10,120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,7 @@ docs/ | |
|
||
# Node | ||
node_modules/ | ||
|
||
# Rust | ||
**/target | ||
**/Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
edition = "2021" | ||
name = "flood-contracts" | ||
version = "5.0.0" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
ethers = {version = "2", default-features = false, features = ["abigen"] } | ||
serde = {version = "1.0.193", features = ["derive"] } |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
pub use ieip712::*; | ||
/// This module was auto-generated with ethers-rs Abigen. | ||
/// More information at: <https://github.com/gakonst/ethers-rs> | ||
#[allow( | ||
clippy::enum_variant_names, | ||
clippy::too_many_arguments, | ||
clippy::upper_case_acronyms, | ||
clippy::type_complexity, | ||
dead_code, | ||
non_camel_case_types, | ||
)] | ||
pub mod ieip712 { | ||
#[allow(deprecated)] | ||
fn __abi() -> ::ethers::core::abi::Abi { | ||
::ethers::core::abi::ethabi::Contract { | ||
constructor: ::core::option::Option::None, | ||
functions: ::core::convert::From::from([ | ||
( | ||
::std::borrow::ToOwned::to_owned("DOMAIN_SEPARATOR"), | ||
::std::vec![ | ||
::ethers::core::abi::ethabi::Function { | ||
name: ::std::borrow::ToOwned::to_owned("DOMAIN_SEPARATOR"), | ||
inputs: ::std::vec![], | ||
outputs: ::std::vec![ | ||
::ethers::core::abi::ethabi::Param { | ||
name: ::std::string::String::new(), | ||
kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes( | ||
32usize, | ||
), | ||
internal_type: ::core::option::Option::Some( | ||
::std::borrow::ToOwned::to_owned("bytes32"), | ||
), | ||
}, | ||
], | ||
constant: ::core::option::Option::None, | ||
state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, | ||
}, | ||
], | ||
), | ||
]), | ||
events: ::std::collections::BTreeMap::new(), | ||
errors: ::std::collections::BTreeMap::new(), | ||
receive: false, | ||
fallback: false, | ||
} | ||
} | ||
///The parsed JSON ABI of the contract. | ||
pub static IEIP712_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = ::ethers::contract::Lazy::new( | ||
__abi, | ||
); | ||
pub struct IEIP712<M>(::ethers::contract::Contract<M>); | ||
impl<M> ::core::clone::Clone for IEIP712<M> { | ||
fn clone(&self) -> Self { | ||
Self(::core::clone::Clone::clone(&self.0)) | ||
} | ||
} | ||
impl<M> ::core::ops::Deref for IEIP712<M> { | ||
type Target = ::ethers::contract::Contract<M>; | ||
fn deref(&self) -> &Self::Target { | ||
&self.0 | ||
} | ||
} | ||
impl<M> ::core::ops::DerefMut for IEIP712<M> { | ||
fn deref_mut(&mut self) -> &mut Self::Target { | ||
&mut self.0 | ||
} | ||
} | ||
impl<M> ::core::fmt::Debug for IEIP712<M> { | ||
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { | ||
f.debug_tuple(::core::stringify!(IEIP712)).field(&self.address()).finish() | ||
} | ||
} | ||
impl<M: ::ethers::providers::Middleware> IEIP712<M> { | ||
/// Creates a new contract instance with the specified `ethers` client at | ||
/// `address`. The contract derefs to a `ethers::Contract` object. | ||
pub fn new<T: Into<::ethers::core::types::Address>>( | ||
address: T, | ||
client: ::std::sync::Arc<M>, | ||
) -> Self { | ||
Self( | ||
::ethers::contract::Contract::new( | ||
address.into(), | ||
IEIP712_ABI.clone(), | ||
client, | ||
), | ||
) | ||
} | ||
///Calls the contract's `DOMAIN_SEPARATOR` (0x3644e515) function | ||
pub fn domain_separator( | ||
&self, | ||
) -> ::ethers::contract::builders::ContractCall<M, [u8; 32]> { | ||
self.0 | ||
.method_hash([54, 68, 229, 21], ()) | ||
.expect("method not found (this should never happen)") | ||
} | ||
} | ||
impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>> | ||
for IEIP712<M> { | ||
fn from(contract: ::ethers::contract::Contract<M>) -> Self { | ||
Self::new(contract.address(), contract.client()) | ||
} | ||
} | ||
///Container type for all input parameters for the `DOMAIN_SEPARATOR` function with signature `DOMAIN_SEPARATOR()` and selector `0x3644e515` | ||
#[derive( | ||
Clone, | ||
::ethers::contract::EthCall, | ||
::ethers::contract::EthDisplay, | ||
serde::Serialize, | ||
serde::Deserialize, | ||
Default, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash | ||
)] | ||
#[ethcall(name = "DOMAIN_SEPARATOR", abi = "DOMAIN_SEPARATOR()")] | ||
pub struct DomainSeparatorCall; | ||
///Container type for all return fields from the `DOMAIN_SEPARATOR` function with signature `DOMAIN_SEPARATOR()` and selector `0x3644e515` | ||
#[derive( | ||
Clone, | ||
::ethers::contract::EthAbiType, | ||
::ethers::contract::EthAbiCodec, | ||
serde::Serialize, | ||
serde::Deserialize, | ||
Default, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash | ||
)] | ||
pub struct DomainSeparatorReturn(pub [u8; 32]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![allow(clippy::all)] | ||
//! This lib contains abigen! generated bindings for solidity contracts. | ||
//! This is autogenerated code. | ||
//! Do not manually edit these files. | ||
//! These files may be overwritten by the codegen system at any time. | ||
|
||
pub mod flood_plain; | ||
pub mod i_auth_zone; | ||
pub mod i_signature_transfer; | ||
pub mod ieip712; | ||
pub mod shared_types; | ||
pub mod zone; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
///`AddressFilter(address,bool)` | ||
#[derive( | ||
Clone, | ||
::ethers::contract::EthAbiType, | ||
::ethers::contract::EthAbiCodec, | ||
serde::Serialize, | ||
serde::Deserialize, | ||
Default, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash | ||
)] | ||
pub struct AddressFilter { | ||
pub value: ::ethers::core::types::Address, | ||
pub exclude: bool, | ||
} | ||
///`AuthFilter(bool,(address,bool),((address,bool),(uint256,uint256))[],((address,bool),(uint256,uint256)),(uint256,uint256),(uint256,uint256))` | ||
#[derive( | ||
Clone, | ||
::ethers::contract::EthAbiType, | ||
::ethers::contract::EthAbiCodec, | ||
serde::Serialize, | ||
serde::Deserialize, | ||
Default, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash | ||
)] | ||
pub struct AuthFilter { | ||
pub initialized: bool, | ||
pub offerer: AddressFilter, | ||
pub offer: ::std::vec::Vec<ItemFilter>, | ||
pub consideration: ItemFilter, | ||
pub deadline: RangeFilter, | ||
pub nonce: RangeFilter, | ||
} | ||
///`ItemFilter((address,bool),(uint256,uint256))` | ||
#[derive( | ||
Clone, | ||
::ethers::contract::EthAbiType, | ||
::ethers::contract::EthAbiCodec, | ||
serde::Serialize, | ||
serde::Deserialize, | ||
Default, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash | ||
)] | ||
pub struct ItemFilter { | ||
pub token: AddressFilter, | ||
pub amount: RangeFilter, | ||
} | ||
///`RangeFilter(uint256,uint256)` | ||
#[derive( | ||
Clone, | ||
::ethers::contract::EthAbiType, | ||
::ethers::contract::EthAbiCodec, | ||
serde::Serialize, | ||
serde::Deserialize, | ||
Default, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash | ||
)] | ||
pub struct RangeFilter { | ||
pub gte: ::ethers::core::types::U256, | ||
pub lte: ::ethers::core::types::U256, | ||
} | ||
///`Hook(address,bytes)` | ||
#[derive( | ||
Clone, | ||
::ethers::contract::EthAbiType, | ||
::ethers::contract::EthAbiCodec, | ||
serde::Serialize, | ||
serde::Deserialize, | ||
Default, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash | ||
)] | ||
pub struct Hook { | ||
pub target: ::ethers::core::types::Address, | ||
pub data: ::ethers::core::types::Bytes, | ||
} | ||
///`Item(address,uint256)` | ||
#[derive( | ||
Clone, | ||
::ethers::contract::EthAbiType, | ||
::ethers::contract::EthAbiCodec, | ||
serde::Serialize, | ||
serde::Deserialize, | ||
Default, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash | ||
)] | ||
pub struct Item { | ||
pub token: ::ethers::core::types::Address, | ||
pub amount: ::ethers::core::types::U256, | ||
} | ||
///`Order(address,address,address,(address,uint256)[],(address,uint256),uint256,uint256,(address,bytes)[],(address,bytes)[])` | ||
#[derive( | ||
Clone, | ||
::ethers::contract::EthAbiType, | ||
::ethers::contract::EthAbiCodec, | ||
serde::Serialize, | ||
serde::Deserialize, | ||
Default, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash | ||
)] | ||
pub struct Order { | ||
pub offerer: ::ethers::core::types::Address, | ||
pub zone: ::ethers::core::types::Address, | ||
pub recipient: ::ethers::core::types::Address, | ||
pub offer: ::std::vec::Vec<Item>, | ||
pub consideration: Item, | ||
pub deadline: ::ethers::core::types::U256, | ||
pub nonce: ::ethers::core::types::U256, | ||
pub pre_hooks: ::std::vec::Vec<Hook>, | ||
pub post_hooks: ::std::vec::Vec<Hook>, | ||
} | ||
///`SignedOrder((address,address,address,(address,uint256)[],(address,uint256),uint256,uint256,(address,bytes)[],(address,bytes)[]),bytes)` | ||
#[derive( | ||
Clone, | ||
::ethers::contract::EthAbiType, | ||
::ethers::contract::EthAbiCodec, | ||
serde::Serialize, | ||
serde::Deserialize, | ||
Default, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash | ||
)] | ||
pub struct SignedOrder { | ||
pub order: Order, | ||
pub signature: ::ethers::core::types::Bytes, | ||
} | ||
///`FeeInfo(address,uint64)` | ||
#[derive( | ||
Clone, | ||
::ethers::contract::EthAbiType, | ||
::ethers::contract::EthAbiCodec, | ||
serde::Serialize, | ||
serde::Deserialize, | ||
Default, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash | ||
)] | ||
pub struct FeeInfo { | ||
pub recipient: ::ethers::core::types::Address, | ||
pub bps: u64, | ||
} |
Oops, something went wrong.