Skip to content

Commit

Permalink
refactor(contracts): fix eslint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cedoor committed Jan 12, 2024
1 parent 7e69ffd commit bd02535
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions packages/contracts/contracts/Semaphore.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

import "./interfaces/ISemaphore.sol";
import "./interfaces/ISemaphoreVerifier.sol";
import {ISemaphore} from "./interfaces/ISemaphore.sol";
import {ISemaphoreVerifier} from "./interfaces/ISemaphoreVerifier.sol";
import {SemaphoreGroups} from "./base/SemaphoreGroups.sol";

/// @title Semaphore
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/base/SemaphoreGroups.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

import "../interfaces/ISemaphoreGroups.sol";
import {ISemaphoreGroups} from "../interfaces/ISemaphoreGroups.sol";
import {InternalLeanIMT, LeanIMTData} from "@zk-kit/imt.sol/internal/InternalLeanIMT.sol";

/// @title Semaphore groups contract.
Expand Down
62 changes: 31 additions & 31 deletions packages/contracts/contracts/base/SemaphoreVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,63 +18,63 @@
along with snarkJS. If not, see <https://www.gnu.org/licenses/>.
*/

pragma solidity >=0.7.0 <0.9.0;
pragma solidity 0.8.4;

contract SemaphoreVerifier {
// Scalar field size
uint256 constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
uint256 public constant r = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
// Base field size
uint256 constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
uint256 public constant q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;

// Verification Key data
uint256 constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
uint256 constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;
uint256 public constant alphax = 20491192805390485299153009773594534940189261866228447918068658471970481763042;
uint256 public constant alphay = 9383485363053290200918347156157836566562967994039712273449902621266178545958;

uint256 constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
uint256 constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;
uint256 public constant betax1 = 4252822878758300859123897981450591353533073413197771768651442665752259397132;
uint256 public constant betax2 = 6375614351688725206403948262868962793625744043794305715222011528459656738731;

uint256 constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
uint256 constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;
uint256 public constant betay1 = 21847035105528745403288232691147584728191162732299865338377159692350059136679;
uint256 public constant betay2 = 10505242626370262277552901082094356697409835680220590971873171140371331206856;

uint256 constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
uint256 public constant gammax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
uint256 public constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;

uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
uint256 constant gammay2 = 8495653923123431417604973247489272438418190587263600148770280649306958101930;
uint256 public constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
uint256 public constant gammay2 = 8495653923123431417604973247489272438418190587263600148770280649306958101930;

uint256 constant deltax1 = 4802212656094790438590349860247775075786991105131547807727284652635601493451;
uint256 constant deltax2 = 3192001579163161965737706068451660722884189926734050314177195054150514444526;
uint256 public constant deltax1 = 4802212656094790438590349860247775075786991105131547807727284652635601493451;
uint256 public constant deltax2 = 3192001579163161965737706068451660722884189926734050314177195054150514444526;

uint256 constant deltay1 = 15972350841447731019470651411783473840114797777894828544121644904018624203926;
uint256 constant deltay2 = 16736984041748862942817824193402022794140982482563484226161429255394796148810;
uint256 public constant deltay1 = 15972350841447731019470651411783473840114797777894828544121644904018624203926;
uint256 public constant deltay2 = 16736984041748862942817824193402022794140982482563484226161429255394796148810;

uint256 constant IC0x = 7810627885438804854799393101615420860004300484567847086674409667961806655819;
uint256 constant IC0y = 17752894058911463947056561254031971003439956976683150238952280384884265610345;
uint256 public constant IC0x = 7810627885438804854799393101615420860004300484567847086674409667961806655819;
uint256 public constant IC0y = 17752894058911463947056561254031971003439956976683150238952280384884265610345;

uint256 constant IC1x = 1859027844886249956101358092211425783821368393550326618436626137559481879491;
uint256 constant IC1y = 21054817398797605484546956719908640544118839476669181800056403255004730797738;
uint256 public constant IC1x = 1859027844886249956101358092211425783821368393550326618436626137559481879491;
uint256 public constant IC1y = 21054817398797605484546956719908640544118839476669181800056403255004730797738;

uint256 constant IC2x = 15796976765804300435452771769828280808531244272386620395606681167033336150695;
uint256 constant IC2y = 903968937841233929826399002238948203245370749106069849010375461873649600286;
uint256 public constant IC2x = 15796976765804300435452771769828280808531244272386620395606681167033336150695;
uint256 public constant IC2y = 903968937841233929826399002238948203245370749106069849010375461873649600286;

uint256 constant IC3x = 9939447176137952809861441974771884976492003509733419789700227062163769465749;
uint256 constant IC3y = 10252048733134373819769164658668132695840284406808712977431939424744406823235;
uint256 public constant IC3x = 9939447176137952809861441974771884976492003509733419789700227062163769465749;
uint256 public constant IC3y = 10252048733134373819769164658668132695840284406808712977431939424744406823235;

uint256 constant IC4x = 7393464059707248328549959352154443030400062088967711800345697753542770722400;
uint256 constant IC4y = 7750652018971809526357985723000957185438256496025176410178561237545956517939;
uint256 public constant IC4x = 7393464059707248328549959352154443030400062088967711800345697753542770722400;
uint256 public constant IC4y = 7750652018971809526357985723000957185438256496025176410178561237545956517939;

// Memory data
uint16 constant pVk = 0;
uint16 constant pPairing = 128;
uint16 public constant pVk = 0;
uint16 public constant pPairing = 128;

uint16 constant pLastMem = 896;
uint16 public constant pLastMem = 896;

function verifyProof(
uint[2] calldata _pA,
uint[2][2] calldata _pB,
uint[2] calldata _pC,
uint[4] calldata _pubSignals
) public view returns (bool) {
) external view returns (bool) {
assembly {
function checkField(v) {
if iszero(lt(v, q)) {
Expand Down

0 comments on commit bd02535

Please sign in to comment.