Fix multi-hop action constants in ZapPlotLinkV2#62
Conversation
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
left a comment
There was a problem hiding this comment.
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_SINGLE0x07=SWAP_EXACT_IN(multi-hop)0x08=SWAP_EXACT_OUT_SINGLE0x09=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 artifactbroadcast/...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.
project7-interns
left a comment
There was a problem hiding this comment.
T2b Review: PR #62 — Fix multi-hop action constants
APPROVED ✅
SWAP_EXACT_INcorrected from0x00→0x07,SWAP_EXACT_OUTfrom0x01→0x09— 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.
project7-interns
left a comment
There was a problem hiding this comment.
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.
- File:
Decision
Approving because the change is correct, narrowly scoped, and passes checks.
Summary
SWAP_EXACT_IN(was0x00/INCREASE_LIQUIDITY, now0x07) andSWAP_EXACT_OUT(was0x01/DECREASE_LIQUIDITY, now0x09) inIZapInterfaces.solUnsupportedAction(1)on all USDC multi-hop swaps0x04f557F8D2806B34FC832a534c08DF514D4dfEeF, verified on SourcifyFixes #253
Root Cause
The failed USDC tx (
0xf288c9...) reverted withUnsupportedAction(1)because action code0x01isDECREASE_LIQUIDITYin the V4 Router, notSWAP_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
estimateMint()/estimateMintReverse()verified for ETH, HUNT, USDC, PLOT🤖 Generated with Claude Code