Skip to content

Conversation

@typicalHuman
Copy link
Contributor

@typicalHuman typicalHuman commented Nov 5, 2025

Fixes #712

@typicalHuman typicalHuman requested review from a team as code owners November 5, 2025 11:58
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Walkthrough

This PR updates the OpenZeppelin Wizard to fix incorrect names in generated comments for Multisig accounts by renaming the SignerMultisig type family to MultiSignerERC7913 across test snapshots and updating the signerName derivation logic in account.ts.

Changes

Cohort / File(s) Summary
Changeset Documentation
.changeset/huge-ties-find.md
Added changeset entry documenting a minor version bump for @openzeppelin/wizard with a bug fix for incorrect Multisig account names in generated comments
Test Snapshots
packages/core/solidity/src/account.test.ts.md
Updated all test snapshots to reflect type renames: SignerMultisig → MultiSignerERC7913, SignerMultisigUpgradeable → MultiSignerERC7913Upgradeable, SignerMultisigWeighted → MultiSignerERC7913Weighted, and SignerMultisigWeightedUpgradeable → MultiSignerERC7913WeightedUpgradeable
Account Naming Logic
packages/core/solidity/src/account.ts
Modified overrideRawSignatureValidation to conditionally derive signerBaseName: when signer includes "Multisig", creates MultiSignerERC7913 variants; otherwise uses Signer prefix, followed by upgradeable wrapping when applicable

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • account.ts logic change: Verify the conditional signerBaseName derivation correctly handles all Multisig variants (plain, weighted, upgradeable combinations) and compare against the new test snapshots
  • Test snapshot consistency: Confirm all renamed type references are accurate and complete across the entire test file
  • Type naming consistency: Ensure the new MultiSignerERC7913 naming aligns with the actual contract types being generated

Possibly related PRs

Suggested reviewers

  • ericglau
  • ericnordelo
  • ernestognw

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing a bug with incorrect names in generated comments for Multisig accounts, which aligns with the primary changeset modifications.
Description check ✅ Passed The PR description references issue #712 and the changeset documents a bug fix for incorrect names in generated comments for Multisig accounts, which aligns with the code changes renaming SignerMultisig types to MultiSignerERC7913.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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: 1

🧹 Nitpick comments (1)
packages/core/solidity/src/account.ts (1)

247-250: Excellent fix for the Multisig naming bug!

The logic correctly maps Multisig signers to their actual OpenZeppelin contract names (MultiSignerERC7913 and MultiSignerERC7913Weighted) instead of the incorrect SignerMultisig pattern. This ensures generated comments reference the correct contract names.

Optional: Use strict equality for consistency.

Consider using === instead of == on line 248 for consistency with TypeScript best practices:

-    const signerBaseName = opts.signer.includes('Multisig')
-      ? `MultiSignerERC7913${opts.signer == 'MultisigWeighted' ? 'Weighted' : ''}`
-      : `Signer${opts.signer}`;
+    const signerBaseName = opts.signer.includes('Multisig')
+      ? `MultiSignerERC7913${opts.signer === 'MultisigWeighted' ? 'Weighted' : ''}`
+      : `Signer${opts.signer}`;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a35c93 and 9419c40.

⛔ Files ignored due to path filters (1)
  • packages/core/solidity/src/account.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • .changeset/huge-ties-find.md (1 hunks)
  • packages/core/solidity/src/account.test.ts.md (24 hunks)
  • packages/core/solidity/src/account.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: .changeset/sour-hats-grow.md:2-6
Timestamp: 2025-08-15T22:49:25.653Z
Learning: In OpenZeppelin contracts-wizard, breaking changes that have concrete migration paths (like dependency migrations from Community Contracts to OpenZeppelin Contracts) can be handled as minor version bumps instead of major bumps, per maintainer ernestognw's versioning policy.
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/signer.ts:31-38
Timestamp: 2025-08-15T23:23:13.097Z
Learning: In OpenZeppelin contracts-wizard, the `setUpgradeableAccount` function deliberately sets `c.upgradeable = false` after upgradeable setup to exclude EIP712Upgradeable and ERC7739Upgradeable variants (avoiding per-call SLOAD overhead). This architectural pattern necessitates manual `_disableInitializers()` setup in both account.ts and signer.ts since the standard upgradeable constructor logic doesn't apply when upgradeability is disabled post-setup.
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/signer.ts:45-49
Timestamp: 2025-08-19T01:15:58.945Z
Learning: The OpenZeppelin contracts-upgradeable package includes upgradeable versions of signer contracts like SignerECDSAUpgradeable, SignerP256Upgradeable, SignerRSAUpgradeable, MultiSignerERC7913Upgradeable, and MultiSignerERC7913WeightedUpgradeable in the contracts/utils/cryptography/signers directory.
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/signer.ts:45-49
Timestamp: 2025-08-19T01:15:58.945Z
Learning: All OpenZeppelin signer contracts have upgradeable variants available in the contracts-upgradeable package: SignerECDSAUpgradeable, SignerP256Upgradeable, SignerRSAUpgradeable, MultiSignerERC7913Upgradeable, and MultiSignerERC7913WeightedUpgradeable all exist in contracts/utils/cryptography/signers/ directory.
📚 Learning: 2025-08-19T01:15:58.945Z
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/signer.ts:45-49
Timestamp: 2025-08-19T01:15:58.945Z
Learning: The OpenZeppelin contracts-upgradeable package includes upgradeable versions of signer contracts like SignerECDSAUpgradeable, SignerP256Upgradeable, SignerRSAUpgradeable, MultiSignerERC7913Upgradeable, and MultiSignerERC7913WeightedUpgradeable in the contracts/utils/cryptography/signers directory.

Applied to files:

  • packages/core/solidity/src/account.ts
  • packages/core/solidity/src/account.test.ts.md
📚 Learning: 2025-08-15T23:23:13.097Z
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/signer.ts:31-38
Timestamp: 2025-08-15T23:23:13.097Z
Learning: In OpenZeppelin contracts-wizard, the `setUpgradeableAccount` function deliberately sets `c.upgradeable = false` after upgradeable setup to exclude EIP712Upgradeable and ERC7739Upgradeable variants (avoiding per-call SLOAD overhead). This architectural pattern necessitates manual `_disableInitializers()` setup in both account.ts and signer.ts since the standard upgradeable constructor logic doesn't apply when upgradeability is disabled post-setup.

Applied to files:

  • packages/core/solidity/src/account.ts
  • packages/core/solidity/src/account.test.ts.md
📚 Learning: 2025-08-19T01:15:58.945Z
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/signer.ts:45-49
Timestamp: 2025-08-19T01:15:58.945Z
Learning: All OpenZeppelin signer contracts have upgradeable variants available in the contracts-upgradeable package: SignerECDSAUpgradeable, SignerP256Upgradeable, SignerRSAUpgradeable, MultiSignerERC7913Upgradeable, and MultiSignerERC7913WeightedUpgradeable all exist in contracts/utils/cryptography/signers/ directory.

Applied to files:

  • packages/core/solidity/src/account.ts
  • packages/core/solidity/src/account.test.ts.md
📚 Learning: 2025-08-29T22:26:44.931Z
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 653
File: packages/core/solidity/src/account.ts:189-201
Timestamp: 2025-08-29T22:26:44.931Z
Learning: In ERC-7579, accounts support multiple execution paths: the standard ERC-4337 path requiring validators for UserOp validation, and the module execution path where executor modules can directly call executeFromExecutor to execute transactions on behalf of the account. This means accounts initialized with only an executor module are functional and valid according to the ERC-7579 specification.

Applied to files:

  • packages/core/solidity/src/account.ts
  • packages/core/solidity/src/account.test.ts.md
📚 Learning: 2025-08-20T20:23:30.259Z
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/set-upgradeable.ts:0-0
Timestamp: 2025-08-20T20:23:30.259Z
Learning: In OpenZeppelin contracts-wizard, upgradeable contracts use two different strategies for Initializable imports: Account contracts directly import from contracts-upgradeable/proxy/utils/Initializable.sol for explicit clarity, while other upgradeable contracts (ERC20, ERC721, Governor, etc.) use helpers to automatically transpile imports to upgradeable versions. This architectural separation is intentional due to the special ERC-4337 requirements of account contracts.

Applied to files:

  • packages/core/solidity/src/account.ts
📚 Learning: 2025-08-21T19:44:06.797Z
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/account.ts:191-204
Timestamp: 2025-08-21T19:44:06.797Z
Learning: Initializable is available in both openzeppelin/contracts and openzeppelin/contracts-upgradeable packages, so conditional imports like `openzeppelin/${opts.upgradeable ? 'contracts-upgradeable' : 'contracts'}/proxy/utils/Initializable.sol` are valid and will resolve correctly.

Applied to files:

  • packages/core/solidity/src/account.ts
📚 Learning: 2025-08-15T22:49:25.653Z
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: .changeset/sour-hats-grow.md:2-6
Timestamp: 2025-08-15T22:49:25.653Z
Learning: In OpenZeppelin contracts-wizard, breaking changes that have concrete migration paths (like dependency migrations from Community Contracts to OpenZeppelin Contracts) can be handled as minor version bumps instead of major bumps, per maintainer ernestognw's versioning policy.

Applied to files:

  • .changeset/huge-ties-find.md
📚 Learning: 2025-09-12T15:07:08.673Z
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 663
File: packages/core/cairo_alpha/src/custom.test.ts.md:12-12
Timestamp: 2025-09-12T15:07:08.673Z
Learning: In the OpenZeppelin contracts-wizard cairo_alpha package changelog (packages/core/cairo_alpha/CHANGELOG.md), each alpha version gets its own separate entry under the "Unreleased" section rather than updating a single entry. This allows tracking of changes across different alpha releases (e.g., v3.0.0-alpha.0, v3.0.0-alpha.1, v3.0.0-alpha.2 all have separate entries).

Applied to files:

  • .changeset/huge-ties-find.md
🧬 Code graph analysis (1)
packages/core/solidity/src/account.ts (1)
packages/core/solidity/src/options.ts (1)
  • upgradeableName (6-12)
⏰ 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). (2)
  • GitHub Check: build (solidity, default)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
.changeset/huge-ties-find.md (1)

1-5: LGTM!

The changeset correctly categorizes this as a minor version bump for a bug fix. The description clearly states the issue being resolved.

Comment on lines +6244 to +6245
// IMPORTANT: Make sure MultiSignerERC7913 is most derived than AccountERC7579␊
// in the inheritance chain (i.e. contract ... is AccountERC7579, ..., MultiSignerERC7913)␊
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Multisig comment rename to MultiSignerERC7913 looks correct.

Snapshot guidance now matches OZ naming (MultiSignerERC7913 and MultiSignerERC7913Weighted, incl. Upgradeable). Nice cleanup. One ask: in weighted sections, confirm the override list intentionally references MultiSignerERC7913 (base) vs Weighted if Weighted doesn’t override _rawSignatureValidation.

Also applies to: 6310-6311, 6381-6382, 6453-6454, 6900-6901, 6983-6984, 7070-7071, 7158-7159, 7625-7626, 7705-7706, 7786-7787, 8166-8167, 8240-8241, 8319-8320, 8399-8400, 8909-8910, 9000-9001, 9095-9096, 9191-9192, 9645-9646, 9729-9730, 9817-9818, 9906-9907


🏁 Script executed:

#!/bin/bash
# 1) Ensure no stale SignerMultisig identifiers remain (except in EIP712 titles/UI text if intended).
rg -nP 'SignerMultisig(Weighted)?(Upgradeable)?' -g '!**/node_modules/**'

# 2) Confirm expected MultiSigner names are present.
rg -nP 'MultiSignerERC7913(Weighted)?(Upgradeable)?' packages/

# 3) Double‑check weighted snapshots’ override lines use the intended base types.
rg -nP -C2 'override\(MultiSignerERC7913(?:Upgradeable)?[, ]' packages/core/solidity/src/account.test.ts.md

Length of output: 73012


Fix weighted section override clauses to match guidance comments.

The snapshot comments correctly specify inheritance order for MultiSignerERC7913Weighted variants (e.g., lines 8166-8167: "Make sure MultiSignerERC7913Weighted is most derived..."), but the corresponding override clauses incorrectly reference only the base MultiSignerERC7913. For weighted sections:

  • Lines 8173, 8247, 8326, 8406: override(MultiSignerERC7913, ...) should be override(MultiSignerERC7913Weighted, ...)
  • Lines 8916, 9007, 9102, 9198, 9652, 9736, 9824, 9913: override(MultiSignerERC7913Upgradeable, ...) should be override(MultiSignerERC7913WeightedUpgradeable, ...)

Also applies to: 8240-8241, 8319-8320, 8399-8400, 9000-9001, 9095-9096, 9191-9192, 9645-9646, 9729-9730, 9817-9818, 9906-9907

🤖 Prompt for AI Agents
packages/core/solidity/src/account.test.ts.md around the noted ranges (weighted
sections): update the incorrect override clauses to reference the weighted
most-derived contracts as per the comments; specifically replace
override(MultiSignerERC7913, ...) with override(MultiSignerERC7913Weighted, ...)
at lines 8173, 8247, 8326, 8406 (and the corresponding nearby occurrences at
8240-8241, 8319-8320, 8399-8400), and replace
override(MultiSignerERC7913Upgradeable, ...) with
override(MultiSignerERC7913WeightedUpgradeable, ...) at lines 8916, 9007, 9102,
9198, 9652, 9736, 9824, 9913 (and the corresponding nearby occurrences at
9000-9001, 9095-9096, 9191-9192, 9645-9646, 9729-9730, 9817-9818, 9906-9907);
ensure each override list includes the weighted variant as the most-derived
override target to match the inheritance comment.

Copy link
Member

@ericglau ericglau left a comment

Choose a reason for hiding this comment

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

Thanks!

@ericglau ericglau merged commit 6b8f8f5 into OpenZeppelin:master Nov 5, 2025
19 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Solidity account with Multisig - incorrect names in generated comment

3 participants