Skip to content

refactor(multisig): fix requested changes#461

Open
0xisk wants to merge 8 commits intoadd-multisigfrom
refactor/add-multisig
Open

refactor(multisig): fix requested changes#461
0xisk wants to merge 8 commits intoadd-multisigfrom
refactor/add-multisig

Conversation

@0xisk
Copy link
Copy Markdown
Member

@0xisk 0xisk commented Apr 24, 2026

Types of changes

What types of changes does your code introduce to OpenZeppelin Midnight Contracts?
Put an `` in the boxes that apply

  • Bugfix (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)
  • Documentation Update (if none of the other choices apply)

Fixes #???

Contracts

  • ShieldedMultiSig preset
    • Validated createShieldedProposal recipient kind — rejects UnshieldedUser, preventing permanently unexecutable proposals.
    • Added module @notice/@warning documenting that contract-address signers are unreachable until C2C auth lands, with CMA-based upgrade path.
  • ShieldedMultiSigV2 preset
    • Constructor now asserts thresh <= 2 to match the 2-signature execute surface.
    • Docstring threshold range corrected.
  • ShieldedTreasury
    • Moved sent-total overflow check to fail-fast before sendShielded (mirrors _deposit).
    • Renamed _shieldedReceived/_shieldedSent_received/_sent.
    • Exported ledger fields so devs can fetch state client-side for free.
  • ShieldedTreasuryStateless_send docstring synchronized with the real signature (coin, not color).
  • SignerManager_signers changed from Map<T, Boolean> to Set<T>.
  • ProposalManager — ledger fields made export.

Utils

  • Moved UINT128_MAX and selfAsRecipient from both treasuries into Utils.compact; consumers now import via Utils_ prefix.
  • UINT128_MAX tagged with TODO to remove once a math module is available.

Tests

  • New ShieldedMultiSigV2 test scaffolding: simulator + witnesses + 12 tests (threshold guard, signer registration, duplicate/non-signer rejection, deposit, views).
  • Tightened SignerManagerSimulator signer type to an exported SignerSet readonly 3-tuple — compile-time enforcement of the Vector<3> contract invariant.
  • New tests in createShieldedProposal for recipient-kind guard (reject UnshieldedUser, accept Contract).
  • New tests in utils.test.ts for selfAsRecipient and UINT128_MAX.
  • Removed redundant UINT128_MAX exposure from treasury mocks/simulators/tests (now covered in Utils).

Docs / hygiene

  • Added SPDX + OZ header banners across all multisig/*.compact files.
  • Normalized JSDoc: blank line between last @param and @returns in all multisig contracts.
  • Fixed witness-file header typos (…Witness.ts…Witnesses.ts) in 4 files.
  • turbo.jsoncompact:multisig inputs corrected from src/access/**/*.compact to src/multisig/**/*.compact.

PR Checklist

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@0xisk 0xisk requested a review from andrew-fleming April 24, 2026 14:50
@0xisk 0xisk self-assigned this Apr 24, 2026
@0xisk 0xisk requested review from a team as code owners April 24, 2026 14:50
@0xisk 0xisk added the enhancement New feature or request label Apr 24, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74cb962a-8389-490a-a18a-1e3ee22befcd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/add-multisig

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

@0xisk 0xisk moved this from Backlog to Needs Review in OZ Development for Midnight Apr 24, 2026
@0xisk 0xisk mentioned this pull request Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

1 participant