Skip to content

Commit 6e3b444

Browse files
juntaoclaude
andcommitted
fix: re-fetch Across quote after HL Bridge2 to prevent stale calldata
The Across bridge quote (including tx calldata) was fetched before the HL withdrawal, but HL Bridge2 takes ~4 minutes. By the time the Across bridge tx was executed, the quote had expired, causing the Arbitrum→Base leg to fail silently. Also show stderr in withdraw.sh test script. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 25a1c0f commit 6e3b444

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/commands/withdraw.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,16 @@ async fn withdraw_usdc_hl_bridged(
312312
dest_chain.name()
313313
);
314314

315+
// Re-fetch Across quote now that USDC is on Arbitrum.
316+
// The original quote (fetched before HL withdrawal) has stale calldata
317+
// because the HL Bridge2 step takes ~4 minutes.
318+
eprintln!(" Refreshing Across bridge quote...");
319+
let quote = bridge::get_across_quote_reverse(dest_chain, amount, &cfg.address).await?;
320+
let output_amount = quote
321+
.expected_output_amount
322+
.as_deref()
323+
.unwrap_or(&quote.input_amount);
324+
315325
// Get gas price with 50% buffer to avoid "max fee less than base fee" errors
316326
let arb_gas_price = arb_client
317327
.get_gas_price()

tests/hyperliquid/withdraw.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
1919
source "$SCRIPT_DIR/../helpers.sh"
2020
ensure_built
2121

22-
ft() { $HYPERLIQUID --json "$1" 2>/dev/null; }
22+
ft() { $HYPERLIQUID --json "$1"; }
2323

2424
USDC_AMOUNT="${1:-1}"
2525
ETH_AMOUNT="${2:-0}"

0 commit comments

Comments
 (0)