@semaphore-protocol/contracts 3.1.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/base/Pairing.sol +7 -7
- package/package.json +35 -34
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
🔎 Issues
|
|
35
35
|
</a>
|
|
36
36
|
<span> | </span>
|
|
37
|
-
<a href="https://
|
|
37
|
+
<a href="https://semaphore.appliedzkp.org/discord">
|
|
38
38
|
🗣️ Chat & Support
|
|
39
39
|
</a>
|
|
40
40
|
</h4>
|
|
@@ -111,6 +111,9 @@ If you want to deploy your contract in a specific network you can set up the `DE
|
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
113
|
yarn deploy:semaphore --network goerli
|
|
114
|
+
yarn deploy:semaphore --network sepolia
|
|
115
|
+
yarn deploy:semaphore --network mumbai
|
|
116
|
+
yarn deploy:semaphore --network optimism-goerli
|
|
114
117
|
yarn deploy:semaphore --network arbitrum
|
|
115
118
|
```
|
|
116
119
|
|
package/base/Pairing.sol
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
pragma solidity ^0.8.4;
|
|
10
10
|
|
|
11
11
|
library Pairing {
|
|
12
|
-
error
|
|
12
|
+
error InvalidProof();
|
|
13
13
|
|
|
14
14
|
// The prime q in the base field F_q for G1
|
|
15
15
|
uint256 constant BASE_MODULUS = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
|
|
@@ -56,7 +56,7 @@ library Pairing {
|
|
|
56
56
|
|
|
57
57
|
// Validate input or revert
|
|
58
58
|
if (p.X >= BASE_MODULUS || p.Y >= BASE_MODULUS) {
|
|
59
|
-
revert
|
|
59
|
+
revert InvalidProof();
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// We know p.Y > 0 and p.Y < BASE_MODULUS.
|
|
@@ -82,7 +82,7 @@ library Pairing {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
if (!success) {
|
|
85
|
-
revert
|
|
85
|
+
revert InvalidProof();
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -92,7 +92,7 @@ library Pairing {
|
|
|
92
92
|
// By EIP-196 the values p.X and p.Y are verified to less than the BASE_MODULUS and
|
|
93
93
|
// form a valid point on the curve. But the scalar is not verified, so we do that explicitelly.
|
|
94
94
|
if (s >= SCALAR_MODULUS) {
|
|
95
|
-
revert
|
|
95
|
+
revert InvalidProof();
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
uint256[3] memory input;
|
|
@@ -109,7 +109,7 @@ library Pairing {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
if (!success) {
|
|
112
|
-
revert
|
|
112
|
+
revert InvalidProof();
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -120,7 +120,7 @@ library Pairing {
|
|
|
120
120
|
// By EIP-197 all input is verified to be less than the BASE_MODULUS and form elements in their
|
|
121
121
|
// respective groups of the right order.
|
|
122
122
|
if (p1.length != p2.length) {
|
|
123
|
-
revert
|
|
123
|
+
revert InvalidProof();
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
uint256 elements = p1.length;
|
|
@@ -145,7 +145,7 @@ library Pairing {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
if (!success || out[0] != 1) {
|
|
148
|
-
revert
|
|
148
|
+
revert InvalidProof();
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
}
|
package/package.json
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
2
|
+
"name": "@semaphore-protocol/contracts",
|
|
3
|
+
"version": "3.2.1",
|
|
4
|
+
"description": "Semaphore contracts to manage groups and broadcast anonymous signals.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"Semaphore.sol",
|
|
8
|
+
"**/*.sol"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"blockchain",
|
|
12
|
+
"ethereum",
|
|
13
|
+
"hardhat",
|
|
14
|
+
"smart-contracts",
|
|
15
|
+
"semaphore",
|
|
16
|
+
"identity",
|
|
17
|
+
"solidity",
|
|
18
|
+
"zero-knowledge",
|
|
19
|
+
"zk-snarks",
|
|
20
|
+
"zero-knowledge-proofs",
|
|
21
|
+
"circom",
|
|
22
|
+
"proof-of-membership"
|
|
23
|
+
],
|
|
24
|
+
"repository": "https://github.com/semaphore-protocol/semaphore",
|
|
25
|
+
"homepage": "https://github.com/semaphore-protocol/semaphore/tree/main/packages/contracts",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/semaphore-protocol/semaphore.git/issues"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@openzeppelin/contracts": "4.7.3",
|
|
34
|
+
"@zk-kit/incremental-merkle-tree.sol": "1.3.3"
|
|
35
|
+
}
|
|
36
|
+
}
|