Merge pull request #231 from propeller-heads/curve/dc/fix-log

fix: Use native token curve address and not regular zero address
This commit is contained in:
greendianasaur
2025-06-27 18:04:05 +01:00
committed by GitHub

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)