Skip to content

Commit

Permalink
generate bindings
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco <francesco@fulminlabs.org>
  • Loading branch information
fulminmaxi committed Nov 15, 2023
1 parent 4b2e8c8 commit 7d7a12a
Show file tree
Hide file tree
Showing 10 changed files with 4,180 additions and 1,342 deletions.
2,776 changes: 2,776 additions & 0 deletions bindings/rust/Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions bindings/rust/Cargo.toml
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"]}
959 changes: 959 additions & 0 deletions bindings/rust/src/auth_zone_filter.rs

Large diffs are not rendered by default.

59 changes: 33 additions & 26 deletions bindings/rust/src/erc20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,52 +919,59 @@ pub mod erc20 {
data: impl AsRef<[u8]>,
) -> ::core::result::Result<Self, ::ethers::core::abi::AbiError> {
let data = data.as_ref();
if let Ok(decoded)
= <AllowanceCall as ::ethers::core::abi::AbiDecode>::decode(data) {
if let Ok(decoded) = <AllowanceCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::Allowance(decoded));
}
if let Ok(decoded)
= <ApproveCall as ::ethers::core::abi::AbiDecode>::decode(data) {
if let Ok(decoded) = <ApproveCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::Approve(decoded));
}
if let Ok(decoded)
= <BalanceOfCall as ::ethers::core::abi::AbiDecode>::decode(data) {
if let Ok(decoded) = <BalanceOfCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::BalanceOf(decoded));
}
if let Ok(decoded)
= <DecimalsCall as ::ethers::core::abi::AbiDecode>::decode(data) {
if let Ok(decoded) = <DecimalsCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::Decimals(decoded));
}
if let Ok(decoded)
= <DecreaseAllowanceCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
if let Ok(decoded) = <DecreaseAllowanceCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::DecreaseAllowance(decoded));
}
if let Ok(decoded)
= <IncreaseAllowanceCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
if let Ok(decoded) = <IncreaseAllowanceCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::IncreaseAllowance(decoded));
}
if let Ok(decoded)
= <NameCall as ::ethers::core::abi::AbiDecode>::decode(data) {
if let Ok(decoded) = <NameCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::Name(decoded));
}
if let Ok(decoded)
= <SymbolCall as ::ethers::core::abi::AbiDecode>::decode(data) {
if let Ok(decoded) = <SymbolCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::Symbol(decoded));
}
if let Ok(decoded)
= <TotalSupplyCall as ::ethers::core::abi::AbiDecode>::decode(data) {
if let Ok(decoded) = <TotalSupplyCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::TotalSupply(decoded));
}
if let Ok(decoded)
= <TransferCall as ::ethers::core::abi::AbiDecode>::decode(data) {
if let Ok(decoded) = <TransferCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::Transfer(decoded));
}
if let Ok(decoded)
= <TransferFromCall as ::ethers::core::abi::AbiDecode>::decode(data) {
if let Ok(decoded) = <TransferFromCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::TransferFrom(decoded));
}
Err(::ethers::core::abi::Error::InvalidData.into())
Expand Down
237 changes: 119 additions & 118 deletions bindings/rust/src/flood_plain_l2.rs

Large diffs are not rendered by default.

1,096 changes: 0 additions & 1,096 deletions bindings/rust/src/i_signature_transfer.rs

This file was deleted.

185 changes: 185 additions & 0 deletions bindings/rust/src/i_zone_with_fees.rs
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,
);
}
3 changes: 2 additions & 1 deletion bindings/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
//! This is autogenerated code.
//! Do not manually edit these files.
//! These files may be overwritten by the codegen system at any time.
pub mod auth_zone_filter;
pub mod eip712;
pub mod erc20;
pub mod flood_plain_l2;
pub mod i_auth_zone;
pub mod i_signature_transfer;
pub mod i_zone_with_fees;
pub mod main_zone;
pub mod shared_types;
Loading

0 comments on commit 7d7a12a

Please sign in to comment.