Merge branch 'main' into ekubo-mev-resist

This commit is contained in:
greendianasaur
2025-07-01 15:44:30 +01:00
committed by GitHub
4 changed files with 21 additions and 4 deletions

View File

@@ -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)

2
Cargo.lock generated
View File

@@ -4658,7 +4658,7 @@ dependencies = [
[[package]]
name = "tycho-execution"
version = "0.101.3"
version = "0.101.5"
dependencies = [
"alloy",
"chrono",

View File

@@ -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"

View File

@@ -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<Address, EncodingError> {
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)))
}