fix: Pass proper native address when encoding router call
- We were using the wrapped address here instead of the proper native address, so the value was being set to the in amount when it should have been zero.
This commit is contained in:
@@ -117,13 +117,10 @@ pub fn encode_swap(
|
|||||||
.wrap_err("Failed to encode solution")?[0]
|
.wrap_err("Failed to encode solution")?[0]
|
||||||
.clone();
|
.clone();
|
||||||
|
|
||||||
let transaction = encode_tycho_router_call(
|
let transaction =
|
||||||
encoded_solution,
|
encode_tycho_router_call(encoded_solution, &solution, &chain.native_token().address)
|
||||||
&solution,
|
.into_diagnostic()
|
||||||
&chain.wrapped_native_token().address,
|
.wrap_err("Failed to encode router calldata")?;
|
||||||
)
|
|
||||||
.into_diagnostic()
|
|
||||||
.wrap_err("Failed to encode router calldata")?;
|
|
||||||
Ok((transaction, solution))
|
Ok((transaction, solution))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ impl Args {
|
|||||||
fn main() -> miette::Result<()> {
|
fn main() -> miette::Result<()> {
|
||||||
// Load .env file before setting up logging
|
// Load .env file before setting up logging
|
||||||
dotenv().ok();
|
dotenv().ok();
|
||||||
|
|
||||||
tracing_subscriber::fmt()
|
tracing_subscriber::fmt()
|
||||||
.with_env_filter(EnvFilter::from_default_env())
|
.with_env_filter(EnvFilter::from_default_env())
|
||||||
.with_target(false)
|
.with_target(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user