Skip to content

Commit

Permalink
chore(contracts): remove sub() from gas() in staticcall at SemaphoreV…
Browse files Browse the repository at this point in the history
…erifier

re #871
  • Loading branch information
jimmychu0807 committed Oct 23, 2024
1 parent 82cdc60 commit 31f891b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/contracts/contracts/base/SemaphoreVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ contract SemaphoreVerifier {
mstore(add(mIn, 32), y)
mstore(add(mIn, 64), s)

success := staticcall(sub(gas(), 2000), 7, mIn, 96, mIn, 64)
success := staticcall(gas(), 7, mIn, 96, mIn, 64)

if iszero(success) {
mstore(0, 0)
Expand All @@ -69,7 +69,7 @@ contract SemaphoreVerifier {
mstore(add(mIn, 64), mload(pR))
mstore(add(mIn, 96), mload(add(pR, 32)))

success := staticcall(sub(gas(), 2000), 6, mIn, 128, pR, 64)
success := staticcall(gas(), 6, mIn, 128, pR, 64)

if iszero(success) {
mstore(0, 0)
Expand Down Expand Up @@ -149,7 +149,7 @@ contract SemaphoreVerifier {
mstore(add(_pPairing, 704), mload(add(vkPoints, 64)))
mstore(add(_pPairing, 736), mload(add(vkPoints, 96)))

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

isOk := and(success, mload(_pPairing))
}
Expand Down

0 comments on commit 31f891b

Please sign in to comment.