-
Notifications
You must be signed in to change notification settings - Fork 4
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 <francesco@fulminlabs.org>
- Loading branch information
1 parent
4b2e8c8
commit 7d7a12a
Showing
10 changed files
with
4,180 additions
and
1,342 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[package] | ||
name = "flood-contracts" | ||
version = "4.2.0" | ||
edition = "2021" | ||
edition="2021" | ||
name ="flood-contracts" | ||
version="4.3.0" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
# 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"] } | ||
ethers={version="2", default-features=false, features=["abigen"]} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
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,185 @@ | ||
pub use i_zone_with_fees::*; | ||
/// 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 i_zone_with_fees { | ||
pub use super::super::shared_types::*; | ||
#[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("fee"), | ||
::std::vec![ | ||
::ethers::core::abi::ethabi::Function { | ||
name: ::std::borrow::ToOwned::to_owned("fee"), | ||
inputs: ::std::vec![ | ||
::ethers::core::abi::ethabi::Param { | ||
name: ::std::borrow::ToOwned::to_owned("order"), | ||
kind: ::ethers::core::abi::ethabi::ParamType::Tuple( | ||
::std::vec![ | ||
::ethers::core::abi::ethabi::ParamType::Address, | ||
::ethers::core::abi::ethabi::ParamType::Address, | ||
::ethers::core::abi::ethabi::ParamType::Array( | ||
::std::boxed::Box::new( | ||
::ethers::core::abi::ethabi::ParamType::Tuple( | ||
::std::vec![ | ||
::ethers::core::abi::ethabi::ParamType::Address, | ||
::ethers::core::abi::ethabi::ParamType::Uint(256usize), | ||
], | ||
), | ||
), | ||
), | ||
::ethers::core::abi::ethabi::ParamType::Array( | ||
::std::boxed::Box::new( | ||
::ethers::core::abi::ethabi::ParamType::Tuple( | ||
::std::vec![ | ||
::ethers::core::abi::ethabi::ParamType::Address, | ||
::ethers::core::abi::ethabi::ParamType::Uint(256usize), | ||
], | ||
), | ||
), | ||
), | ||
::ethers::core::abi::ethabi::ParamType::Uint(256usize), | ||
::ethers::core::abi::ethabi::ParamType::Uint(256usize), | ||
], | ||
), | ||
internal_type: ::core::option::Option::Some( | ||
::std::borrow::ToOwned::to_owned("struct IFloodPlain.Order"), | ||
), | ||
}, | ||
], | ||
outputs: ::std::vec![ | ||
::ethers::core::abi::ethabi::Param { | ||
name: ::std::string::String::new(), | ||
kind: ::ethers::core::abi::ethabi::ParamType::Address, | ||
internal_type: ::core::option::Option::Some( | ||
::std::borrow::ToOwned::to_owned("address"), | ||
), | ||
}, | ||
::ethers::core::abi::ethabi::Param { | ||
name: ::std::string::String::new(), | ||
kind: ::ethers::core::abi::ethabi::ParamType::Uint( | ||
256usize, | ||
), | ||
internal_type: ::core::option::Option::Some( | ||
::std::borrow::ToOwned::to_owned("uint256"), | ||
), | ||
}, | ||
], | ||
constant: ::core::option::Option::None, | ||
state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, | ||
}, | ||
], | ||
), | ||
]), | ||
events: ::std::collections::BTreeMap::new(), | ||
errors: ::std::collections::BTreeMap::new(), | ||
receive: false, | ||
fallback: false, | ||
} | ||
} | ||
///The parsed JSON ABI of the contract. | ||
pub static IZONEWITHFEES_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = ::ethers::contract::Lazy::new( | ||
__abi, | ||
); | ||
pub struct IZoneWithFees<M>(::ethers::contract::Contract<M>); | ||
impl<M> ::core::clone::Clone for IZoneWithFees<M> { | ||
fn clone(&self) -> Self { | ||
Self(::core::clone::Clone::clone(&self.0)) | ||
} | ||
} | ||
impl<M> ::core::ops::Deref for IZoneWithFees<M> { | ||
type Target = ::ethers::contract::Contract<M>; | ||
fn deref(&self) -> &Self::Target { | ||
&self.0 | ||
} | ||
} | ||
impl<M> ::core::ops::DerefMut for IZoneWithFees<M> { | ||
fn deref_mut(&mut self) -> &mut Self::Target { | ||
&mut self.0 | ||
} | ||
} | ||
impl<M> ::core::fmt::Debug for IZoneWithFees<M> { | ||
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { | ||
f.debug_tuple(::core::stringify!(IZoneWithFees)) | ||
.field(&self.address()) | ||
.finish() | ||
} | ||
} | ||
impl<M: ::ethers::providers::Middleware> IZoneWithFees<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(), | ||
IZONEWITHFEES_ABI.clone(), | ||
client, | ||
), | ||
) | ||
} | ||
///Calls the contract's `fee` (0xb169cabb) function | ||
pub fn fee( | ||
&self, | ||
order: Order, | ||
) -> ::ethers::contract::builders::ContractCall< | ||
M, | ||
(::ethers::core::types::Address, ::ethers::core::types::U256), | ||
> { | ||
self.0 | ||
.method_hash([177, 105, 202, 187], (order,)) | ||
.expect("method not found (this should never happen)") | ||
} | ||
} | ||
impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>> | ||
for IZoneWithFees<M> { | ||
fn from(contract: ::ethers::contract::Contract<M>) -> Self { | ||
Self::new(contract.address(), contract.client()) | ||
} | ||
} | ||
///Container type for all input parameters for the `fee` function with signature `fee((address,address,(address,uint256)[],(address,uint256)[],uint256,uint256))` and selector `0xb169cabb` | ||
#[derive( | ||
Clone, | ||
::ethers::contract::EthCall, | ||
::ethers::contract::EthDisplay, | ||
Default, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash | ||
)] | ||
#[ethcall( | ||
name = "fee", | ||
abi = "fee((address,address,(address,uint256)[],(address,uint256)[],uint256,uint256))" | ||
)] | ||
pub struct FeeCall { | ||
pub order: Order, | ||
} | ||
///Container type for all return fields from the `fee` function with signature `fee((address,address,(address,uint256)[],(address,uint256)[],uint256,uint256))` and selector `0xb169cabb` | ||
#[derive( | ||
Clone, | ||
::ethers::contract::EthAbiType, | ||
::ethers::contract::EthAbiCodec, | ||
Default, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash | ||
)] | ||
pub struct FeeReturn( | ||
pub ::ethers::core::types::Address, | ||
pub ::ethers::core::types::U256, | ||
); | ||
} |
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
Oops, something went wrong.