Skip to content

Commit

Permalink
Merge branch 'update-bindings' into priority-orders
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongeric committed Aug 5, 2024
2 parents 30d582b + 85a939a commit ca51ea3
Show file tree
Hide file tree
Showing 11 changed files with 852 additions and 3,051 deletions.
150 changes: 150 additions & 0 deletions crates/bindings-uniswapx/src/cosigner_lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
pub use cosigner_lib::*;
/// 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 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("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 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 ^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 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 ^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 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 CosignerLib<M> {
type Target = ::ethers::contract::Contract<M>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
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 CosignerLib<M> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple(::core::stringify!(CosignerLib))
.field(&self.address())
.finish()
}
}
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(),
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
///
/// Notes:
/// - If there are no constructor arguments, you should pass `()` as the argument.
/// - The default poll duration is 7 seconds.
/// - The default number of confirmations is 1 block.
///
///
/// # Example
///
/// Generate contract bindings with `abigen!` and deploy a new contract instance.
///
/// *Note*: this requires a `bytecode` and `abi` object in the `greeter.json` artifact.
///
/// ```ignore
/// # async fn deploy<M: ethers::providers::Middleware>(client: ::std::sync::Arc<M>) {
/// abigen!(Greeter, "../greeter.json");
///
/// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap();
/// let msg = greeter_contract.greet().call().await.unwrap();
/// # }
/// ```
pub fn deploy<T: ::ethers::core::abi::Tokenize>(
client: ::std::sync::Arc<M>,
constructor_args: T,
) -> ::core::result::Result<
::ethers::contract::builders::ContractDeployer<M, Self>,
::ethers::contract::ContractError<M>,
> {
let factory = ::ethers::contract::ContractFactory::new(
COSIGNERLIB_ABI.clone(),
COSIGNERLIB_BYTECODE.clone().into(),
client,
);
let deployer = factory.deploy(constructor_args)?;
let deployer = ::ethers::contract::ContractDeployer::new(deployer);
Ok(deployer)
}
}
impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>>
for CosignerLib<M> {
fn from(contract: ::ethers::contract::Contract<M>) -> Self {
Self::new(contract.address(), contract.client())
}
}
///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
)]
#[etherror(name = "InvalidCosignature", abi = "InvalidCosignature()")]
pub struct InvalidCosignature;
}
376 changes: 376 additions & 0 deletions crates/bindings-uniswapx/src/deploy_priority_order_reactor.rs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion crates/bindings-uniswapx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
pub mod array_builder;
pub mod base_reactor;
pub mod bytes_lib;
pub mod cosigner_lib;
pub mod currency_library;
pub mod deploy_dutch;
pub mod deploy_dutch_v2;
pub mod deploy_exclusive_dutch;
pub mod deploy_permit_2;
pub mod deploy_priority_order_reactor;
pub mod deploy_swap_router_02_executor;
pub mod dutch_decay_lib;
pub mod dutch_order_lib;
Expand Down Expand Up @@ -43,6 +45,7 @@ pub mod ierc721_token_receiver;
pub mod limit_order_lib;
pub mod limit_order_reactor;
pub mod math;
pub mod mock_cosigner_lib_contract;
pub mod mock_dutch_order_reactor;
pub mod mock_erc20;
pub mod mock_erc721;
Expand Down Expand Up @@ -72,7 +75,6 @@ pub mod permit_signature;
pub mod priority_fee_lib;
pub mod priority_order_lib;
pub mod priority_order_reactor;
pub mod priority_order_reactor_integration;
pub mod protocol_fees;
pub mod reactor_events;
pub mod reentrancy_guard;
Expand Down
Loading

0 comments on commit ca51ea3

Please sign in to comment.