Skip to content

add native-is-erc20 chain smoke test variants#145

Merged
david-uniswap merged 1 commit into
david-nick/robinhood-smoke-testsfrom
david-nick/native-is-erc20-smoke-tests
May 28, 2026
Merged

add native-is-erc20 chain smoke test variants#145
david-uniswap merged 1 commit into
david-nick/robinhood-smoke-testsfrom
david-nick/native-is-erc20-smoke-tests

Conversation

@david-uniswap

Copy link
Copy Markdown
Collaborator

Summary

Stacked on top of #139. Adds V2/V3/V4 smoke test variants in script/smoke/native-is-erc20/ for chains where the native gas token is itself an ERC-20 (Arc, CELO, and similar Circle-style partner chains).

Motivation

On these chains the WETH9 dependency in the deploy gets wired to UnsupportedProtocol (or any other placeholder that reverts on deposit/withdraw), because there is no real IWETH9-compliant wrapper. The standard smoke tests from #139 all halt at IWETH9(weth).deposit{value:...}() on these chains, even though the contract deployment itself is functional.

These variants drop the WETH leg entirely and use two freshly-deployed TestTokens to exercise the same v2/v3/v4 + UR code paths.

What's in this PR

File Tests
script/smoke/native-is-erc20/V2SmokeNativeIsERC20.s.sol Pair creation, addLiquidity, swapExactTokensForTokens via Router02
script/smoke/native-is-erc20/V3SmokeNativeIsERC20.s.sol createPool + initialize, NPM mint, SwapRouter02 exactInputSingle
script/smoke/native-is-erc20/V4SmokeNativeIsERC20.s.sol initializePool, Permit2 dual-approval, modifyLiquidities mint, StateView reads, UR V4_SWAP command

Chain-agnostic via vm.parseJsonAddress reads from deployments/json/<chainId>.json, matching #139's pattern.

Tested on Arc Mainnet (chain 5042)

All three variants ran end-to-end on Arc with the WETH9-as-UnsupportedProtocol deploy from #144:

  • V2: pair created, 1000:1000 liquidity, swap 1 A -> 0.996 B (the standard 0.3% fee math)
  • V3: pool initialized at sqrtPrice 1:1, position Add v2 to packages #1 minted with 1000e18 liquidity, exactInputSingle 1 A -> 0.996 B
  • V4: pool initialized, Permit2 allowances granted to PositionManager + UR, position minted via modifyLiquidities(MINT_POSITION + SETTLE_PAIR), UR V4_SWAP command swaps A -> B successfully

When to use

Note on gas estimation

On Arc specifically, forge's eth_estimateGas returns tight per-tx estimates that can cause the v2/v3 swap txs to OOG during the K-invariant check. Workaround: pass --gas-estimate-multiplier 200 when broadcasting. Likely worth surfacing in #139's README too once both PRs land.

Test plan

  • Compile cleanly
  • V2 variant: end-to-end on Arc (tx hash 0xdadd632ab0db9ddb43148b93c7b9b01f725fe22800403d0622403e15ac283d3c is the final swap)
  • V3 variant: end-to-end on Arc
  • V4 variant: end-to-end on Arc

🤖 Generated with Claude Code

Adds V2/V3/V4 smoke test variants in script/smoke/native-is-erc20/
for chains where the native gas token is itself an ERC-20 (CELO, Arc,
similar Circle partner chains). On these chains the WETH9 dependency
is wired to UnsupportedProtocol (or similar) which reverts on
deposit/withdraw, so the standard smoke tests halt at the WETH wrap
step.

These variants skip the WETH leg entirely and use two freshly-deployed
TestTokens to exercise the same v2/v3/v4 + UR code paths. Chain-
agnostic via vm.parseJsonAddress reads from deployments/json/<id>.json,
matching the parent PR's pattern.

Tested end-to-end on Arc Mainnet (chain 5042). All three pass:
- V2: pair created, 1000:1000 liquidity, swap 1 A -> 0.996 B (0.3% fee)
- V3: pool init at 1:1, position minted, exactInputSingle 1 A -> 0.996 B
- V4: pool init, modifyLiquidities mint with Permit2 dual-approval,
       swap via UR V4_SWAP command

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@david-uniswap david-uniswap marked this pull request as ready for review May 28, 2026 17:23
@david-uniswap david-uniswap merged commit ca202da into david-nick/robinhood-smoke-tests May 28, 2026
3 checks passed
@david-uniswap david-uniswap deleted the david-nick/native-is-erc20-smoke-tests branch May 28, 2026 17:23
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