@@ -3,7 +3,7 @@ pragma solidity 0.8.23;
3
3
4
4
import {ISemaphore} from "./interfaces/ISemaphore.sol " ;
5
5
import {ISemaphoreVerifier} from "./interfaces/ISemaphoreVerifier.sol " ;
6
- import {SemaphoreGroups} from "./SemaphoreGroups.sol " ;
6
+ import {SemaphoreGroups} from "./base/ SemaphoreGroups.sol " ;
7
7
8
8
/// @title Semaphore
9
9
/// @dev This contract uses the Semaphore base contracts to provide a complete service
@@ -13,15 +13,15 @@ import {SemaphoreGroups} from "./SemaphoreGroups.sol";
13
13
/// generated with a new root a duration (or an expiry) within which the proofs generated with that root
14
14
/// can be validated.
15
15
contract Semaphore is ISemaphore , SemaphoreGroups {
16
- ISemaphoreVerifier[] public verifiers ;
16
+ ISemaphoreVerifier public verifier ;
17
17
18
18
/// @dev Gets a group id and returns the group parameters.
19
19
mapping (uint256 => Group) public groups;
20
20
21
- /// @dev Initializes the Semaphore verifiers used to verify the user's ZK proofs.
22
- /// @param _verifiers : Semaphore verifier addresses .
23
- constructor (ISemaphoreVerifier[] memory _verifiers ) {
24
- verifiers = _verifiers ;
21
+ /// @dev Initializes the Semaphore verifier used to verify the user's ZK proofs.
22
+ /// @param _verifier : Semaphore verifier addresse .
23
+ constructor (ISemaphoreVerifier _verifier ) {
24
+ verifier = _verifier ;
25
25
}
26
26
27
27
/// @dev See {SemaphoreGroups-_createGroup}.
@@ -131,7 +131,7 @@ contract Semaphore is ISemaphore, SemaphoreGroups {
131
131
uint256 scope ,
132
132
uint256 [8 ] calldata proof
133
133
) public view override onlyExistingGroup (groupId) returns (bool ) {
134
- if (merkleTreeDepth < 1 || merkleTreeDepth > verifiers. length ) {
134
+ if (merkleTreeDepth < 1 || merkleTreeDepth > 12 ) {
135
135
revert Semaphore__MerkleTreeDepthIsNotSupported ();
136
136
}
137
137
@@ -159,11 +159,12 @@ contract Semaphore is ISemaphore, SemaphoreGroups {
159
159
}
160
160
161
161
return
162
- verifiers[merkleTreeDepth - 1 ] .verifyProof (
162
+ verifier .verifyProof (
163
163
[proof[0 ], proof[1 ]],
164
164
[[proof[2 ], proof[3 ]], [proof[4 ], proof[5 ]]],
165
165
[proof[6 ], proof[7 ]],
166
- [merkleTreeRoot, nullifier, _hash (message), _hash (scope)]
166
+ [merkleTreeRoot, nullifier, _hash (message), _hash (scope)],
167
+ merkleTreeDepth
167
168
);
168
169
}
169
170
0 commit comments