Skip to content

Conversation

@cryptotavares
Copy link
Contributor

@cryptotavares cryptotavares commented Nov 18, 2025

Note

Adds a new batch USDC→ETH swap using wallet_sendCalls and refactors shared swap logic into swapUtils; updates Swap Comparison to use the shared utilities and wires the new component into the app.

  • Transactions:
    • New batchUsdcSwap component (src/components/transactions/batchUsdcSwap.js):
      • Builds 3-call atomic batch (ERC20 approve → Permit2 approve → Universal Router swap) and submits via wallet_sendCalls (EIP-5792).
      • Supports configurable USDC amount, fee recipient, and fee percentage; displays status and batch ID.
  • Refactor:
    • Extract shared swap utilities (src/components/transactions/swapUtils.js): constants (addresses, defaults), parsing helpers, V4 action builders, and encoding helpers (approve/permit2).
    • Update swapComparison to import from swapUtils, removing duplicated constants/helpers.
  • Wiring:
    • Export batchUsdcSwap in components/transactions/index.js and render it in src/index.js.

Written by Cursor Bugbot for commit eaa6592. This will update automatically on new commits. Configure here.

@cryptotavares cryptotavares force-pushed the cryptotavares/add-batch-swap-comparison-card branch from e72b34d to eaa6592 Compare November 18, 2025 10:51
@cryptotavares cryptotavares marked this pull request as ready for review November 18, 2025 10:51
amountOutMinimum,
currencyIn: USDC_ADDRESS,
},
]);
Copy link

Choose a reason for hiding this comment

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

Bug: Swap Parameters: Order Matters

Parameter order mismatch in SWAP_EXACT_IN action. The SWAP_EXACT_IN_STRUCT expects parameters in order: currencyIn, path, amountIn, amountOutMinimum, but the object passed has path before currencyIn. This will cause incorrect encoding and transaction failure. Reorder the object properties to match the struct definition.

Fix in Cursor Fix in Web

@cryptotavares cryptotavares merged commit f3644ab into main Nov 18, 2025
9 checks passed
@cryptotavares cryptotavares deleted the cryptotavares/add-batch-swap-comparison-card branch November 18, 2025 11:52
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.

3 participants