-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'update-bindings' into priority-orders
- Loading branch information
Showing
11 changed files
with
852 additions
and
3,051 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 |
---|---|---|
@@ -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
376
crates/bindings-uniswapx/src/deploy_priority_order_reactor.rs
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
Oops, something went wrong.