OpenZeppelin / OpenZeppelin/compact-contracts
dev: restructure multisig module layout and consolidate duplicated preset logic
Open
1-medium
enhancement
- Dominant language
- TypeScript
- Stars
- 55
- Forks
- 29
- Avg merge
- 5d 7h
- Merged PRs (30d)
- 25
Description
Summary
Reorganize multisig/ modules into concern-based subdirectories, retire the
duplicated signer module, and extract shared logic so presets become thin,
composable wirings instead of monolithic contracts.
Motivation
- No contract-to-contract calls on Midnight → capabilities must be composed into
one contract. The current presets can't compose: each is a top-level contract
with its ownconstructor, and V2/V3 redefine the same structs/circuits. Signer.compactandSignerManager.compactare one module in two generations
(identical state;Signeradds init guards). Keeping both is leftover migration.ShieldedMultiSig/V2/V3imply a version lineage, but they are three
independent designs (proposal / signature / token mint-burn).- ECDSA-commitment verification is copy-pasted verbatim across V2 and V3; V1
inlines proposal-approval tracking that belongs inProposalManager.
Proposed change
Layout (modules grouped by concern; test/mocks/ mirrors it):
multisig/
├── signer/ SignerManager (+ SignatureVerifier)
├── proposal/ ProposalManager
├── treasury/ ShieldedTreasury / ShieldedTreasuryStateless / UnshieldedTreasury
├── forwarder/ ForwarderPrivate / ForwarderShielded / ForwarderUnshielded
└── presets/ … (presets/forwarder/ unchanged)
- Retire legacy
SignerManager; renameSigner→SignerManager(hardened
content). Migrate imports, mocks, andSigner:→SignerManager:error strings. - Extract a
SignatureVerifiermodule from the V2/V3 duplication. - Fold V1's approval tracking into
ProposalManager. - Rename presets by behavior:
ShieldedProposalMultiSig(V1),
ShieldedSignatureMultiSig(V2),ShieldedTokenMultiSig(V3). Standardize
MultiSigcasing.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.