Repository navigation
Conversation
…dress A hyperliquid_signature bridge plan was validated leg by leg, so a plan with several sendAsset legs (each within the amount cap) would sign and submit all of them. The sendAsset destination, which the signature commits to, was never checked. preflightHlBridgeSteps now requires at most one authorize and exactly one sendAsset among the incomplete legs, mirroring the EVM deposit check. assertHlBridgeActionIntent now requires the destination to be Relay's Hyperliquid deposit address, captured from live quotes for all three withdrawal routes. Both refuse before anything is signed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nansen-pr-reviewer summaryThe diff adds fail-closed validation for Hyperliquid withdrawal destinations and bounds bridge plans to a single sendAsset leg. The previously reported resumed-plan leg-count issue is fixed by counting completed action items in totalActionCount while separately requiring exactly one pending leg. Tests cover local, Privy, repeated-leg, resumed-plan, and destination-tampering paths. Deterministic check: success — No issues found Risk: 3/5 (Elevated) ✅ Auto-approved — Deterministic gates passed: severity thresholds met, recommendation "approve", risk level 3/5 within threshold 3. Token usage: 45,462 input, 1,345 output, 6,557 cache read | Usage Guide Cooldown: for the next 10 minutes (counting from when this review finished), new pushes to this PR will not trigger another review — the next push after the window expires will. Need a fresh review sooner? Comment |
A real Hyperliquid withdrawal has exactly one sendAsset leg in total, so a plan with a completed sendAsset plus another pending one is now refused too. Completed legs are still not re-validated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Auto-approved by Nansen review
Deterministic gates passed: severity thresholds met, recommendation "approve", risk level 3/5 within threshold 3.
- The deterministic severity check passed: No issues found
- Risk level 3/5 (Elevated)
- The model recommended: approve
Approval was decided by deterministic gates, not by the model. The model's recommendation can block auto-approval but never cause it.
What
bridge executeon a Hyperliquid withdrawal (hyperliquid_signaturequote) now refuses, before signing anything:sendAsset(counting legs not yet complete), mirroring the existing EVM deposit check;sendAssetwhosedestinationisn't Relay's Hyperliquid deposit address (0x66cf0aace1b4e562593bec10ec7868fba9932224).Why
The HL plan was validated one leg at a time. A plan with several
sendAssetlegs, each within the amount cap, would have every leg signed and submitted, withdrawing a multiple of the requested amount.destinationis part of the signed payload but was never checked, so a withdrawal could also be sent to any HL address.The pinned address is the same in live read-only quotes for all three withdrawal routes (HL → base / ethereum / arbitrum) and in earlier captures. If Relay changes it, HL withdrawals fail closed with an "update nansen-cli" message, the same trade-off as the EVM router pin.
Testing
bridge.js.sendAssetlegs went from 2 HL exchange POSTs to refused with 0; a foreign destination went from 1 POST to refused with 0.bridge execute --dry-runon real HL → base / ethereum / arbitrum quotes passes, so legitimate quotes are not blocked.destination, and one used an authorize-only plan.npm test,npm run lint.🤖 Generated with Claude Code