You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
USDC zap via ZapPlotLinkV2 reverts on Base mainnet. ETH and HUNT routes work fine. USDC was never live-tested (E2E script skipped it due to no balance). The action constants were fixed in PR #62 but USDC still fails.
estimateMint(USDC, ...) returns valid quotes (4 units for 1 storyline token)
But actual USDC mint tx reverts when submitted from frontend
Key difference from MintPad
MintPad's ZapUniV4MCV2 contract handles USDC routing internally — the frontend just passes fromToken=USDC and the contract figures out the path. MintPad's frontend treats USDC the same as any other token, only adjusting for 6 decimals on the frontend side (parseUnits(amount, 6)).
Our ZapPlotLinkV2 has explicit multi-hop code (USDC→ETH→PLOT) which may have encoding issues.
Investigation steps
Compare with MintPad: Check MintPad's deployed ZapUniV4MCV2 (0xa2e7BcA51A84Ed635909a8E845d5f66602742A75) on Basescan — look at successful USDC swap txs and compare the calldata/routing with ours
maxFromTokenAmount slippage calculation doesn't overflow with 6-decimal amounts
Simulate the failing tx: Use cast call --trace on a USDC mint to get the exact revert reason
Check if a USDC/ETH V4 pool actually exists: The contract assumes fee=500, tickSpacing=10 for the USDC/ETH leg. Verify this pool is initialized on Base mainnet's PoolManager.
Possible fixes
If USDC/ETH V4 pool doesn't exist: change the multi-hop route or use a pool that does exist
If encoding is wrong: fix PathKey order/params to match V4 Universal Router spec
If decimal issue: add USDC-specific decimal handling in the contract
Summary
USDC zap via ZapPlotLinkV2 reverts on Base mainnet. ETH and HUNT routes work fine. USDC was never live-tested (E2E script skipped it due to no balance). The action constants were fixed in PR #62 but USDC still fails.
Evidence
SWAP_EXACT_IN→0x07,SWAP_EXACT_OUT→0x09)estimateMint(USDC, ...)returns valid quotes (4 units for 1 storyline token)Key difference from MintPad
MintPad's ZapUniV4MCV2 contract handles USDC routing internally — the frontend just passes
fromToken=USDCand the contract figures out the path. MintPad's frontend treats USDC the same as any other token, only adjusting for 6 decimals on the frontend side (parseUnits(amount, 6)).Our ZapPlotLinkV2 has explicit multi-hop code (USDC→ETH→PLOT) which may have encoding issues.
Investigation steps
Compare with MintPad: Check MintPad's deployed ZapUniV4MCV2 (
0xa2e7BcA51A84Ed635909a8E845d5f66602742A75) on Basescan — look at successful USDC swap txs and compare the calldata/routing with oursCheck multi-hop encoding: Our
_executeV4MultiHopSwapExactInbuilds a 2-step PathKey array. Verify:usdcPoolFeeandusdcPoolTickSpacing)SETTLE_ALLandTAKEaction params match what Universal Router expects for multi-hopCheck decimal handling: USDC is 6 decimals. Verify:
parseUnits(amount, 6)_validateAndTransferInputhandles 6-decimalsafeTransferFromcorrectlymaxFromTokenAmountslippage calculation doesn't overflow with 6-decimal amountsSimulate the failing tx: Use
cast call --traceon a USDC mint to get the exact revert reasonCheck if a USDC/ETH V4 pool actually exists: The contract assumes fee=500, tickSpacing=10 for the USDC/ETH leg. Verify this pool is initialized on Base mainnet's PoolManager.
Possible fixes
Reference
0xa2e7BcA51A84Ed635909a8E845d5f66602742A75(Base mainnet)~/Projects/mintpad/src/helpers/zap.ts— treats all tokens same, only varies decimalsplotlink-contracts/src/ZapPlotLinkV2.sollines 463-535 (multi-hop functions)0x04f557F8D2806B34FC832a534c08DF514D4dfEeFAcceptance Criteria
Branch
task/463-usdc-zap-fixin plotlink-contracts repo (+ plotlink if constants change)