Skip to content

Comments

Gasless Bug Fixes#416

Merged
vignesha22 merged 1 commit intostagingfrom
PRO-3735-Gasless_Bug_Fix
Oct 1, 2025
Merged

Gasless Bug Fixes#416
vignesha22 merged 1 commit intostagingfrom
PRO-3735-Gasless_Bug_Fix

Conversation

@vignesha22
Copy link
Contributor

@vignesha22 vignesha22 commented Oct 1, 2025

Description

  • Changing the paymaster Context if the gas token is changed

How Has This Been Tested?

  • Tested Locally

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Summary by CodeRabbit

  • New Features
    • Gasless/paymaster transactions now automatically use the fee token you select, enabling seamless authorization with your chosen asset.
  • Bug Fixes
    • Resolved inconsistencies where gasless/paymaster flows might not reflect the selected fee token, reducing transaction failures and authorization prompts.
  • UX Improvements
    • More predictable behavior when switching fee assets, ensuring the selected token is consistently applied across send flows.

@vignesha22 vignesha22 requested a review from IAmKio October 1, 2025 13:43
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 1, 2025

Walkthrough

Adds logic to update paymaster context when the fee asset selection changes by setting mode to "commonerc20" and storing the selected token address, alongside the existing update of selectedPaymasterAddress.

Changes

Cohort / File(s) Summary
Send modal paymaster update
src/components/BottomMenuModal/SendModal/SendModalTokensTabView.tsx
On fee asset change, also sets paymaster mode to "commonerc20" and records the selected token address in paymaster context, complementing selectedPaymasterAddress updates.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant UI as SendModalTokensTabView
  participant Fee as Fee Asset State
  participant PM as PaymasterContext

  User->>UI: Select fee asset (token)
  UI->>Fee: Update selected fee asset
  UI->>PM: setMode("commonerc20")
  UI->>PM: setTokenAddress(selected token address)
  UI->>PM: update selectedPaymasterAddress (existing)
  PM-->>UI: Context updated
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • fix/paymaster-batch-cleanup #408: Also modifies SendModalTokensTabView paymaster behavior, adding batch cleanup logic alongside fee-asset updates.
  • Bug Fixes on Gasless #412: Updates paymaster-related state propagation on fee asset changes within SendModalTokensTabView.
  • Fixed Send Bug #347: Adjusts fee asset balance handling and paymaster fee checks in the same SendModalTokensTabView flow.

Suggested reviewers

  • IAmKio
  • RanaBug

Poem

A hop, a skip—new tokens in tow,
I flip the fee, and paymasters know.
"commonerc20," I whisper with glee,
Address in my paws, gas runs free.
Thump-thump! Code aligned, off we go! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title “Gasless Bug Fixes” is overly generic and does not convey the specific change of updating the paymaster context when the gas token selection changes, making it unclear to reviewers what exactly was fixed. Please revise the title to clearly reflect the primary change, for example “Update paymaster context on gas token change,” so that reviewers immediately understand the intent of the fix.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed The pull request description follows the repository’s template with a clear summary under Description, a brief testing section, an (optional) screenshots header, and properly checked Types of changes, indicating that it is mostly complete and structured correctly.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch PRO-3735-Gasless_Bug_Fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vignesha22 vignesha22 requested a review from RanaBug October 1, 2025 13:43
@cloudflare-workers-and-pages
Copy link

Deploying x with  Cloudflare Pages  Cloudflare Pages

Latest commit: 54671ad
Status: ✅  Deploy successful!
Preview URL: https://e58f1760.x-e62.pages.dev
Branch Preview URL: https://pro-3735-gasless-bug-fix.x-e62.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/components/BottomMenuModal/SendModal/SendModalTokensTabView.tsx (1)

2206-2209: LGTM! Consider adding setIsPaymaster(true) for consistency.

The fix correctly updates the paymaster context when the gas token changes, which aligns with the PR objective. The implementation is consistent with similar patterns elsewhere in the code (lines 349-352, 365-369).

For defensive programming and consistency with lines 353, 370, and 2222, consider also setting setIsPaymaster(true) after updating the context:

 setPaymasterContext({
   mode: 'commonerc20',
   token: tokenAddress,
 });
+setIsPaymaster(true);

While this should already be true when this callback is invoked (since it's only accessible in gasless mode per line 2313-2315), explicitly setting it provides additional safety and matches the pattern used elsewhere.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9d97cae and 54671ad.

📒 Files selected for processing (1)
  • src/components/BottomMenuModal/SendModal/SendModalTokensTabView.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: unit-tests
  • GitHub Check: lint
  • GitHub Check: build

@vignesha22 vignesha22 merged commit b2acbe4 into staging Oct 1, 2025
6 checks passed
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