Skip to content

Commit 3188d3d

Browse files
authored
Merge pull request #180 from semaphore-protocol/refactor/group-id
No SNARK restrictions for Group IDs Former-commit-id: 27320f1
2 parents 066f38c + 04f57db commit 3188d3d

File tree

6 files changed

+1
-31
lines changed

6 files changed

+1
-31
lines changed

packages/contracts/contracts/base/SemaphoreConstants.sol

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

packages/contracts/contracts/base/SemaphoreGroups.sol

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//SPDX-License-Identifier: MIT
22
pragma solidity 0.8.4;
33

4-
import {SNARK_SCALAR_FIELD} from "./SemaphoreConstants.sol";
54
import "../interfaces/ISemaphoreGroups.sol";
65
import "@zk-kit/incremental-merkle-tree.sol/IncrementalBinaryTree.sol";
76
import "@openzeppelin/contracts/utils/Context.sol";
@@ -24,10 +23,6 @@ abstract contract SemaphoreGroups is Context, ISemaphoreGroups {
2423
uint256 merkleTreeDepth,
2524
uint256 zeroValue
2625
) internal virtual {
27-
if (groupId >= SNARK_SCALAR_FIELD) {
28-
revert Semaphore__GroupIdIsNotLessThanSnarkScalarField();
29-
}
30-
3126
if (getMerkleTreeDepth(groupId) != 0) {
3227
revert Semaphore__GroupAlreadyExists();
3328
}

packages/contracts/contracts/base/SemaphoreVerifier.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
pragma solidity 0.8.4;
33

44
import "../interfaces/ISemaphoreVerifier.sol";
5-
import "./SemaphoreConstants.sol";
65

76
/// @title Semaphore verifier contract.
87
/// @notice Minimal code to allow users to verify their Semaphore proofs.

packages/contracts/test/SemaphoreVoting.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ describe("SemaphoreVoting", () => {
3636
await expect(transaction).to.be.revertedWith("Semaphore__MerkleTreeDepthIsNotSupported()")
3737
})
3838

39-
it("Should not create a poll greater than the snark scalar field", async () => {
40-
const transaction = contract.createPoll(
41-
BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495618"),
42-
coordinator,
43-
treeDepth
44-
)
45-
46-
await expect(transaction).to.be.revertedWith("Semaphore__GroupIdIsNotLessThanSnarkScalarField()")
47-
})
48-
4939
it("Should create a poll", async () => {
5040
const transaction = contract.createPoll(pollIds[0], coordinator, treeDepth)
5141

packages/contracts/test/SemaphoreWhistleblowing.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,6 @@ describe("SemaphoreWhistleblowing", () => {
3434
await expect(transaction).to.be.revertedWith("Semaphore__MerkleTreeDepthIsNotSupported()")
3535
})
3636

37-
it("Should not create an entity greater than the snark scalar field", async () => {
38-
const transaction = contract.createEntity(
39-
BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495618"),
40-
editor,
41-
treeDepth
42-
)
43-
44-
await expect(transaction).to.be.revertedWith("Semaphore__GroupIdIsNotLessThanSnarkScalarField()")
45-
})
46-
4737
it("Should create an entity", async () => {
4838
const transaction = contract.createEntity(entityIds[0], editor, treeDepth)
4939

yarn.lock.REMOVED.git-id

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ade939691dcd569b1afd17037512c05544cb453a
1+
d5e764e1df1ee8a4de266237c73e44074450106d

0 commit comments

Comments
 (0)