Skip to content

Commit c7f9ffc

Browse files
Remove stale SignerManager (OpenZeppelin#760)
1 parent 9c2032c commit c7f9ffc

10 files changed

Lines changed: 16 additions & 612 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
### Changed
1616

17+
- Consolidate the duplicate multisig signer registries onto `Signer`, removing `SignerManager` (#760)
1718
- Rename the contract-compilation scripts and Turbo tasks from `compact` / `compact:*` to `compile` / `compile:*`, and the Biome scripts from `fmt-and-lint` / `fmt-and-lint:*` to `lint` / `lint:*`. (#680)
1819
- Rename the native shielded token supply extensions to `NativeShieldedTokenPublicSupply` / `NativeShieldedTokenFamilyPublicSupply` (and the shared `NativeShieldedTokenPublicSupplyCore`), making explicit that they track supply on-chain and matching the `ConfidentialFungibleTokenPublicSupply` naming. (#710)
1920

contracts/src/multisig/Signer.compact

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ module Signer<T> {
6666
* and an initial set of signers.
6767
* If used, it should only be called in the contract's constructor.
6868
*
69-
* @circuitInfo k=11, rows=1815
70-
*
7169
* Requirements:
7270
*
7371
* - If used, can only be called once (in the constructor).
@@ -98,8 +96,6 @@ module Signer<T> {
9896
/**
9997
* @description Asserts that the given caller is an active signer.
10098
*
101-
* @circuitInfo k=10, rows=585
102-
*
10399
* Requirements:
104100
*
105101
* - Contract must be initialized.
@@ -116,7 +112,7 @@ module Signer<T> {
116112
/**
117113
* @description Asserts that the given approval count meets the threshold.
118114
*
119-
* @circuitInfo k=9, rows=54
115+
* @circuitInfo k=9, rows=56
120116
*
121117
* Requirements:
122118
*
@@ -138,7 +134,7 @@ module Signer<T> {
138134
/**
139135
* @description Returns the current signer count.
140136
*
141-
* @circuitInfo k=6, rows=26
137+
* @circuitInfo k=6, rows=28
142138
*
143139
* Requirements:
144140
*
@@ -154,7 +150,7 @@ module Signer<T> {
154150
/**
155151
* @description Returns the approval threshold.
156152
*
157-
* @circuitInfo k=6, rows=26
153+
* @circuitInfo k=6, rows=28
158154
*
159155
* Requirements:
160156
*
@@ -170,8 +166,6 @@ module Signer<T> {
170166
/**
171167
* @description Returns whether the given account is an active signer.
172168
*
173-
* @circuitInfo k=10, rows=605
174-
*
175169
* @param {T} account - The account to check.
176170
* @returns {Boolean} True if the account is an active signer.
177171
*/
@@ -188,8 +182,6 @@ module Signer<T> {
188182
* The consuming contract must gate this behind its own
189183
* authorization policy.
190184
*
191-
* @circuitInfo k=10, rows=598
192-
*
193185
* Requirements:
194186
*
195187
* - `signer` must not already be an active signer.
@@ -214,8 +206,6 @@ module Signer<T> {
214206
* The consuming contract must gate this behind its own
215207
* authorization policy.
216208
*
217-
* @circuitInfo k=10, rows=612
218-
*
219209
* Requirements:
220210
*
221211
* - `signer` must be an active signer.

contracts/src/multisig/SignerManager.compact

Lines changed: 0 additions & 205 deletions
This file was deleted.

contracts/src/multisig/presets/ShieldedMultiSig.compact

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pragma language_version >= 0.23.0;
55

66
/**
77
* @module ShieldedMultiSig
8-
* @description A shielded multisig preset composing `SignerManager`,
8+
* @description A shielded multisig preset composing `Signer`,
99
* `ProposalManager`, and `ShieldedTreasury`. Signers approve proposals that
1010
* transfer shielded tokens out of the treasury once the configured threshold
1111
* is met.
@@ -29,7 +29,7 @@ import CompactStandardLibrary;
2929

3030
import "../ProposalManager" prefix Proposal_;
3131
import "../ShieldedTreasury" prefix Treasury_;
32-
import "../SignerManager"<Either<ZswapCoinPublicKey, ContractAddress>> prefix Signer_;
32+
import "../Signer"<Either<ZswapCoinPublicKey, ContractAddress>> prefix Signer_;
3333

3434
// ─── State ───────────────────────────────────────────────────────────────
3535

@@ -212,7 +212,7 @@ export circuit getSentTotal(color: Bytes<32>): Uint<128> {
212212
return Treasury_getSentTotal(color);
213213
}
214214

215-
// ISignerManager
215+
// ISigner
216216

217217
export circuit getSignerCount(): Uint<8> {
218218
return Signer_getSignerCount();

contracts/src/multisig/presets/ShieldedMultiSigV2.compact

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import CompactStandardLibrary;
2424

2525
import "../ProposalManager" prefix Proposal_;
2626
import "../ShieldedTreasuryStateless" prefix Treasury_;
27-
import "../SignerManager"<Bytes<32>> prefix Signer_;
27+
import "../Signer"<Bytes<32>> prefix Signer_;
2828

2929
// ─── Types ──────────────────────────────────────────────────────
3030

contracts/src/multisig/test/ShieldedMultiSig.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ describe('ShieldedMultiSig', () => {
8282
it('should fail with zero threshold', async () => {
8383
await expect(
8484
ShieldedMultiSigSimulator.create(SIGNERS, 0n),
85-
).rejects.toThrow('SignerManager: threshold must be > 0');
85+
).rejects.toThrow('Signer: threshold must not be zero');
8686
});
8787

8888
it('should fail with threshold exceeding signer count', async () => {
8989
await expect(
9090
ShieldedMultiSigSimulator.create(SIGNERS, 4n),
91-
).rejects.toThrow('SignerManager: threshold exceeds signer count');
91+
).rejects.toThrow('Signer: threshold exceeds signer count');
9292
});
9393
});
9494

@@ -206,7 +206,7 @@ describe('ShieldedMultiSig', () => {
206206
multisig
207207
.as('OTHER')
208208
.createShieldedProposal(to, COLOR, PROPOSAL_AMOUNT),
209-
).rejects.toThrow('SignerManager: not a signer');
209+
).rejects.toThrow('Signer: not a signer');
210210
});
211211

212212
it('should fail with zero amount', async () => {
@@ -273,7 +273,7 @@ describe('ShieldedMultiSig', () => {
273273
it('should fail for non-signer', async () => {
274274
await expect(
275275
multisig.as('OTHER').approveProposal(proposalId),
276-
).rejects.toThrow('SignerManager: not a signer');
276+
).rejects.toThrow('Signer: not a signer');
277277
});
278278

279279
it('should fail for double approval', async () => {
@@ -324,7 +324,7 @@ describe('ShieldedMultiSig', () => {
324324
it('should fail for non-signer', async () => {
325325
await expect(
326326
multisig.as('OTHER').revokeApproval(proposalId),
327-
).rejects.toThrow('SignerManager: not a signer');
327+
).rejects.toThrow('Signer: not a signer');
328328
});
329329

330330
it('should fail if not yet approved', async () => {
@@ -421,7 +421,7 @@ describe('ShieldedMultiSig', () => {
421421
await multisig.as('SIGNER1').approveProposal(id2);
422422

423423
await expect(multisig.executeShieldedProposal(id2)).rejects.toThrow(
424-
'SignerManager: threshold not met',
424+
'Signer: threshold not met',
425425
);
426426
});
427427

contracts/src/multisig/test/ShieldedMultiSigV2.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe('ShieldedMultiSigV2', () => {
9999
SIGNER_COMMITMENTS,
100100
0n,
101101
),
102-
).rejects.toThrow('SignerManager: threshold must be > 0');
102+
).rejects.toThrow('Signer: threshold must not be zero');
103103
});
104104

105105
it('should fail with threshold greater than 2', async () => {
@@ -192,7 +192,7 @@ describe('ShieldedMultiSigV2', () => {
192192
[PK1, NON_SIGNER_PK],
193193
[DUMMY_SIG, DUMMY_SIG],
194194
),
195-
).rejects.toThrow('SignerManager: not a signer');
195+
).rejects.toThrow('Signer: not a signer');
196196
});
197197
});
198198
});

0 commit comments

Comments
 (0)