diff --git a/CHANGELOG.md b/CHANGELOG.md index 4004d25..0b52b8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## [0.101.5](https://github.com/propeller-heads/tycho-execution/compare/0.101.4...0.101.5) (2025-06-27) + + +### Bug Fixes + +* Use native token curve address and not regular zero address ([0f679d6](https://github.com/propeller-heads/tycho-execution/commit/0f679d6e0663aba881babb09319815723cdf68e5)) + +## [0.101.4](https://github.com/propeller-heads/tycho-execution/compare/0.101.3...0.101.4) (2025-06-27) + + +### Bug Fixes + +* Fix wrong log in CurveEncoder ([312269d](https://github.com/propeller-heads/tycho-execution/commit/312269dabba5b0d8f303f9aba47d9456e5cd5db7)) + ## [0.101.3](https://github.com/propeller-heads/tycho-execution/compare/0.101.2...0.101.3) (2025-06-23) diff --git a/Cargo.lock b/Cargo.lock index 4d53c90..76029dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4658,7 +4658,7 @@ dependencies = [ [[package]] name = "tycho-execution" -version = "0.101.3" +version = "0.101.5" dependencies = [ "alloy", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 13b398d..97361f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tycho-execution" -version = "0.101.3" +version = "0.101.5" edition = "2021" description = "Provides tools for encoding and executing swaps against Tycho router and protocol executors." repository = "https://github.com/propeller-heads/tycho-execution" diff --git a/src/encoding/evm/swap_encoder/swap_encoders.rs b/src/encoding/evm/swap_encoder/swap_encoders.rs index cbf33e9..c7e30e6 100644 --- a/src/encoding/evm/swap_encoder/swap_encoders.rs +++ b/src/encoding/evm/swap_encoder/swap_encoders.rs @@ -407,7 +407,10 @@ impl CurveSwapEncoder { // Some curve pools support both ETH and WETH as tokens. // They do the wrapping/unwrapping inside the pool fn normalize_token(&self, token: Address, coins: &[Address]) -> Result
{ - let native_token_address = bytes_to_address(&self.native_token_address)?; + let native_token_address = + Address::from_str(&self.native_token_curve_address).map_err(|_| { + EncodingError::FatalError("Invalid native token curve address".to_string()) + })?; let wrapped_native_token_address = bytes_to_address(&self.wrapped_native_token_address)?; if token == native_token_address && !coins.contains(&token) { Ok(wrapped_native_token_address) @@ -440,7 +443,7 @@ impl CurveSwapEncoder { .iter() .position(|&addr| addr == token_out) .ok_or(EncodingError::FatalError(format!( - "Token in address {token_in} not found in curve pool coins" + "Token in address {token_out} not found in curve pool coins" )))?; Ok((U8::from(i), U8::from(j))) }