Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update bindings for V2 and priority order reactor #10

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/bindings-uniswapx/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "bindings-uniswapx"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

# 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 = "1"
36 changes: 21 additions & 15 deletions crates/bindings-uniswapx/src/array_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub use array_builder::*;
clippy::upper_case_acronyms,
clippy::type_complexity,
dead_code,
non_camel_case_types
non_camel_case_types,
)]
pub mod array_builder {
#[allow(deprecated)]
Expand All @@ -22,18 +22,21 @@ pub mod array_builder {
}
}
///The parsed JSON ABI of the contract.
pub static ARRAYBUILDER_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> =
::ethers::contract::Lazy::new(__abi);
pub static ARRAYBUILDER_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = ::ethers::contract::Lazy::new(
__abi,
);
#[rustfmt::skip]
const __BYTECODE: &[u8] = b"`V`7`\x0B\x82\x82\x829\x80Q`\0\x1A`s\x14`*WcNH{q`\xE0\x1B`\0R`\0`\x04R`$`\0\xFD[0`\0R`s\x81S\x82\x81\xF3\xFEs\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 \xB4+\xE9M\x0B,\x9Al\x9F\\\x801t\xF4\x059\x7Ft\x87\x86k\x1D\x06Y\x88\xC7\xD7\x8A\xC55j\xD2dsolcC\0\x08\x13\x003";
const __BYTECODE: &[u8] = b"`V`7`\x0B\x82\x82\x829\x80Q`\0\x1A`s\x14`*WcNH{q`\xE0\x1B`\0R`\0`\x04R`$`\0\xFD[0`\0R`s\x81S\x82\x81\xF3\xFEs\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 \xAA\"\xC1'Y\x88\xCCC\x85{\xA0\x86\xB8\xB3\xD0/\x9Cf%G[?\xAA2OH@\xAD\x01\xE5\xB8|dsolcC\0\x08\x18\x003";
/// The bytecode of the contract.
pub static ARRAYBUILDER_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__BYTECODE);
pub static ARRAYBUILDER_BYTECODE: ::ethers::core::types::Bytes = ::ethers::core::types::Bytes::from_static(
__BYTECODE,
);
#[rustfmt::skip]
const __DEPLOYED_BYTECODE: &[u8] = b"s\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 \xB4+\xE9M\x0B,\x9Al\x9F\\\x801t\xF4\x059\x7Ft\x87\x86k\x1D\x06Y\x88\xC7\xD7\x8A\xC55j\xD2dsolcC\0\x08\x13\x003";
const __DEPLOYED_BYTECODE: &[u8] = b"s\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 \xAA\"\xC1'Y\x88\xCCC\x85{\xA0\x86\xB8\xB3\xD0/\x9Cf%G[?\xAA2OH@\xAD\x01\xE5\xB8|dsolcC\0\x08\x18\x003";
/// The deployed bytecode of the contract.
pub static ARRAYBUILDER_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE);
pub static ARRAYBUILDER_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = ::ethers::core::types::Bytes::from_static(
__DEPLOYED_BYTECODE,
);
pub struct ArrayBuilder<M>(::ethers::contract::Contract<M>);
impl<M> ::core::clone::Clone for ArrayBuilder<M> {
fn clone(&self) -> Self {
Expand Down Expand Up @@ -65,11 +68,13 @@ pub mod array_builder {
address: T,
client: ::std::sync::Arc<M>,
) -> Self {
Self(::ethers::contract::Contract::new(
address.into(),
ARRAYBUILDER_ABI.clone(),
client,
))
Self(
::ethers::contract::Contract::new(
address.into(),
ARRAYBUILDER_ABI.clone(),
client,
),
)
}
/// Constructs the general purpose `Deployer` instance based on the provided constructor arguments and sends it.
/// Returns a new instance of a deployer that returns an instance of this contract after sending the transaction
Expand Down Expand Up @@ -111,7 +116,8 @@ pub mod array_builder {
Ok(deployer)
}
}
impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>> for ArrayBuilder<M> {
impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>>
for ArrayBuilder<M> {
fn from(contract: ::ethers::contract::Contract<M>) -> Self {
Self::new(contract.address(), contract.client())
}
Expand Down
1,171 changes: 668 additions & 503 deletions crates/bindings-uniswapx/src/base_reactor.rs

Large diffs are not rendered by default.

40 changes: 22 additions & 18 deletions crates/bindings-uniswapx/src/bytes_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub use bytes_lib::*;
clippy::upper_case_acronyms,
clippy::type_complexity,
dead_code,
non_camel_case_types
non_camel_case_types,
)]
pub mod bytes_lib {
#[allow(deprecated)]
Expand All @@ -22,18 +22,21 @@ pub mod bytes_lib {
}
}
///The parsed JSON ABI of the contract.
pub static BYTESLIB_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> =
::ethers::contract::Lazy::new(__abi);
pub static BYTESLIB_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = ::ethers::contract::Lazy::new(
__abi,
);
#[rustfmt::skip]
const __BYTECODE: &[u8] = b"`V`7`\x0B\x82\x82\x829\x80Q`\0\x1A`s\x14`*WcNH{q`\xE0\x1B`\0R`\0`\x04R`$`\0\xFD[0`\0R`s\x81S\x82\x81\xF3\xFEs\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 |<0\x9F\xA1\xE7\x7F\x91\xF9\xC1q\xAE\xAE\xC2\xC1\xE3\x089\xFB'3Kh\xCB\xE4\xE9\xEC\xA3\x1F.\x83\xE5dsolcC\0\x08\x13\x003";
const __BYTECODE: &[u8] = b"`V`7`\x0B\x82\x82\x829\x80Q`\0\x1A`s\x14`*WcNH{q`\xE0\x1B`\0R`\0`\x04R`$`\0\xFD[0`\0R`s\x81S\x82\x81\xF3\xFEs\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 \0EZ\xDA\x9A\xBF\x93\xF7\xE4\xE5(\x93\xAE\xCC>\xF6j')\xB9[O{i\xCF\xD0\xD6hs\r\x0C\xA0dsolcC\0\x08\x18\x003";
/// The bytecode of the contract.
pub static BYTESLIB_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__BYTECODE);
pub static BYTESLIB_BYTECODE: ::ethers::core::types::Bytes = ::ethers::core::types::Bytes::from_static(
__BYTECODE,
);
#[rustfmt::skip]
const __DEPLOYED_BYTECODE: &[u8] = b"s\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 |<0\x9F\xA1\xE7\x7F\x91\xF9\xC1q\xAE\xAE\xC2\xC1\xE3\x089\xFB'3Kh\xCB\xE4\xE9\xEC\xA3\x1F.\x83\xE5dsolcC\0\x08\x13\x003";
const __DEPLOYED_BYTECODE: &[u8] = b"s\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 \0EZ\xDA\x9A\xBF\x93\xF7\xE4\xE5(\x93\xAE\xCC>\xF6j')\xB9[O{i\xCF\xD0\xD6hs\r\x0C\xA0dsolcC\0\x08\x18\x003";
/// The deployed bytecode of the contract.
pub static BYTESLIB_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE);
pub static BYTESLIB_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = ::ethers::core::types::Bytes::from_static(
__DEPLOYED_BYTECODE,
);
pub struct BytesLib<M>(::ethers::contract::Contract<M>);
impl<M> ::core::clone::Clone for BytesLib<M> {
fn clone(&self) -> Self {
Expand All @@ -53,9 +56,7 @@ pub mod bytes_lib {
}
impl<M> ::core::fmt::Debug for BytesLib<M> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple(::core::stringify!(BytesLib))
.field(&self.address())
.finish()
f.debug_tuple(::core::stringify!(BytesLib)).field(&self.address()).finish()
}
}
impl<M: ::ethers::providers::Middleware> BytesLib<M> {
Expand All @@ -65,11 +66,13 @@ pub mod bytes_lib {
address: T,
client: ::std::sync::Arc<M>,
) -> Self {
Self(::ethers::contract::Contract::new(
address.into(),
BYTESLIB_ABI.clone(),
client,
))
Self(
::ethers::contract::Contract::new(
address.into(),
BYTESLIB_ABI.clone(),
client,
),
)
}
/// Constructs the general purpose `Deployer` instance based on the provided constructor arguments and sends it.
/// Returns a new instance of a deployer that returns an instance of this contract after sending the transaction
Expand Down Expand Up @@ -111,7 +114,8 @@ pub mod bytes_lib {
Ok(deployer)
}
}
impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>> for BytesLib<M> {
impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>>
for BytesLib<M> {
fn from(contract: ::ethers::contract::Contract<M>) -> Self {
Self::new(contract.address(), contract.client())
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub use expected_balance_lib::*;
pub use cosigner_lib::*;
/// This module was auto-generated with ethers-rs Abigen.
/// More information at: <https://github.com/gakonst/ethers-rs>
#[allow(
Expand All @@ -7,90 +7,84 @@ pub use expected_balance_lib::*;
clippy::upper_case_acronyms,
clippy::type_complexity,
dead_code,
non_camel_case_types
non_camel_case_types,
)]
pub mod expected_balance_lib {
pub mod cosigner_lib {
#[allow(deprecated)]
fn __abi() -> ::ethers::core::abi::Abi {
::ethers::core::abi::ethabi::Contract {
constructor: ::core::option::Option::None,
functions: ::std::collections::BTreeMap::new(),
events: ::std::collections::BTreeMap::new(),
errors: ::core::convert::From::from([(
::std::borrow::ToOwned::to_owned("InsufficientOutput"),
::std::vec![::ethers::core::abi::ethabi::AbiError {
name: ::std::borrow::ToOwned::to_owned("InsufficientOutput"),
inputs: ::std::vec![
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("actualBalance"),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("expectedBalance"),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
errors: ::core::convert::From::from([
(
::std::borrow::ToOwned::to_owned("InvalidCosignature"),
::std::vec![
::ethers::core::abi::ethabi::AbiError {
name: ::std::borrow::ToOwned::to_owned("InvalidCosignature"),
inputs: ::std::vec![],
},
],
},],
)]),
),
]),
receive: false,
fallback: false,
}
}
///The parsed JSON ABI of the contract.
pub static EXPECTEDBALANCELIB_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> =
::ethers::contract::Lazy::new(__abi);
pub static COSIGNERLIB_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = ::ethers::contract::Lazy::new(
__abi,
);
#[rustfmt::skip]
const __BYTECODE: &[u8] = b"`V`7`\x0B\x82\x82\x829\x80Q`\0\x1A`s\x14`*WcNH{q`\xE0\x1B`\0R`\0`\x04R`$`\0\xFD[0`\0R`s\x81S\x82\x81\xF3\xFEs\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 4\x12\xAC\x9F\xCFh\xF2\xABq\x01\xDA\0\xC6\x93C\xE4\xDEe\xC9\xE0\x81\x9C\xB6y\xC6\xDE\xF3\xC6\xE9\xDF\x99MdsolcC\0\x08\x13\x003";
const __BYTECODE: &[u8] = b"`V`7`\x0B\x82\x82\x829\x80Q`\0\x1A`s\x14`*WcNH{q`\xE0\x1B`\0R`\0`\x04R`$`\0\xFD[0`\0R`s\x81S\x82\x81\xF3\xFEs\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 ^t\xC0\"7\xE4\xD5q\xE2\x9CC-cy\x13\x04!\x1FZ\x1A\xD2\x1C-By\xF1\x91\x88\xED;=\xBBdsolcC\0\x08\x18\x003";
/// The bytecode of the contract.
pub static EXPECTEDBALANCELIB_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__BYTECODE);
pub static COSIGNERLIB_BYTECODE: ::ethers::core::types::Bytes = ::ethers::core::types::Bytes::from_static(
__BYTECODE,
);
#[rustfmt::skip]
const __DEPLOYED_BYTECODE: &[u8] = b"s\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 4\x12\xAC\x9F\xCFh\xF2\xABq\x01\xDA\0\xC6\x93C\xE4\xDEe\xC9\xE0\x81\x9C\xB6y\xC6\xDE\xF3\xC6\xE9\xDF\x99MdsolcC\0\x08\x13\x003";
const __DEPLOYED_BYTECODE: &[u8] = b"s\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 ^t\xC0\"7\xE4\xD5q\xE2\x9CC-cy\x13\x04!\x1FZ\x1A\xD2\x1C-By\xF1\x91\x88\xED;=\xBBdsolcC\0\x08\x18\x003";
/// The deployed bytecode of the contract.
pub static EXPECTEDBALANCELIB_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE);
pub struct ExpectedBalanceLib<M>(::ethers::contract::Contract<M>);
impl<M> ::core::clone::Clone for ExpectedBalanceLib<M> {
pub static COSIGNERLIB_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = ::ethers::core::types::Bytes::from_static(
__DEPLOYED_BYTECODE,
);
pub struct CosignerLib<M>(::ethers::contract::Contract<M>);
impl<M> ::core::clone::Clone for CosignerLib<M> {
fn clone(&self) -> Self {
Self(::core::clone::Clone::clone(&self.0))
}
}
impl<M> ::core::ops::Deref for ExpectedBalanceLib<M> {
impl<M> ::core::ops::Deref for CosignerLib<M> {
type Target = ::ethers::contract::Contract<M>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<M> ::core::ops::DerefMut for ExpectedBalanceLib<M> {
impl<M> ::core::ops::DerefMut for CosignerLib<M> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl<M> ::core::fmt::Debug for ExpectedBalanceLib<M> {
impl<M> ::core::fmt::Debug for CosignerLib<M> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple(::core::stringify!(ExpectedBalanceLib))
f.debug_tuple(::core::stringify!(CosignerLib))
.field(&self.address())
.finish()
}
}
impl<M: ::ethers::providers::Middleware> ExpectedBalanceLib<M> {
impl<M: ::ethers::providers::Middleware> CosignerLib<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(),
EXPECTEDBALANCELIB_ABI.clone(),
client,
))
Self(
::ethers::contract::Contract::new(
address.into(),
COSIGNERLIB_ABI.clone(),
client,
),
)
}
/// Constructs the general purpose `Deployer` instance based on the provided constructor arguments and sends it.
/// Returns a new instance of a deployer that returns an instance of this contract after sending the transaction
Expand Down Expand Up @@ -123,8 +117,8 @@ pub mod expected_balance_lib {
::ethers::contract::ContractError<M>,
> {
let factory = ::ethers::contract::ContractFactory::new(
EXPECTEDBALANCELIB_ABI.clone(),
EXPECTEDBALANCELIB_BYTECODE.clone().into(),
COSIGNERLIB_ABI.clone(),
COSIGNERLIB_BYTECODE.clone().into(),
client,
);
let deployer = factory.deploy(constructor_args)?;
Expand All @@ -133,29 +127,24 @@ pub mod expected_balance_lib {
}
}
impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>>
for ExpectedBalanceLib<M>
{
for CosignerLib<M> {
fn from(contract: ::ethers::contract::Contract<M>) -> Self {
Self::new(contract.address(), contract.client())
}
}
///Custom Error type `InsufficientOutput` with signature `InsufficientOutput(uint256,uint256)` and selector `0x2c19b8b8`
///Custom Error type `InvalidCosignature` with signature `InvalidCosignature()` and selector `0xd7815be1`
#[derive(
Clone,
::ethers::contract::EthError,
::ethers::contract::EthDisplay,
serde::Serialize,
serde::Deserialize,
Default,
Debug,
PartialEq,
Eq,
Hash,
Hash
)]
#[etherror(
name = "InsufficientOutput",
abi = "InsufficientOutput(uint256,uint256)"
)]
pub struct InsufficientOutput {
pub actual_balance: ::ethers::core::types::U256,
pub expected_balance: ::ethers::core::types::U256,
}
#[etherror(name = "InvalidCosignature", abi = "InvalidCosignature()")]
pub struct InvalidCosignature;
}
Loading
Loading