fix: do not support 7702/5792 for 4337 AA accounts#2507
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| ]) | ||
| ); | ||
|
|
||
| const eoaMiddleware = providerAsMiddleware(eoaProvider, overrideEip5792And7702MethodsHandlers); |
There was a problem hiding this comment.
no. don't change provider as middleware.
add these above middlewares under the engine below in between aaMiddleware and eoaMiddleware
| const engine = JRPCEngineV2.create({ middleware: [switchChainMiddleware, forwardMiddleware] }); | ||
| const engineProvider = providerFromEngineV2(engine) as IProvider; | ||
|
|
||
| return { |
There was a problem hiding this comment.
so that metamaskConnector can handle provider requests from the dapp
There was a problem hiding this comment.
since we wrapped the evmProvider with the engine, we will need to handle/forward the rest of the events, requests right?
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.

Jira Link
https://consensyssoftware.atlassian.net/browse/EMBED-371?atlOrigin=eyJpIjoiYTBiYTU3ODRjNWU5NDY0ZjlhYjNlM2Y2YWM3ZWEzM2EiLCJwIjoiaiJ9
Description
ProviderErrors.Unsupported) for the Eip7702/5792 calls from 4337 AA accounts.How has this been tested?
Screenshots (if appropriate)
Types of changes
Checklist
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
injectedconnector imports moved to the mainwagmi/@wagmi/coreentrypoints (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-modalto 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.