Skip to content

Commit

Permalink
fix(zupass-gatekeeper): event id was stored at the wrong index (#1836)
Browse files Browse the repository at this point in the history
Co-authored-by: Crisgarner <@crisgarner>
  • Loading branch information
crisgarner authored Sep 25, 2024
1 parent f9ac844 commit d5bc146
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ contract ZupassGatekeeper is SignUpGatekeeper, Ownable(msg.sender) {
// Verify proof
if (!verifier.verifyProof(_pA, _pB, _pC, _pubSignals)) revert InvalidProof();

// Event id is stored at index 15
if (_pubSignals[15] != validEventId) revert InvalidEventId();
// Event id is stored at index 1
if (_pubSignals[1] != validEventId) revert InvalidEventId();

// Signers are stored at index 13 and 14
if (_pubSignals[13] != validSigner1 || _pubSignals[14] != validSigner2) revert InvalidSigners();
Expand Down
13 changes: 7 additions & 6 deletions packages/contracts/tests/ZupassGatekeeper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ describe("Zupass Gatekeeper", () => {

const user = new Keypair();

// ETHBerlin 4 event setup for 0x627306090abaB3A6e1400e9345bC60c78a8BEf57 address (default signer)
// Zupass proof created for 0x627306090abaB3A6e1400e9345bC60c78a8BEf57 address (default signer)
const data =
"0x26c0c2afcf93e0c18ddab29e1d046b550b6c142bcbb8bf7abf0a1b86389a46c21d7af6d964ca33399f01f8e0e5bf5b6f9771f07b6c8db0216dc41ef57db4fe5e09254849fadccfb1889e94946ff4845803e5d23f7cf3c2495af5551fa74171e225776c6bf746cdf27021d05f98e019c1ef20a2b0c1d7bd370893da152e91617b00a60e0d752953f863b253e0686cf1760307ddc542ebb7646b3abb84d56924402ec059de1e138b2869456633a6908d9f195ed75146d355275709a914c74c26ff07f4d30917007e9d95d0d52586d40392848588fe65c1386a6c75c846dd479f1c19b05ade4571f1cdd2a0017b281a767dc4533976891160a9e6b312a883b2aec6000000000000000000000000000000001ae3463162dc5ba99d9e01602c18d96f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000000010ef63ac10e10e307f558470b38753eef9190c3843254bbb60292905e4021801ebfb986fbac5113f8e2c72286fe9362f8e7d211dbc68227a468d7b919e7500310ec38f11baacad5535525bbe8e343074a483c051aa1616266f3b1df3fb7d2040000000000000000000000000000000053edb3e7673341e0a9be488877c5c57230644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000627306090abab3a6e1400e9345bc60c78a8bef57000000000000000000000000627306090abab3a6e1400e9345bc60c78a8bef57";
"0x1d31414b4ccd818b4fae03a1be1d346f594805f8130ff53b4ff3b995b6d097e6179ea78a39307687593520021abcaf16d295e6827de178614fe10a88f053eedb00a9fad3f1d903c00469dba58434dd42fcb9f1f8de968ae5a8c2d33f4b23000e1dac49110056035d685cd6a06139241e127f9d2ce399db85a0df7ad5c6bf19eb17e96f2ff84444bcf4733d4137b3b22b31117389a240945e1db5437ea021d2461368a7339ab1ff0dac46c871c402d34f97a501721303f76b748f44bf25e492cd01e6fbb34ee1ac3b91d9ed4b170c7ee582bf12bfc463c5a92952421b258044982dcc85ea4601e681433e8246f4958b60fd1a785baf03c7ca5f4b84243564ae93000000000000000000000000000000001bcd6ba8183859918e10a47e8f46420c00000000000000000000000000000000d2ce5bb299a35a61b7e61cd46d2ee00d30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000000225132f1b9a3fc82364402e652b4c4dd140d74e4bd726011248ad8dacbc687ac1ebfb986fbac5113f8e2c72286fe9362f8e7d211dbc68227a468d7b919e7500310ec38f11baacad5535525bbe8e343074a483c051aa1616266f3b1df3fb7d20430644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000627306090abab3a6e1400e9345bc60c78a8bef57000000000000000000000000627306090abab3a6e1400e9345bc60c78a8bef57";
// Zupass proof created for another address
const dataWithInvalidWatermark =
"0x0c6c75cffbdaf232302db8a64825e8f3325538ee130b75e68b451d87c471642a231ff0c0556aaf4c951943bd093cee59805017bafa25aa8d90de1fff79ad02be1533eb18a35a54037afe3f98fb7a3e0ec7154c285f43c7aae307ef4910bacba312a7ab261e963b05a7ec3f82fca280a94d7103e2229c9fef004ac66aaa13ea7a26162d6f0f602c843ff9442d8b5af0d90090b93ac36eaa349db07509c0501e711cad5b79ca9bf07f3a57896a118ad82890833cb2491a6bf3b929ccb5e30be41809457222cccc6405701acafdac0f62687e7944e21fb5b8641fbf8e2a02a12bb12a3a8459d26c86fb10e18bc1972064f3f22a187762693b361012443e20fe22d0000000000000000000000000000000001ae3463162dc5ba99d9e01602c18d96f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000000f0bfa9b3b55358ffc5ebdef847df1c68327f76cd4e041d47248999cb142b33d1ebfb986fbac5113f8e2c72286fe9362f8e7d211dbc68227a468d7b919e7500310ec38f11baacad5535525bbe8e343074a483c051aa1616266f3b1df3fb7d2040000000000000000000000000000000053edb3e7673341e0a9be488877c5c57230644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266";
// ETHBerlin 4 event UUID converted to bigint
const validEventId = "111560146890584288369567824893314450802";
// ETHBerlin 4 event signer converted to bigint
"0x000b867d17d610de911605a3386d350e86cd5339eac83bbc85fe9c028e08c543156471a4f5ffddea23aca5a70fd890dc09fe797a0e354b73b44fe344c0a2a0672c81710290ca139c7a5d7399016423d37bbe35af644320ecc822e1df6507e58200894e191db1d4f18726043353d7084b7c390ad04c03f6bad3590c9a8b7a9f6d0b60ec311c69cc7f40de5fe862d01518fb7a8bf95320364a86fb653dc79f3fec10eab1df46eda1bc2147b75ee05f3d4a16c97e0d6bc0f7a7c3f5f5281428435014569d5180d2f0f824382deda44cfe18334cba7ded3f0516b09b10274c8a5ced148e8e582e421247fb2e183783e72c20f5d2a19d639550d9a014a894615572b5000000000000000000000000000000001bcd6ba8183859918e10a47e8f46420c00000000000000000000000000000000d2ce5bb299a35a61b7e61cd46d2ee00d30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000005f78379d23c237432399422bd02907a5cebebdc003a46f86a021361ebf095591ebfb986fbac5113f8e2c72286fe9362f8e7d211dbc68227a468d7b919e7500310ec38f11baacad5535525bbe8e343074a483c051aa1616266f3b1df3fb7d20430644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000030644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cbc8a82e3dfc6faa2506f3033271ebc7447f096b000000000000000000000000cbc8a82e3dfc6faa2506f3033271ebc7447f096b";
// Zupass event UUID converted to bigint
const validEventId = "280209352117126055869169359893920931853";
// Zupass signer converted to bigint
const zupassSigner = [
"13908133709081944902758389525983124100292637002438232157513257158004852609027",
"7654374482676219729919246464135900991450848628968334062174564799457623790084",
Expand Down

0 comments on commit d5bc146

Please sign in to comment.