Skip to content

Commit

Permalink
chore(sync): Merge upstream updates (#47)
Browse files Browse the repository at this point in the history
* new version

* changes

* new version

* solve issue 45

* solve issue 45

* remove lock
  • Loading branch information
malik672 authored Feb 25, 2024
1 parent 3bdd16a commit d1c63a9
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "uniswap-sdk-core"
version = "0.15.1"
version = "0.16.0"
edition = "2021"
authors = ["malik <[email protected]>", "Shuhui Luo <twitter.com/aureliano_law>"]
description = "The Uniswap SDK Core in Rust provides essential functionality for interacting with the Uniswap decentralized exchange"
Expand Down
21 changes: 20 additions & 1 deletion src/addresses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,22 @@ pub fn optimism_goerli_addresses() -> ChainAddresses {
}
}

/// Optimism Sepolia addresses
pub fn optimism_sepolia_addresses() -> ChainAddresses {
ChainAddresses {
v3_core_factory_address: address!("8CE191193D15ea94e11d327b4c7ad8bbE520f6aF"),
multicall_address: address!("80e4e06841bb76AA9735E0448cB8d003C0EF009a"),
quoter_address: address!("0FBEa6cf957d95ee9313490050F6A0DA68039404"),
v3_migrator_address: Some(address!("E7EcbAAaA54D007A00dbb6c1d2f150066D69dA07")),
nonfungible_position_manager_address: Some(address!(
"dA75cEf1C93078e8b736FCA5D5a30adb97C8957d"
)),
tick_lens_address: Some(address!("Cb7f54747F58F8944973cea5b8f4ac2209BadDC5")),
swap_router02_address: None,
v1_mixed_route_quoter_address: None,
}
}

/// Arbitrum Goerli v3 addresses
pub fn arbitrum_goerli_addresses() -> ChainAddresses {
ChainAddresses {
Expand Down Expand Up @@ -272,7 +288,10 @@ lazy_static! {
new_map.insert(ChainId::POLYGONMUMBAI as u64, polygon_addresses());
new_map.insert(ChainId::OPTIMISM as u64, optimism_addresses());
new_map.insert(ChainId::OPTIMISMGOERLI as u64, optimism_goerli_addresses());

new_map.insert(
ChainId::OPTIMISMSEPOLIA as u64,
optimism_sepolia_addresses(),
);
new_map.insert(ChainId::BASEGOERLI as u64, base_goerli_addresses());
new_map.insert(ChainId::BASE as u64, base_addresses());
new_map
Expand Down
4 changes: 3 additions & 1 deletion src/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub enum ChainId {
SEPOLIA = 11155111,
OPTIMISM = 10,
OPTIMISMGOERLI = 420,
OPTIMISMSEPOLIA = 11155420,
ARBITRUMONE = 42161,
ARBITRUMGOERLI = 421613,
POLYGON = 137,
Expand All @@ -19,10 +20,11 @@ pub enum ChainId {
BASE = 8453,
}

pub const SUPPORTED_CHAINS: [ChainId; 15] = [
pub const SUPPORTED_CHAINS: [ChainId; 16] = [
ChainId::MAINNET,
ChainId::OPTIMISM,
ChainId::OPTIMISMGOERLI,
ChainId::OPTIMISMSEPOLIA,
ChainId::ARBITRUMONE,
ChainId::ARBITRUMGOERLI,
ChainId::POLYGON,
Expand Down
10 changes: 10 additions & 0 deletions src/entities/base_currency.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::ops::Deref;

use alloy_primitives::ChainId;

#[derive(Clone, PartialEq, Debug)]
Expand Down Expand Up @@ -42,3 +44,11 @@ impl<M: Clone> BaseCurrency for CurrencyLike<M> {
self.name.clone()
}
}

impl<M> Deref for CurrencyLike<M> {
type Target = M;

fn deref(&self) -> &Self::Target {
&self.meta
}
}

0 comments on commit d1c63a9

Please sign in to comment.