Merge branch 'main' into ekubo-mev-resist
This commit is contained in:
14
CHANGELOG.md
14
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)
|
## [0.101.3](https://github.com/propeller-heads/tycho-execution/compare/0.101.2...0.101.3) (2025-06-23)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -4658,7 +4658,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tycho-execution"
|
name = "tycho-execution"
|
||||||
version = "0.101.3"
|
version = "0.101.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"alloy",
|
"alloy",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tycho-execution"
|
name = "tycho-execution"
|
||||||
version = "0.101.3"
|
version = "0.101.5"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Provides tools for encoding and executing swaps against Tycho router and protocol executors."
|
description = "Provides tools for encoding and executing swaps against Tycho router and protocol executors."
|
||||||
repository = "https://github.com/propeller-heads/tycho-execution"
|
repository = "https://github.com/propeller-heads/tycho-execution"
|
||||||
|
|||||||
@@ -407,7 +407,10 @@ impl CurveSwapEncoder {
|
|||||||
// Some curve pools support both ETH and WETH as tokens.
|
// Some curve pools support both ETH and WETH as tokens.
|
||||||
// They do the wrapping/unwrapping inside the pool
|
// They do the wrapping/unwrapping inside the pool
|
||||||
fn normalize_token(&self, token: Address, coins: &[Address]) -> Result<Address, EncodingError> {
|
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)?;
|
let wrapped_native_token_address = bytes_to_address(&self.wrapped_native_token_address)?;
|
||||||
if token == native_token_address && !coins.contains(&token) {
|
if token == native_token_address && !coins.contains(&token) {
|
||||||
Ok(wrapped_native_token_address)
|
Ok(wrapped_native_token_address)
|
||||||
@@ -440,7 +443,7 @@ impl CurveSwapEncoder {
|
|||||||
.iter()
|
.iter()
|
||||||
.position(|&addr| addr == token_out)
|
.position(|&addr| addr == token_out)
|
||||||
.ok_or(EncodingError::FatalError(format!(
|
.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)))
|
Ok((U8::from(i), U8::from(j)))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user