diff --git a/Cargo.toml b/Cargo.toml index 11e1366..dfef203 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uniswap-sdk-core" -version = "0.15.1" +version = "0.16.0" edition = "2021" authors = ["malik ", "Shuhui Luo "] description = "The Uniswap SDK Core in Rust provides essential functionality for interacting with the Uniswap decentralized exchange" diff --git a/src/addresses.rs b/src/addresses.rs index 88f463a..559f3ff 100644 --- a/src/addresses.rs +++ b/src/addresses.rs @@ -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 { @@ -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 diff --git a/src/chains.rs b/src/chains.rs index 642e372..1f18b14 100644 --- a/src/chains.rs +++ b/src/chains.rs @@ -5,6 +5,7 @@ pub enum ChainId { SEPOLIA = 11155111, OPTIMISM = 10, OPTIMISMGOERLI = 420, + OPTIMISMSEPOLIA = 11155420, ARBITRUMONE = 42161, ARBITRUMGOERLI = 421613, POLYGON = 137, @@ -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, diff --git a/src/entities/base_currency.rs b/src/entities/base_currency.rs index b948241..0e76867 100644 --- a/src/entities/base_currency.rs +++ b/src/entities/base_currency.rs @@ -1,3 +1,5 @@ +use std::ops::Deref; + use alloy_primitives::ChainId; #[derive(Clone, PartialEq, Debug)] @@ -42,3 +44,11 @@ impl BaseCurrency for CurrencyLike { self.name.clone() } } + +impl Deref for CurrencyLike { + type Target = M; + + fn deref(&self) -> &Self::Target { + &self.meta + } +}