Skip to content

Commit ea987b9

Browse files
committed
chore(contracts): remove sub() from gas() in staticcall at SemaphoreVerifier
re semaphore-protocol#871
1 parent caebc1a commit ea987b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/contracts/contracts/base/SemaphoreVerifier.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ contract SemaphoreVerifier {
5959
mstore(add(mIn, 32), y)
6060
mstore(add(mIn, 64), s)
6161

62-
success := staticcall(sub(gas(), 2000), 7, mIn, 96, mIn, 64)
62+
success := staticcall(gas(), 7, mIn, 96, mIn, 64)
6363

6464
if iszero(success) {
6565
mstore(0, 0)
@@ -69,7 +69,7 @@ contract SemaphoreVerifier {
6969
mstore(add(mIn, 64), mload(pR))
7070
mstore(add(mIn, 96), mload(add(pR, 32)))
7171

72-
success := staticcall(sub(gas(), 2000), 6, mIn, 128, pR, 64)
72+
success := staticcall(gas(), 6, mIn, 128, pR, 64)
7373

7474
if iszero(success) {
7575
mstore(0, 0)
@@ -149,7 +149,7 @@ contract SemaphoreVerifier {
149149
mstore(add(_pPairing, 704), mload(add(vkPoints, 64)))
150150
mstore(add(_pPairing, 736), mload(add(vkPoints, 96)))
151151

152-
let success := staticcall(sub(gas(), 2000), 8, _pPairing, 768, _pPairing, 0x20)
152+
let success := staticcall(gas(), 8, _pPairing, 768, _pPairing, 0x20)
153153

154154
isOk := and(success, mload(_pPairing))
155155
}

0 commit comments

Comments
 (0)