@semaphore-protocol/contracts 4.4.2 → 4.6.0
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/Semaphore.sol +1 -1
- package/base/Constants.sol +1 -1
- package/base/SemaphoreGroups.sol +1 -1
- package/base/SemaphoreVerifier.sol +13 -4
- package/base/SemaphoreVerifierKeyPts.sol +1 -1
- package/interfaces/ISemaphore.sol +1 -1
- package/interfaces/ISemaphoreGroups.sol +1 -1
- package/interfaces/ISemaphoreVerifier.sol +1 -1
- package/package.json +1 -1
package/Semaphore.sol
CHANGED
package/base/Constants.sol
CHANGED
package/base/SemaphoreGroups.sol
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
// Part of this file was generated with [snarkJS](https://github.com/iden3/snarkjs).
|
|
3
3
|
|
|
4
|
-
pragma solidity 0.8.23;
|
|
4
|
+
pragma solidity >=0.8.23 <=0.8.28;
|
|
5
5
|
|
|
6
6
|
import {MAX_DEPTH} from "./Constants.sol";
|
|
7
7
|
import {SemaphoreVerifierKeyPts} from "./SemaphoreVerifierKeyPts.sol";
|
|
@@ -59,7 +59,10 @@ contract SemaphoreVerifier {
|
|
|
59
59
|
mstore(add(mIn, 32), y)
|
|
60
60
|
mstore(add(mIn, 64), s)
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
// ecMul gas cost is fixed at 6000. Add 33.3% gas for safety buffer.
|
|
63
|
+
// Last checked in 2024 Oct, evm codename Cancun
|
|
64
|
+
// ref: https://www.evm.codes/precompiled?fork=cancun#0x07
|
|
65
|
+
success := staticcall(8000, 7, mIn, 96, mIn, 64)
|
|
63
66
|
|
|
64
67
|
if iszero(success) {
|
|
65
68
|
mstore(0, 0)
|
|
@@ -69,7 +72,10 @@ contract SemaphoreVerifier {
|
|
|
69
72
|
mstore(add(mIn, 64), mload(pR))
|
|
70
73
|
mstore(add(mIn, 96), mload(add(pR, 32)))
|
|
71
74
|
|
|
72
|
-
|
|
75
|
+
// ecAdd gas cost is fixed at 150. Add 33.3% gas for safety buffer.
|
|
76
|
+
// Last checked in 2024 Oct, evm codename Cancun
|
|
77
|
+
// ref: https://www.evm.codes/precompiled?fork=cancun#0x06
|
|
78
|
+
success := staticcall(200, 6, mIn, 128, pR, 64)
|
|
73
79
|
|
|
74
80
|
if iszero(success) {
|
|
75
81
|
mstore(0, 0)
|
|
@@ -149,7 +155,10 @@ contract SemaphoreVerifier {
|
|
|
149
155
|
mstore(add(_pPairing, 704), mload(add(vkPoints, 64)))
|
|
150
156
|
mstore(add(_pPairing, 736), mload(add(vkPoints, 96)))
|
|
151
157
|
|
|
152
|
-
|
|
158
|
+
// ecPairing gas cost at 181000 given 768 bytes input. Add 33.3% gas for safety buffer.
|
|
159
|
+
// Last checked in 2024 Oct, evm codename Cancun
|
|
160
|
+
// ref: https://www.evm.codes/precompiled?fork=cancun#0x08
|
|
161
|
+
let success := staticcall(241333, 8, _pPairing, 768, _pPairing, 0x20)
|
|
153
162
|
|
|
154
163
|
isOk := and(success, mload(_pPairing))
|
|
155
164
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
// Part of this file was generated with [snarkJS](https://github.com/iden3/snarkjs).
|
|
3
|
-
pragma solidity 0.8.23;
|
|
3
|
+
pragma solidity >=0.8.23 <=0.8.28;
|
|
4
4
|
|
|
5
5
|
library SemaphoreVerifierKeyPts {
|
|
6
6
|
error Semaphore__VKPtBytesMaxDepthInvariantViolated(uint256 actual, uint256 expected);
|