Skip to content

fix: do not support 7702/5792 for 4337 AA accounts#2507

Merged
chaitanyapotti merged 10 commits into
masterfrom
fix/disable-7702-support-for-4337-AA
Jun 2, 2026
Merged

fix: do not support 7702/5792 for 4337 AA accounts#2507
chaitanyapotti merged 10 commits into
masterfrom
fix/disable-7702-support-for-4337-AA

Conversation

@lwin-kyaw

@lwin-kyaw lwin-kyaw commented May 28, 2026

Copy link
Copy Markdown
Contributor

Jira Link

https://consensyssoftware.atlassian.net/browse/EMBED-371?atlOrigin=eyJpIjoiYTBiYTU3ODRjNWU5NDY0ZjlhYjNlM2Y2YWM3ZWEzM2EiLCJwIjoiaiJ9

Description

  • throw a proper error (ProviderErrors.Unsupported) for the Eip7702/5792 calls from 4337 AA accounts.
  • update demo for x402 feature

How has this been tested?

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 not work as expected)

Checklist

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Note

Medium Risk
Changes AA provider RPC behavior and wagmi connector wiring, which can affect dApps using smart accounts or Wagmi; demo-only changes are low risk.

Overview
ERC-4337 account-abstraction providers now reject EIP-7702 and EIP-5792 JSON-RPC methods via new middleware in the AA RPC stack, returning an explicit unsupported-method error instead of forwarding them to the EOA provider. AA setup also fails fast when chain config is missing for the active chain.

Small fixes: optional chaining when inferring Solana vs EVM for linked accounts in the auth connector, and wagmi injected connector imports moved to the main wagmi / @wagmi/core entrypoints (React and Vue).

The Vue x402 demo points at a new default protected URL, switches to Base Sepolia using configured EIP-155 chains, and improves chain-switch logging. Lockfile bumps @web3auth/modal / no-modal to 11.0.0-beta.2.

Reviewed by Cursor Bugbot for commit 23bdef6. Bugbot is set up for automated code reviews on this repo. Configure here.

@lwin-kyaw lwin-kyaw requested a review from a team as a code owner May 28, 2026 09:16
@vercel

vercel Bot commented May 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web3auth-web Ready Ready Preview, Comment Jun 2, 2026 7:04am

Request Review

])
);

const eoaMiddleware = providerAsMiddleware(eoaProvider, overrideEip5792And7702MethodsHandlers);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no. don't change provider as middleware.
add these above middlewares under the engine below in between aaMiddleware and eoaMiddleware

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed here, 0f8553a

Comment thread packages/no-modal/src/connectors/metamask-connector/metamaskConnector.ts Outdated
Comment thread demo/vue-app-new/src/components/X402Tester.vue
const engine = JRPCEngineV2.create({ middleware: [switchChainMiddleware, forwardMiddleware] });
const engineProvider = providerFromEngineV2(engine) as IProvider;

return {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

so that metamaskConnector can handle provider requests from the dapp

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

since we wrapped the evmProvider with the engine, we will need to handle/forward the rest of the events, requests right?

Comment thread packages/no-modal/src/connectors/metamask-connector/metamaskConnector.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b199357. Configure here.

Comment thread packages/no-modal/src/connectors/metamask-connector/metamaskConnector.ts Outdated
Comment thread packages/no-modal/src/connectors/metamask-connector/metamaskConnector.ts Outdated
@chaitanyapotti chaitanyapotti merged commit 2f7b3c0 into master Jun 2, 2026
6 of 7 checks passed
@chaitanyapotti chaitanyapotti deleted the fix/disable-7702-support-for-4337-AA branch June 2, 2026 07:43
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