Skip to content

Feat/7702 5792 support#2378

Open
lwin-kyaw wants to merge 5 commits intov10from
feat/7702-5792-support
Open

Feat/7702 5792 support#2378
lwin-kyaw wants to merge 5 commits intov10from
feat/7702-5792-support

Conversation

@lwin-kyaw
Copy link

@lwin-kyaw lwin-kyaw commented Feb 17, 2026

Motivation and Context

Jira Link:

Description

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.
  • My code requires a db migration.

Note

Medium Risk
Touches transaction formatting/signing and provider initialization behavior; mistakes could lead to invalid tx serialization or new runtime throws for previously-null provider/chain states.

Overview
Adds EIP-7702 and EIP-5792 JSON-RPC support to @web3auth/no-modal by introducing new middlewares (eip7702Middleware, eip5792Middleware) and wiring them into EthereumSigningProvider’s RPC engine.

Transaction handling is extended to support EIP-7702 setCode (type 0x4) by preserving tx type in TransactionFormatter, signing authorizationList entries during MPC signing, and adding a shared createGetEthCode helper for controller-driven validation. Provider getters now throw providerErrors when uninitialized/missing chain instead of returning null, and @toruslabs/ethereum-controllers is bumped to ^8.17.0 with corresponding lockfile updates.

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

@vercel
Copy link

vercel bot commented Feb 17, 2026

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

Project Deployment Actions Updated (UTC)
web3auth-web Error Error Feb 19, 2026 0:57am

Request Review

Copy link

@cursor cursor bot left a comment

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 3 potential issues.

@@ -1,3 +1,4 @@
export * from "./eip5792Middleware";
Copy link

Choose a reason for hiding this comment

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

Missing barrel export for eip7702Middleware module

Medium Severity

The rpc/index.ts barrel file re-exports eip5792Middleware but not eip7702Middleware. In EthereumSigningProvider.ts, createEip5792Middleware is imported through the barrel (from "../../../ethereum-provider"), while createEip7702Middleware requires a direct file path import (from "../../../ethereum-provider/rpc/eip7702Middleware"). This inconsistency means other providers that need EIP-7702 middleware can't discover it through the standard barrel export.

Fix in Cursor Fix in Web

});
return (code || "0x") as `0x${string}`;
};
}
Copy link

Choose a reason for hiding this comment

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

createGetEthCode ignores chainId causing cross-chain misqueries

Medium Severity

createGetEthCode silently ignores the _chainId parameter, always querying eth_getCode against the currently connected chain. In eip7702Middleware, getAccountUpgradeStatus passes a user-specified chainId to getIsEip7702UpgradeSupported and getDelegationAddress, which forward it to getEthCode — but the chain ID is discarded. If the requested chain differs from the connected chain, the upgrade status and delegation address will be incorrect.

Additional Locations (1)

Fix in Cursor Fix in Web

r: zeroAddress(),
s: zeroAddress(),
yParity: 0,
});
Copy link

Choose a reason for hiding this comment

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

Dummy signature uses 20-byte address instead of 32-byte value

High Severity

Signature.from({ r: zeroAddress(), s: zeroAddress(), yParity: 0 }) will throw at runtime because zeroAddress() returns a 20-byte hex string (0x0000…0000, 40 hex chars), but ethers.js v6 Signature constructor validates that r and s are exactly 32 bytes and rejects shorter values with an "invalid r" assertion error. This makes wallet_upgradeAccount always fail before the transaction is even built. A 32-byte zero value (e.g., "0x" + "00".repeat(32)) is needed instead.

Fix in Cursor Fix in Web

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.

1 participant

Comments