feat: wallet-sdk + Uniswap V4 fuel swap + witness-bound Permit2 (rebased onto main)#10
Open
alejoamiras wants to merge 7 commits into
Open
feat: wallet-sdk + Uniswap V4 fuel swap + witness-bound Permit2 (rebased onto main)#10alejoamiras wants to merge 7 commits into
alejoamiras wants to merge 7 commits into
Conversation
- Add trusted forwarder pattern to TokenPortal for delegated deposits - SwapBridgeRouter: witness-bound Permit2 bridge with optional fuel swap - UniswapFuelSwap: Uniswap V4 integration for automatic L2 gas funding - Deploy scripts and comprehensive test suites for all contracts - Remove deprecated BridgeAndFuel and MockFuelSwap contracts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mit2 Frontend integration for the full bridge upgrade: - Migrate from @azguardwallet/client to @aztec/wallet-sdk - BridgedFPC private fuel payment with automatic fee juice claims - FuelToggle component with real-time Uniswap V4 price quotes - Witness-bound Permit2 flow for secure bridge parameter binding - Withdrawal auth witness for private L2-to-L1 exits - CoinGecko + V4 Quoter dual pricing for fuel estimates Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update bridge-script for SwapBridgeRouter and UniswapFuelSwap - Add redeploy-permit2 utility script - Update deployment registry and README with new contract details Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Deploy all 7 tokens with custom TokenPortal (compliant script) - Deploy SwapBridgeRouter at 0x9E21891e2a3a7A366C1bbAB18a2B88Fd72C5D6D7 - Set trusted forwarder on all portals - Add BridgedFPC deterministic address (salt=0) - Add saveFuelInfraToDeployment to save_contracts utility - Fix duplicate fee juice display in BridgeSection - Generate L2 codegen artifacts for compliant bridge Public L1→L2 bridge tested and working. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Standalone Forge script to seed ETH/FeeJuice and ERC20/WETH pools without redeploying UniswapFuelSwap. Supports configurable amounts, skip flags, and transfers deployer's existing FJ balance to the seeder. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…uel claim - Replace hardcoded "USDC" with selected token symbol on progress page - Show fuel amount in USD (from CoinGecko prices) instead of token units - Smart decimal formatting: shows meaningful digits for small amounts (0.003 WETH not 0.00) - Private fuel (BridgedFPC) now correctly triggers claim_private on L2 and isPrivate on L1 deposit — the whole chain is private when private fuel is selected Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ate deposit) Private fuel (BridgedFPC) flow: - L1: depositToAztecPublic for both token and FeeJuice (no attestation needed) - L2: claim_public for token + BridgedMintAndPayFeePaymentMethod handles FeeJuice.claim (private) + mint_and_pay_fee (private) as fee setup calls Reverts the isPrivate || !!privateFuel change — private deposit requires attestation signatures which aren't available for the fuel-only flow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full bridge upgrade rebased onto current
main(postfeat/passport-integrationmerge): wallet-sdk migration, Uniswap V4 fuel swap for automatic L2 gas, and witness-bound Permit2 for secure bridge parameter binding.What's included
Wallet-SDK Migration
@azguardwallet/clientwith@aztec/wallet-sdkfor wallet discovery, connection, and emoji verificationUniswap V4 Fuel Swap (Contracts + Frontend)
UniswapFuelSwap.sol— swaps a portion of bridged tokens for ETH via Uniswap V4, wraps to WETH, and bridges to L2 as fee juiceSwapBridgeRouter.sol— single-tx entry point: Permit2 transfer → optional fuel swap → TokenPortal depositSeedUniswapPools.s.sol— standalone Forge script to seed V4 pools with liquidityFuelTogglecomponent with real-time price quotes (CoinGecko + Uniswap V4 Quoter)SetTrustedForwarderAllPortalsadmin scriptWitness-Bound Permit2
routeHash+fuelRecipientencoding fix for the simple (non-fuel) bridge pathPermit2 is completely optional. There is a commit before the Permit2 work that uses the standard ERC20 approval method and doesn't change the TokenPortal contract at all. The router is layered on top — you can use the simpler path if preferred.
Tested on devnet ✅
What you'll need for production
UniswapFuelSwap,SwapBridgeRouter(Forge scripts provided)SeedUniswapPools.s.solfor ETH/FeeJuice and ERC20/WETH poolsSetTrustedForwarderAllPortalsto authorize the router on each TokenPortaldeployments.json: Point to your deployed contract addressesDeployment notes
4.0.0-devnet.2-patch.3_2026-03-20)pxe_data_*,wallet_data_*) must be cleaned before runningbridge-scriptdeploymentssaveFuelInfraToDeploymentadded tosave_contracts.tsfor the compliant scriptAlso vibe coded 🤖
A good chunk of this was built with Claude, so definitely give the contracts a proper review. The logic is solid from our testing but fresh eyes on the Solidity would be great.
🤖 Generated with Claude Code