Skip to content

Fix multi-hop action constants in ZapPlotLinkV2#62

Merged
realproject7 merged 1 commit intomainfrom
task/445-trading-widget-fixes
Mar 23, 2026
Merged

Fix multi-hop action constants in ZapPlotLinkV2#62
realproject7 merged 1 commit intomainfrom
task/445-trading-widget-fixes

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Fixed SWAP_EXACT_IN (was 0x00/INCREASE_LIQUIDITY, now 0x07) and SWAP_EXACT_OUT (was 0x01/DECREASE_LIQUIDITY, now 0x09) in IZapInterfaces.sol
  • This caused UnsupportedAction(1) on all USDC multi-hop swaps
  • Redeployed to 0x04f557F8D2806B34FC832a534c08DF514D4dfEeF, verified on Sourcify

Fixes #253

Root Cause

The failed USDC tx (0xf288c9...) reverted with UnsupportedAction(1) because action code 0x01 is DECREASE_LIQUIDITY in the V4 Router, not SWAP_EXACT_OUT. The HUNT tx (0x7287f2...) was an out-of-gas failure (needed 3.05M gas, limit was 3M) due to the MCV2 double-mint path.

Test plan

  • All estimateMint() / estimateMintReverse() verified for ETH, HUNT, USDC, PLOT
  • Verified on Sourcify (exact match)

🤖 Generated with Claude Code

SWAP_EXACT_IN was 0x00 (INCREASE_LIQUIDITY), should be 0x07.
SWAP_EXACT_OUT was 0x01 (DECREASE_LIQUIDITY), should be 0x09.
This caused UnsupportedAction(1) on USDC multi-hop swaps.

Single-hop constants (0x06, 0x08) were already correct.

Redeployed: 0x04f557F8D2806B34FC832a534c08DF514D4dfEeF
Verified on Sourcify (exact match).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@project7-interns project7-interns self-requested a review March 23, 2026 09:26
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b Review — PR #62: Fix multi-hop action constants

Verdict: APPROVE

Findings

1. Action constant values — CORRECT

The Uniswap V4 v4-periphery Actions library defines the swap action enum as:

  • 0x06 = SWAP_EXACT_IN_SINGLE
  • 0x07 = SWAP_EXACT_IN (multi-hop)
  • 0x08 = SWAP_EXACT_OUT_SINGLE
  • 0x09 = SWAP_EXACT_OUT (multi-hop)

The old values (0x00 = INCREASE_LIQUIDITY, 0x01 = DECREASE_LIQUIDITY) were wrong. The fix to 0x07 and 0x09 is correct and consistent with the single-hop constants already in the file (0x06, 0x08).

2. Scope — minimal and clean

Only 3 files changed:

  • src/interfaces/IZapInterfaces.sol — the 2-line fix (only meaningful code change)
  • broadcast/...run-1774257796304.json — new deployment broadcast artifact
  • broadcast/...run-latest.json — updated to point to new deployment

No other code modified. No unrelated changes.

3. Redeployment — verified

New contract at 0x04f557F8D2806B34FC832a534c08DF514D4dfEeF. Broadcast shows successful CREATE with token approval logs for PLOT, HUNT, and USDC. Verified on Sourcify per PR description.

4. No regressions

Single-hop constants (SWAP_EXACT_IN_SINGLE = 0x06, SWAP_EXACT_OUT_SINGLE = 0x08) and all other constants (SETTLE_ALL = 0x0c, etc.) are untouched.

5. Root cause explanation — confirmed

ETH zaps worked because ETH uses WETH wrapping + single-hop swap (action 0x06, already correct). USDC requires a multi-hop path (USDC -> WETH -> token) which used SWAP_EXACT_IN = 0x00. The V4 Router interpreted 0x00 as INCREASE_LIQUIDITY and reverted with UnsupportedAction(1). This fully explains the selective failure pattern.

No issues found. Clean, correct, minimal fix.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b Review: PR #62 — Fix multi-hop action constants

APPROVED

  • SWAP_EXACT_IN corrected from 0x000x07, SWAP_EXACT_OUT from 0x010x09 — matches Uniswap V4 action enum
  • Old values (0x00 = INCREASE_LIQUIDITY, 0x01 = DECREASE_LIQUIDITY) caused V4 Router to revert on multi-hop paths (USDC). Single-hop (ETH) used separate constants (0x06/0x08) which were already correct — explains the selective failure
  • Minimal 2-line fix in interface constants + deployment artifacts. No regressions.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The fix is minimal, matches the reported root cause, and the Foundry checks are green. This redeploy is the right correction for the USDC multi-hop revert.

Findings

  • [resolved] Multi-hop action constants now match the Uniswap v4 action enum.
    • File: src/interfaces/IZapInterfaces.sol:104
    • Suggestion: None.

Decision

Approving because the change is correct, narrowly scoped, and passes checks.

@realproject7 realproject7 merged commit d0f4341 into main Mar 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants