Compare commits

...

786 Commits

Author SHA1 Message Date
cedoor
9d24c8184a chore: v3.11.0
Former-commit-id: 478e6fa382
2023-08-21 16:24:13 +02:00
cedoor
ae359322e9 test(data): add test for identityCommitment filter
Former-commit-id: 7a07dda628
2023-08-21 16:23:10 +02:00
Cedoor
33998d90f7 Merge pull request #346 from semaphore-protocol/chore/snarkjs-version
New snarkjs version

Former-commit-id: 44acbf806f
2023-08-21 16:13:47 +02:00
Cedoor
d9de7c1033 Merge pull request #347 from semaphore-protocol/refactor/proof-exports
`MerkleProof` type to exports

Former-commit-id: ac555f59a1
2023-08-21 16:13:37 +02:00
cedoor
120f99b416 refactor(proof): add MerkleProof type to exports
re #337


Former-commit-id: 8afa314891
2023-08-21 13:24:16 +02:00
Cedoor
b95cb17135 Merge pull request #338 from wslyvh/main
New filter option to query groups based on identity commitment

Former-commit-id: 7467aac9e7
2023-08-21 13:18:51 +02:00
cedoor
507c252d36 chore(proof): update snarkjs version
re #339


Former-commit-id: 82ad9a543b
2023-08-21 13:17:33 +02:00
wslyvh
82db6a1eb7 feat: add identitycommitment as groups filter
Allow to filter on identity commitments when getting subgraph groups


Former-commit-id: 369257d40b
2023-08-14 10:05:19 +02:00
cedoor
c60ab38882 docs: add new project to readme file
Former-commit-id: 7d26d4e66c
2023-08-02 12:00:53 +02:00
Cedoor
cba5940f36 Merge pull request #336 from semaphore-protocol/docs/add-project
Add StealthComms to the projects file

Former-commit-id: e5bcd18045
2023-08-02 11:57:42 +02:00
vplasencia
110e3de844 docs: change tagline
Former-commit-id: 763663ca3e
2023-08-02 10:47:09 +02:00
vplasencia
f60e85335d docs: fix typo
Former-commit-id: a786f10ba5
2023-08-02 10:40:06 +02:00
vplasencia
ef4cef65cd docs: fix typo
Former-commit-id: 44177ce5b7
2023-08-02 10:35:07 +02:00
vplasencia
f69534683d docs: add a new project to the projects file
Former-commit-id: 8552640cd0
2023-08-02 10:25:25 +02:00
cedoor
4d849b48c2 chore: v3.10.1
Former-commit-id: 41181c63d2
2023-05-17 10:56:59 +01:00
cedoor
531e16e0d7 fix(group): make members bigint types
Former-commit-id: d1d309ac3a
2023-05-17 10:46:40 +01:00
Cedoor
f2575f2bec Merge pull request #324 from semaphore-protocol/feat/is-member
New function to check if a member exists

Former-commit-id: e783465dc2
2023-05-15 15:50:18 +01:00
cedoor
3bfc7ce2bc style(data): format code with prettier
Former-commit-id: 2b430dace0
2023-05-15 15:43:50 +01:00
cedoor
ef88c9c84c feat(data): create function to check if a member exists
re #321


Former-commit-id: 9d7076acc7
2023-05-15 15:35:53 +01:00
Cedoor
6580b6620f Merge pull request #322 from semaphore-protocol/feat/init-members
New class parameter to add members

Former-commit-id: 5915ea082b
2023-05-15 12:59:46 +01:00
cedoor
42d33e2af7 feat(group): add new class parameter to add members
re #319


Former-commit-id: ed015ccc83
2023-05-15 12:46:44 +01:00
Cedoor
594c612318 Merge pull request #316 from semaphore-protocol/docs/update-readme-data-package
Update readme file in data package

Former-commit-id: 0ee1fa2b72
2023-05-02 09:46:50 +01:00
vplasencia
fbfa92023d docs(data): update readme file
Former-commit-id: 594daba6cc
2023-05-01 20:58:00 +02:00
cedoor
caed0aecc1 test(data): add test for new function
Former-commit-id: 0cb0ef3514
2023-04-28 12:32:30 +01:00
cedoor
7bcc44c645 chore: v3.9.0
Former-commit-id: 900da9cef5
2023-04-28 12:27:48 +01:00
Cedoor
0ac390eaf0 Merge pull request #315 from semaphore-protocol/feat/subgraph
Sepolia subgraph & supported networks

Former-commit-id: f50a16054b
2023-04-28 11:33:57 +01:00
cedoor
5db4c61c28 feat(data): provide function to get supported networks
re #314


Former-commit-id: 5e033556fb
2023-04-27 16:04:20 +01:00
cedoor
37dc17d880 feat(data): add sepolia subgraph support
Former-commit-id: 92a6a7a354
2023-04-27 16:03:54 +01:00
cedoor
a04057f861 chore: v3.8.0
Former-commit-id: 736bddbd83
2023-04-26 15:34:48 +01:00
Cedoor
29e8f5852f Merge pull request #312 from semaphore-protocol/feat/nullifier-hash
New function to calculate nullifier hash

Former-commit-id: 946ac8333c
2023-04-26 15:20:20 +01:00
Cedoor
26c76f453e Merge pull request #313 from 0xdeenz/main
chore: add Block Qualified to list of projects
Former-commit-id: 37951ff29e
2023-04-26 12:43:24 +01:00
cedoor
9a1a1e7853 docs: update package docs links
Former-commit-id: 8ff372ef35
2023-04-26 12:37:09 +01:00
cedoor
f583caa243 ci(github): add semaphore js cname
Former-commit-id: 9a24d36c0b
2023-04-26 12:25:20 +01:00
0xdeenz
b399b923ab chore: add Block Qualified to list of projects
Former-commit-id: dc7e0a1d0b
2023-04-25 20:04:37 +02:00
Cedoor
65e5d29dcd docs(proof): update README.md
Former-commit-id: 3f1432c8b9
2023-04-22 17:28:06 +01:00
cedoor
ba9782139e feat(proof): add function to calculate nullifier hash
Former-commit-id: 6cc2b6af1c
2023-04-22 17:23:52 +01:00
Cedoor
edef368976 Merge pull request #311 from semaphore-protocol/ref/cli
Update get-proofs description

Former-commit-id: 10024bced9
2023-04-22 10:42:14 +01:00
vplasencia
77fddc9b16 docs(cli): update the description of get-proofs command in the readme file
Former-commit-id: d151998013
2023-04-22 09:26:21 +02:00
vplasencia
69b2b8fd7b refactor(cli): update get-proofs description
Former-commit-id: eb63447166
2023-04-22 09:19:54 +02:00
cedoor
aba7d51f86 chore: v3.7.0
Former-commit-id: 22f33a8f26
2023-04-20 11:28:32 +01:00
Cedoor
32d1b47964 Merge pull request #310 from semaphore-protocol/docs/cli
Update the Readme file to add the new CLI commands

Former-commit-id: faf7ff9c18
2023-04-20 11:20:02 +01:00
vplasencia
cb3ff0fcb8 docs(cli): update the readme file to add the new commands
Former-commit-id: e7ceb37503
2023-04-20 10:15:51 +02:00
Cedoor
4d4338d3bc Merge pull request #309 from semaphore-protocol/chore/community-projects
Semaphore projects

Former-commit-id: f0574c4c40
2023-04-19 12:21:20 +01:00
cedoor
536410457e chore: add some projects
Former-commit-id: 3ee4cebd35
2023-04-19 12:08:58 +01:00
Cedoor
7469086a2a docs: add section for semaphore projects
Former-commit-id: 37bbdb4dc0
2023-04-19 12:06:29 +01:00
cedoor
3496aa6478 chore: update issue template to add projects
Former-commit-id: 10909c63c4
2023-04-19 11:28:16 +01:00
cedoor
60d5110905 chore: create json for community projects
Former-commit-id: b98bdb3a1d
2023-04-19 11:27:49 +01:00
Cedoor
0da64796ea Merge pull request #306 from vimwitch/bump-poseidon-lite
chore: bump poseidon-lite minor version
Former-commit-id: 617bb364ae
2023-04-19 10:43:56 +02:00
Chance
41ab36d24c chore: bump poseidon-lite minor version
Former-commit-id: 9f9ec7054b
2023-04-19 00:47:13 -05:00
vplasencia
6bcd77fe5b chore: vv3.6.0
Former-commit-id: c52f0036da
2023-04-11 19:49:21 +02:00
vplasencia
4a221a43c7 refactor(cli): copy the contents of the .env.example file to a new .env file
Former-commit-id: 74c2ed1b3a
2023-04-11 14:01:28 +02:00
vplasencia
37465288a7 refactor(cli): set the monorepo-ethers template as default when creating a project
Former-commit-id: 27ba252565
2023-04-11 13:48:59 +02:00
vplasencia
c38b3c5255 chore: v3.6.0-beta.4
Former-commit-id: aabad74de7
2023-04-11 11:43:15 +02:00
vplasencia
dba7a6ca85 chore: v3.6.0-beta.3
Former-commit-id: e17737d894
2023-04-07 19:36:36 +02:00
vplasencia
468a3314e3 fix(cli): update package.json file in monorepos with correct package names
Former-commit-id: c4f3565546
2023-04-07 19:10:11 +02:00
vplasencia
a80b1136cd chore: v3.6.0-beta.2
Former-commit-id: fe8a48be0d
2023-04-07 17:37:11 +02:00
vplasencia
44328f1893 chore(cli): create a script to remove unnecessary files in monorepo templates
Former-commit-id: 02658c0780
2023-04-07 17:28:18 +02:00
vplasencia
a0c1c27c35 refactor(cli): add the next-env.d.ts file to gitignore
Former-commit-id: 02d1395828
2023-04-07 14:12:53 +02:00
vplasencia
f6be176df9 chore: v3.6.0-beta.1
Former-commit-id: 6b9c9c1f28
2023-04-07 12:02:14 +02:00
vplasencia
1a2eb3e18d chore(cli): decompress and then remove the files.tgz file after downloading a template
Former-commit-id: 2467291010
2023-04-07 09:15:52 +02:00
vplasencia
44b25995e0 fix(cli): add gitignore file
Former-commit-id: bd897a6d97
2023-04-06 19:58:23 +02:00
cedoor
f1b3368529 fix(data): check if groups exist before adding members
Former-commit-id: 6e453ff32a
2023-04-06 18:36:05 +01:00
cedoor
5c64b09f51 chore(cli): create prepublish script to compress files
Former-commit-id: 206106ad66
2023-04-06 17:38:56 +01:00
vplasencia
fd08c3f2e7 chore: v3.6.0-beta.0
Former-commit-id: 4996ec1d9f
2023-04-06 15:28:09 +02:00
vplasencia
01fa043b4d chore: add files field in the package.json file in monorepo-ethers and monorepo-subgraph templates
Former-commit-id: 6f381019ff
2023-04-06 14:35:42 +02:00
vplasencia
c10b57e3cf fix(cli): add solhint file in monorepo-ethers and monorepo-subgraph templates
Former-commit-id: 7d4871f858
2023-04-06 14:19:59 +02:00
vplasencia
9a7e053f64 chore: v3.6.0-1
Former-commit-id: 83762718e9
2023-04-05 18:12:31 +02:00
vplasencia
2e6b2d678a chore: remove private from package.json file in templates
Former-commit-id: 36f9b56241
2023-04-05 18:09:04 +02:00
Vivian Plasencia
cf1c039545 Merge pull request #304 from semaphore-protocol/fix/proof-event
Correct `ProofVerified` event parameters

Former-commit-id: 4ec0ba5baa
2023-04-05 17:46:34 +02:00
Vivian Plasencia
0a496e5375 Merge pull request #303 from semaphore-protocol/milestone/semaphore-cli-templates
Add new templates and commands in the CLI

Former-commit-id: 81435b1b7b
2023-04-05 17:45:47 +02:00
cedoor
ff6835d1db chore(data): update subgraph url and contract addresses
re #304


Former-commit-id: db2820e687
2023-04-05 16:04:48 +01:00
cedoor
b350cd4b66 style(contracts): format code with prettier
Former-commit-id: 41a88132c4
2023-04-05 12:37:58 +01:00
cedoor
f4508c4db5 chore(contracts): fresh semaphore contracts deployment
re #298


Former-commit-id: 8a9c42bace
2023-04-05 12:35:11 +01:00
cedoor
2df42d49c0 fix(contracts): set correct ProofVerifier event parameters
fix #297


Former-commit-id: 84813c519a
2023-04-05 11:20:16 +01:00
cedoor
fea6b8446c chore(cli): update monorepo templates semaphore deps
Former-commit-id: 045a2a2c54
2023-04-04 17:07:56 +01:00
cedoor
322051bd3a chore(cli): make monorepo cli templates private
Former-commit-id: 0a3654bfbe
2023-04-04 16:58:32 +01:00
cedoor
6ae1249618 fix: limit some npm scripts to public packages
Former-commit-id: 94bbf40e96
2023-04-04 16:57:56 +01:00
cedoor
8528e9e758 refactor(cli): update template apps' names
Former-commit-id: 58de92a335
2023-04-04 16:36:19 +01:00
vplasencia
9bea6143a6 refactor(cli): change cli template names
Former-commit-id: 84c1dfa486
2023-04-04 16:23:34 +01:00
vplasencia
3b59bf6117 refactor(cli-template-monorepo-subgraph): rename cli hardhat-nextjs-semaphoresubgraph template
Former-commit-id: ee6e1c156d
2023-04-04 16:23:34 +01:00
vplasencia
cecdcc3fb1 refactor(cli-template-monorepo-ethers): rename cli hardhat-nextjs-semaphoreethers template package
Former-commit-id: 1c0d119e60
2023-04-04 16:23:34 +01:00
vplasencia
f57c2b4397 refactor(cli-template-contracts-hardhat): rename the cli hardhat template package
Former-commit-id: e38b040641
2023-04-04 16:23:26 +01:00
vplasencia
47f3651bc5 feat(cli): add inquirer to select a template when creating a project
Former-commit-id: 4d1a637093
2023-04-04 16:22:47 +01:00
vplasencia
8006983643 refactor: ignore .next and public folders
Former-commit-id: 6afb098709
2023-04-04 16:22:22 +01:00
vplasencia
3a7f18652f style: format code with prettier
Former-commit-id: 8475666016
2023-04-04 16:22:22 +01:00
vplasencia
c7a4cf7121 refactor(cli-template-monorepo-subgraph): add yarn.lock file
Former-commit-id: b363ce3955
2023-04-04 16:22:10 +01:00
vplasencia
66aa482b07 refactor(cli-template-monorepo-ethers): remove unused code
Former-commit-id: fcaac9f2e3
2023-04-04 16:20:47 +01:00
vplasencia
b89ed0ebb7 refactor(cli-template-hardhat-nextjs-semaphoresubgraph): remove unused import statement
Former-commit-id: 5dbbdd1b2c
2023-04-04 16:20:19 +01:00
vplasencia
4cf00f33d0 refactor(cli-template-hardhat-nextjs-semaphoresubgraph): remove unused code
Former-commit-id: e5cf466a5f
2023-04-04 16:20:19 +01:00
vplasencia
a3309ab707 feat(cli-template-hardhat-nextjs-semaphoresubgraph): add hardhat-nextjs-semaphoresubgraph template
Former-commit-id: 58310b5e67
2023-04-04 16:20:19 +01:00
vplasencia
30449c4fe7 refactor(cli-template-hardhat-nextjs-semaphoreethers): update package names
Former-commit-id: eb997a8488
2023-04-04 16:20:19 +01:00
vplasencia
6b1f1a8c31 refactor(cli-template-hardhat-nextjs-semaphoreethers): add access public in package.json file
Former-commit-id: abfff13099
2023-04-04 16:20:19 +01:00
vplasencia
70c53b6203 feat(cli-template-hardhat-nextjs-semaphoreethers): add the hardhat-nextjs-semaphoreethers template
Former-commit-id: 53d878ce47
2023-04-04 16:20:19 +01:00
vplasencia
3313be7f38 style(cli): add total of elements in the output of get-groups get-members and get-proofs commands
Former-commit-id: 1b2f6b89fa
2023-04-04 16:20:19 +01:00
vplasencia
240fee73b4 style(cli): change output text of get-proofs command
Former-commit-id: 30f82d917b
2023-04-04 16:20:19 +01:00
vplasencia
7e85c1ddda fix(cli-template-hardhat): set the correct env file path
Former-commit-id: d9b0afbf31
2023-04-04 16:20:19 +01:00
vplasencia
18d724b166 perf(cli): optimize get-proofs command
Former-commit-id: 0b060f97ec
2023-04-04 16:20:19 +01:00
vplasencia
f97a233798 perf(cli): optimize get-members command
Former-commit-id: bb0b58e3f1
2023-04-04 16:20:19 +01:00
vplasencia
e146f3e84e refactor(cli): organize get group ids logic
Former-commit-id: 93e4a5d00b
2023-04-04 16:20:17 +01:00
cedoor
81fba57259 chore(cli): add types packages
re #189


Former-commit-id: 150a4c236b
2023-04-04 16:18:43 +01:00
vplasencia
07515c5068 feat(cli): add checks for template integrity
Former-commit-id: 14e39a101c
2023-04-04 16:18:40 +01:00
vplasencia
ad812f778b refactor(cli): organize inquirer prompts
Former-commit-id: d8ab9092ea
2023-04-04 16:18:00 +01:00
vplasencia
70727203fd feat(cli): split the get-group command to make it easier to query group data
Former-commit-id: 0cbbd9b28f
2023-04-04 16:18:00 +01:00
cedoor
b93acc884b chore: v3.5.0
Former-commit-id: 64a2e010f1
2023-03-31 13:14:48 +01:00
Cedoor
c9e565a445 Merge pull request #295 from semaphore-protocol/feat/identity-getter
New identity secret attribute and getter

Former-commit-id: 2af0af9a22
2023-03-31 12:53:30 +01:00
cedoor
6cea8c5dcc feat(identity): add new identity secret attribute and getter
re #294


Former-commit-id: 99ea3a15bc
2023-03-31 12:20:49 +01:00
Cedoor
5bd7cd93f7 Merge pull request #293 from semaphore-protocol/fix/semaphore-ethers
Correct nullifier hash parameter

Former-commit-id: 1118452cd4
2023-03-28 14:00:04 +01:00
cedoor
da1b4f6d8f fix(data): set correct nullifier hash parameter
Former-commit-id: d36a79e7ab
2023-03-28 12:52:46 +01:00
Cedoor
124f627d39 Merge pull request #292 from mmqxyz/patch-1
docs: fix small typos in Pairing.sol
Former-commit-id: 53963f7cd4
2023-03-28 11:01:50 +01:00
mmqxyz
199dca2a3b fix small typos in Pairing.sol
Former-commit-id: 9aa18b2fff
2023-03-28 11:32:29 +02:00
Cedoor
51accfc939 Merge pull request #291 from semaphore-protocol/docs/heyauthn-readme
Add new author

Former-commit-id: c77451857c
2023-03-24 10:16:47 +00:00
vplasencia
1696294881 style(heyauthn): format code with prettier
Former-commit-id: 220b34dade
2023-03-24 09:39:29 +01:00
vplasencia
c85b758120 docs(heyauthn): add new author
Former-commit-id: a31259011d
2023-03-24 09:28:38 +01:00
cedoor
12fd0f7a80 chore: v3.4.0
Former-commit-id: 254218b1e5
2023-03-21 19:41:10 +00:00
cedoor
78da99055d feat(cli): add support for arbitrum goerli
Former-commit-id: 7c4a2a1022
2023-03-21 19:40:40 +00:00
cedoor
77e4770b53 docs: add heyauthn docs link
Former-commit-id: ff692f1507
2023-03-21 19:35:50 +00:00
cedoor
799afc82f4 docs: add heyauthn package to readme
Former-commit-id: 79103bbbb0
2023-03-21 19:31:49 +00:00
cedoor
46fe2fc8f8 chore: v3.3.0
Former-commit-id: af89f3a0a1
2023-03-21 19:28:09 +00:00
cedoor
7bb9554388 style(heyauthn): format code with prettier
Former-commit-id: 587e3045c8
2023-03-21 19:22:22 +00:00
Cedoor
d88a71ec4d Merge pull request #285 from semaphore-protocol/feat/heyauthn
New HeyAuthn package

Former-commit-id: b497be753e
2023-03-21 19:17:11 +00:00
cedoor
2afc4ce1de style(cli): format code
Former-commit-id: 22ee1e0109
2023-03-21 11:36:42 +00:00
Cedoor
64f7b24c53 Merge pull request #281 from semaphore-protocol/feat/cli-sepolia-network
Add support for Sepolia network in the CLI

Former-commit-id: 889fe89162
2023-03-21 11:19:44 +00:00
Cedoor
88ba0af2d2 Merge pull request #282 from semaphore-protocol/chore/arbitrum-goerli
Semaphore support for Arbitrum Goerli network

Former-commit-id: 0a6061c9c5
2023-03-21 11:05:31 +00:00
vplasencia
c2e8ba6856 fix(cli): add admin in get-group when using SemaphoreEthers
Former-commit-id: 4641735932
2023-03-21 01:15:07 +01:00
cedoor
f9a8d68641 docs(heyauthn): add authors to readme file
re #284


Former-commit-id: 53637009b1
2023-03-20 16:37:55 +00:00
cedoor
df84100c22 feat(heyauthn): create heyauthn package
re #284


Former-commit-id: f67c1f07d7
2023-03-20 16:29:26 +00:00
cedoor
b962339203 feat(data): add support for arbitrum goerli network
re #275


Former-commit-id: 0571bbcdaa
2023-03-20 12:42:52 +00:00
Cedoor
073f5a5772 Merge pull request #283 from semaphore-protocol/feat/cli-template-hardhat
Add new version of cli-template-hardhat

Former-commit-id: e44ca7d447
2023-03-20 12:18:09 +00:00
vplasencia
b26f74a453 feat(cli-template-hardhat): add new version of cli-template-hardhat
Former-commit-id: 4133ae12c3
2023-03-20 12:36:12 +01:00
vplasencia
e9cac671f2 refactor(cli): remove unnecessary code in get-group command
Former-commit-id: 716a20cb7c
2023-03-17 23:11:40 +01:00
vplasencia
ecf8dcafb1 refactor(cli): remove unused code
Former-commit-id: 4ecf293cd4
2023-03-17 22:59:41 +01:00
vplasencia
f90c99193a refactor(cli): organize get-groups command code
Former-commit-id: eefffca9f4
2023-03-17 22:55:40 +01:00
vplasencia
a826708320 feat(cli): update get-group command to use sepolia
Former-commit-id: 4ddf75b378
2023-03-17 22:41:11 +01:00
cedoor
43370202a7 style(contracts): format code with prettier
Former-commit-id: ef393e9c03
2023-03-17 18:07:53 +00:00
cedoor
a4d1180d26 chore(contracts): deploy semaphore on arbitrum goerli network
re #275


Former-commit-id: e34ce9c61a
2023-03-17 18:01:40 +00:00
vplasencia
5c42f9e09c feat(cli): add support for sepolia network in the cli
Former-commit-id: 63666f6a9c
2023-03-17 14:27:58 +01:00
Cedoor
c8362e373b Merge pull request #280 from dbrans/patch-1
Comment typo in Pairing.sol

Former-commit-id: 032702b245
2023-03-17 10:53:27 +00:00
Derek Brans
06765f2f88 Fix typo in Pairing.sol
Former-commit-id: 0810ffbe0f
2023-03-16 19:15:42 -05:00
Cedoor
f26c84445e Merge pull request #279 from semaphore-protocol/chore/default-network
New default network (Sepolia)

Former-commit-id: 6c644522f0
2023-03-16 10:42:46 +00:00
cedoor
61a2d6adc2 test(data): update tests for semaphore ethers class
re #277


Former-commit-id: 8988f478c9
2023-03-15 19:04:23 +00:00
cedoor
eddd6b3dd5 chore(data): change default network
re #277


Former-commit-id: 49221b6ba7
2023-03-15 18:56:49 +00:00
cedoor
fa561f8f00 chore(cli): update command description
Former-commit-id: a4f9e47957
2023-03-15 18:55:34 +00:00
cedoor
c1842eefc3 chore: v3.2.3
Former-commit-id: 59d2d1367c
2023-03-13 22:52:08 +00:00
Cedoor
320187ff89 Merge pull request #276 from semaphore-protocol/fix/bundle-poseidon
JS bundles with Poseidon functions

Former-commit-id: e135b1d8fa
2023-03-13 22:51:20 +00:00
cedoor
abbf1a1d30 chore: update lockfile
Former-commit-id: 982ee86208
2023-03-13 22:41:37 +00:00
cedoor
59269b067d build: bundle poseidon-lite functions with rollup
Former-commit-id: 797e62dd28
2023-03-13 22:32:23 +00:00
cedoor
21bd9fe540 ci: update auto-assign workflow name
Former-commit-id: 6a3079bf52
2023-03-13 19:35:41 +00:00
Cedoor
f60a4c02f1 Merge pull request #274 from semaphore-protocol/chore/husky
New Husky script to check commit messages' format

Former-commit-id: e00dc8eca8
2023-03-13 19:30:46 +00:00
cedoor
d012310ae1 chore: add husky script to check commit message format
re #263


Former-commit-id: 77552b0da3
2023-03-13 19:26:40 +00:00
Cedoor
f01cb91472 chore: update github token
Former-commit-id: d33d306478
2023-03-13 19:25:17 +00:00
cedoor
31e6954aff style: format code with prettier
Former-commit-id: 0137d6e759
2023-03-13 18:36:01 +00:00
Cedoor
7518d938d1 Merge pull request #273 from semaphore-protocol/chore/auto-assign-action
New Github workflow to assign PRs

Former-commit-id: f777603fba
2023-03-13 18:31:43 +00:00
Cedoor
083d8a03a4 chore: update team name
Former-commit-id: 07244fc6bc
2023-03-13 18:30:56 +00:00
Cedoor
16c9e90ae4 chore: set org devs as reviewers
Former-commit-id: b9db0663ec
2023-03-13 18:18:50 +00:00
Cedoor
1fe2745594 chore: add github workflow to auto assign PRs
Former-commit-id: 0c6df193e4
2023-03-13 16:57:52 +00:00
cedoor
18d4b740ca chore: v3.2.2
Former-commit-id: 5ea3b7e6ef
2023-03-13 11:52:02 +00:00
Cedoor
8392173370 Merge pull request #272 from semaphore-protocol/fix/data-ethers
Correct check for group existence

Former-commit-id: 46c2ad2c7a
2023-03-13 11:50:59 +00:00
cedoor
26490304e4 fix(data): set correct check for group existence
Former-commit-id: 7b938935ca
2023-03-13 11:40:23 +00:00
cedoor
1878ce2320 chore: v3.2.1
Former-commit-id: 5cc6877d15
2023-03-11 21:41:08 +00:00
cedoor
98aed04bd9 chore(contracts): include Semaphore.sol contract in npm files
Former-commit-id: d227ee1907
2023-03-11 21:40:38 +00:00
cedoor
5a0585cec2 chore: add refactor type to changelog
Former-commit-id: 4f7af880a9
2023-03-10 13:09:10 +00:00
cedoor
1a51263e5c chore: v3.2.0
Former-commit-id: 33d814fe6d
2023-03-10 11:19:52 +00:00
cedoor
4d7a976f06 chore(cli): remove unused ts paths
Former-commit-id: 915b95dfc6
2023-03-10 11:10:25 +00:00
cedoor
fe07103ff2 chore(cli-template-hardhat): add supported networks to hardhat
Former-commit-id: 0780751954
2023-03-10 11:03:17 +00:00
Cedoor
aa230345fb Merge pull request #270 from semaphore-protocol/chore/optimism-goerli
Semaphore support for Optimism Goerli network

Former-commit-id: 6344cf4954
2023-03-10 10:55:47 +00:00
Cedoor
d5c24c0f9c Merge pull request #269 from semaphore-protocol/chore/mumbai
Semaphore support for Mumbai network

Former-commit-id: e002b24f2a
2023-03-10 10:55:19 +00:00
Cedoor
c1752dcb2e Merge pull request #271 from vimwitch/poseidon-lite-upgrade
Poseidon lite upgrade

Former-commit-id: 21f2287570
2023-03-09 20:35:49 +00:00
Chance
b00ff99e5e chore: bump poseidon-lite version
Former-commit-id: 1a27d0b28b
2023-03-09 14:05:48 -06:00
cedoor
00e3c4a7f5 feat(data): add support for optimism goerli network
re #234


Former-commit-id: 3722b154bf
2023-03-09 18:21:44 +00:00
cedoor
0176a67e3a style(contracts): format code with prettier
Former-commit-id: d9f888ab70
2023-03-09 18:03:09 +00:00
cedoor
4fa9f41483 chore(contracts): deploy semaphore on optimism goerli network
re #234


Former-commit-id: 55a48a27d1
2023-03-09 18:02:16 +00:00
cedoor
64b9ef28e8 chore(contracts): update hardhat etherscan plugin
Former-commit-id: 4241be137a
2023-03-09 18:01:03 +00:00
cedoor
d7ce540f88 style(contracts): format code with prettier
Former-commit-id: 2e5e00ae55
2023-03-09 15:33:26 +00:00
cedoor
3411f55403 feat(data): add support for mumbai network
re #233


Former-commit-id: 6b498912df
2023-03-09 15:19:34 +00:00
cedoor
1bc492c39d chore(contracts): deploy semaphore on mumbai network
re #233


Former-commit-id: c98889632e
2023-03-09 14:28:35 +00:00
Cedoor
6197a03734 Merge pull request #268 from semaphore-protocol/chore/sepolia
Semaphore on Sepolia network

Former-commit-id: eceec87727
2023-03-09 11:40:03 +00:00
cedoor
6369fdfa71 style(contracts): format code with prettier
Former-commit-id: 1013516ba2
2023-03-09 11:39:51 +00:00
cedoor
48f779cd90 chore(contracts): deploy semaphore on sepolia network
re #183


Former-commit-id: a296541c6d
2023-03-09 11:28:17 +00:00
Cedoor
3ff6709a7b Merge pull request #267 from 0xdeenz/main
refactor(contracts): change Semaphore__InvalidProof to InvalidProof

Former-commit-id: 4fab94e058
2023-03-09 10:25:38 +00:00
0xdeenz
90bb4ccfa0 refactor(contracts): change Semaphore__InvalidProof to InvalidProof
Makes Pairing.sol errors more generic for greater reusability

fix #266


Former-commit-id: dc39c4ca44
2023-03-08 23:27:08 +01:00
Cedoor
5f29690641 Merge pull request #264 from semaphore-protocol/feat/data-package
New `@semaphore-protocol/data` package

Former-commit-id: 86e186cdc0
2023-03-08 21:30:33 +00:00
cedoor
2665a440fa build: add topological option to yarn workspaces cmd
Former-commit-id: b09e27477f
2023-03-08 21:18:38 +00:00
Cedoor
cf31913d27 docs: fix md syntax
Former-commit-id: 2b732f335c
2023-03-08 21:15:12 +00:00
cedoor
103a676455 docs(data): add await to usage functions
Former-commit-id: cce29363f9
2023-03-08 21:12:19 +00:00
cedoor
9aa5bc5840 fix(cli): set correct data class name
Former-commit-id: 180977841d
2023-03-08 21:11:49 +00:00
cedoor
894bc87952 docs(data): update readme file
re #256


Former-commit-id: a798acbe80
2023-03-08 20:57:32 +00:00
cedoor
cd4bd6ad91 chore(cli): sen new data package
Former-commit-id: bc165cd6e4
2023-03-08 20:32:02 +00:00
cedoor
dca7b67677 fix(data): add request header
Former-commit-id: 56e652a507
2023-03-08 20:31:40 +00:00
cedoor
60d698f6ee test(data): mock ethers tests
re #256


Former-commit-id: 9942b92f13
2023-03-07 18:24:25 +00:00
cedoor
f05e654f95 build(data): update rollup configuration
re #256


Former-commit-id: 9d27c3ac54
2023-03-06 22:14:28 +00:00
cedoor
9a4fe6ba64 chore: remove types folder from prettier ignore file
Former-commit-id: 925cc64d73
2023-03-06 17:44:44 +00:00
cedoor
c8d472a286 feat(data): create new data package
This new package allows devs to fetch on-chain data by using a Semaphore subgraph or the Ethers
library.

BREAKING CHANGE: The code of the old `@semaphore-protocol/subgraph` package has been moved to the
`@semaphore-protocol/data` package.

re #256


Former-commit-id: fc2f648acc
2023-03-06 17:43:42 +00:00
Cedoor
c9711b9007 Merge pull request #262 from vimwitch/identity-entropy
feat(identity): use sha512 to extract more entropy from message

Former-commit-id: 95e4a4e672
2023-03-05 21:07:39 +00:00
cedoor
8afcac50c2 chore(subgraph): remove subgraph package
re #256


Former-commit-id: b040c421ea
2023-03-05 20:12:46 +00:00
Chance
75c1c1373c chore: run prettier
Former-commit-id: d5d01142b1
2023-03-04 15:12:31 -06:00
Chance
2318628ca2 feat(identity): use sha512 to extract more entropy from message
Former-commit-id: ed63519423
2023-03-04 15:02:40 -06:00
Cedoor
2603600716 Merge pull request #261 from vimwitch/json-prepend-0x
feat(identity): prepend hex strings with 0x

Former-commit-id: 5a99792b68
2023-03-04 21:00:45 +00:00
Chance
3f0f1e006c feat(identity): prepend hex strings with 0x
Former-commit-id: 3c359e9a57
2023-03-04 14:47:03 -06:00
cedoor
2a4f2455d7 refactor(hardhat): update readme and set correct task name
Former-commit-id: 25e2442090
2023-03-01 19:35:57 +00:00
cedoor
0ea221d9ea Merge pull request #257 from shiyingt/feat/deploy-verifier-hardhat
add hardhat task to deploy SemaphoreVerifier.sol

Former-commit-id: 76146ed728
2023-03-01 20:20:59 +01:00
shiyingt
437674f3bc add hardhat task to deploy verifier
Former-commit-id: 934e4b2c06
2023-02-27 23:43:33 +08:00
shiyingt
4202186c0b revert all changes
Former-commit-id: b51f1d7820
2023-02-27 23:29:28 +08:00
cedoor
383e818833 docs(hardhat): update readme description
Former-commit-id: 865421a001
2023-02-23 11:54:04 +01:00
shiyingt
74014a42b5 run prettier write and eslint
Former-commit-id: 2ddbc51679
2023-02-22 22:39:10 +08:00
cedoor
e875fa4aa3 chore: update discord links
Former-commit-id: bd06422ef5
2023-02-22 13:22:46 +01:00
shiyingt
186dae79d2 fix hardhat task
Former-commit-id: 6987686426
2023-02-21 23:08:58 +08:00
shiyingt
195d545a95 fix hardhat task
Former-commit-id: 3105a0c095
2023-02-21 23:02:51 +08:00
cedoor
84245b9b1f Merge pull request #255 from semaphore-protocol/chore/bump-version
New NPM scripts to bump versions and publish NPM packages

Former-commit-id: 1bb2982f7d
2023-02-20 16:42:47 +01:00
cedoor
461e91f53b style: format code with prettier
Former-commit-id: 5c402f3ba2
2023-02-20 14:40:10 +01:00
cedoor
2893feca3c chore: add new scripts to bump versions & publish npm pkgs
re #254


Former-commit-id: 257080e478
2023-02-20 14:31:42 +01:00
cedoor
4be2973761 chore: update lockfile
re #254


Former-commit-id: 0b1519ea57
2023-02-20 12:46:15 +01:00
cedoor
01a30fd8af chore: add new workspace package
re #254


Former-commit-id: 9ef675f120
2023-02-20 12:44:36 +01:00
cedoor
a70c1b001c chore(yarn): add yarn plugin for versioning
re #254


Former-commit-id: a5df125378
2023-02-20 12:07:38 +01:00
shiyingt
30ed65d569 add hardhat task to deploy semaphore verifier only
Former-commit-id: 972790d158
2023-02-19 09:48:19 +08:00
cedoor
04a6649f2f Merge pull request #253 from semaphore-protocol/chore/release
Yarn patch to change `changelogithub` output

Former-commit-id: d2b959718c
2023-02-16 19:13:35 +01:00
cedoor
a337021d8d chore(release): create yarn patch to update changelogithub format
re #252


Former-commit-id: 739af09a5d
2023-02-16 18:41:15 +01:00
cedoor
4cd3863d03 docs(subgraph): update readme file
Former-commit-id: 6e036c0887
2023-02-15 22:00:03 +01:00
cedoor
c88639659d chore: update lockfile
Former-commit-id: 4f49736591
2023-02-15 20:57:45 +01:00
cedoor
0ca17d078b chore(semaphore): v3.1.0
Former-commit-id: 243c505d87
2023-02-15 20:47:23 +01:00
cedoor
f171506891 ci(release): add new workflow for automatic releases
Former-commit-id: a4fcb36fe0
2023-02-15 20:40:50 +01:00
cedoor
e085ecd0df test(subgraph): ignore some lines
Former-commit-id: 381c8668e4
2023-02-15 20:37:09 +01:00
cedoor
b744ee1e7b Merge pull request #250 from semaphore-protocol/refactor/cli-inquirer
Add inquirer in get-groups and get-group commands

Former-commit-id: 04ac6c2649
2023-02-15 20:18:15 +01:00
vplasencia
8d51a6689d refactor(cli): change some inquirer messages
Former-commit-id: 48ec4ba361
2023-02-15 12:29:32 -05:00
cedoor
7bec0a4e42 Merge pull request #251 from semaphore-protocol/feat/subgraph-improvements
Subgraph library improvements

Former-commit-id: 1d6f59229b
2023-02-15 18:16:11 +01:00
Saleel
71ed4d605d chore: add test for querying subgraph with filters
Former-commit-id: 11f061e586
2023-02-15 22:24:56 +05:30
Saleel
810a5358c0 chore: add tests for initalizing subgraph library with URL
Former-commit-id: 667929b09d
2023-02-15 22:05:56 +05:30
Saleel
636a9156b4 feat: add option to specify subgraph URL in subgraph library
Former-commit-id: fc4db2c8a1
2023-02-15 21:43:53 +05:30
Saleel
a679d047fa feat: add query filters to subgraph library
Former-commit-id: bc8f3495b6
2023-02-15 21:39:11 +05:30
vplasencia
6d3e685284 refactor(cli): add inquirer in get-group command
Former-commit-id: 68702bb5e4
2023-02-14 20:45:29 -05:00
vplasencia
3bfcf67b9d refactor(cli): add inquirer in get-groups command
Former-commit-id: f7fb159562
2023-02-14 16:41:00 -05:00
vplasencia
e16dbe663e refactor(cli): change project name message
Former-commit-id: 1aaaae0635
2023-02-14 16:30:14 -05:00
cedoor
0aca50ea34 Merge pull request #248 from semaphore-protocol/refactor/cli
Add node conventions and display an error for excess arguments in commands

Former-commit-id: 5604eff98d
2023-02-08 17:07:31 +01:00
vplasencia
54a6abdd2b refactor(cli): add node conventions and display an error for excess arguments in commands
Former-commit-id: 878ff0524e
2023-02-08 10:58:22 -05:00
cedoor
de32db6d2d Merge pull request #247 from semaphore-protocol/feature/cli-integrate-inquirer
Integrate Inquirer.js in create command in the CLI

Former-commit-id: 519b518c21
2023-02-08 16:32:46 +01:00
vplasencia
d43f9278e0 refactor(cli): remove projectDir variable
Former-commit-id: f7c1ca6e7e
2023-02-08 10:24:48 -05:00
vplasencia
f3d8c4ee75 feat(cli): integrate inquirer in create command
Former-commit-id: 7f63cc567e
2023-02-08 00:16:57 -05:00
cedoor
60fedc4e90 Merge pull request #244 from semaphore-protocol/feature/cli-check-latest-version
Check for latest version

Former-commit-id: dc969e0f55
2023-02-06 20:17:46 +01:00
cedoor
34d5743fa4 refactor(cli): move code to function to check latest version
re #188


Former-commit-id: fb0c016447
2023-02-06 20:06:16 +01:00
vplasencia
6810fcb5bb feat(cli): add check for latest version
Former-commit-id: ed81202bbd
2023-02-06 10:09:18 -05:00
cedoor
0bdf064614 Merge pull request #241 from semaphore-protocol/feature/group-id
Group class `id` attribute

Former-commit-id: cd3fa0c82c
2023-02-06 14:27:14 +01:00
cedoor
7c4d2c2007 feat(group): add id attribute to group class
re #240


Former-commit-id: 202fcc399c
2023-02-06 12:23:51 +01:00
cedoor
1bb57ca607 chore: update lockfile
Former-commit-id: b45c4f3510
2023-01-26 22:59:08 +01:00
cedoor
44860d70b9 chore: v3.0.0
Former-commit-id: 439a357173
2023-01-26 22:52:52 +01:00
cedoor
d286a8f1e8 Merge pull request #213 from semaphore-protocol/dev
Semaphore v3

Former-commit-id: 39a40f5f3b
2023-01-26 22:49:35 +01:00
cedoor
729ba41afd Merge pull request #236 from semaphore-protocol/vplasencia-patch-1
Change a comment

Former-commit-id: d27513d3f0
2023-01-26 11:47:04 +01:00
Vivian Plasencia
972fde32a7 Update group.ts
Former-commit-id: 5eb168c2ef
2023-01-25 21:55:17 -05:00
cedoor
c3d9e23e2a docs(contracts): update readme file
Former-commit-id: 9d12d3b050
2023-01-24 11:26:58 +01:00
cedoor
5fd7435c6d Merge pull request #232 from semaphore-protocol/refactor/proof
Proof generation/verification refactoring

Former-commit-id: f272aa26e9
2023-01-24 11:07:26 +01:00
cedoor
07888687a0 chore: update lockfile
Former-commit-id: 6b24210be1
2023-01-24 11:00:42 +01:00
cedoor
54c3a54597 chore: v3.0.0-beta.8
Former-commit-id: 8c952e9558
2023-01-24 10:38:47 +01:00
cedoor
81dba510c3 refactor(cli): update cli template tests
re #230


Former-commit-id: 5c027eef70
2023-01-24 10:37:32 +01:00
cedoor
343cdabe9c refactor(contracts): update contract tests
re #230


Former-commit-id: 1b654977b0
2023-01-23 20:29:08 +01:00
cedoor
fe6fbc1a0d refactor(proof): pack snarkjs proof
re #230


Former-commit-id: 8d68c09068
2023-01-23 20:27:56 +01:00
cedoor
f854492709 Merge pull request #231 from semaphore-protocol/feat/arbitrum-subgraph
Arbitrum subgraph

Former-commit-id: 4139c3e146
2023-01-23 17:08:48 +01:00
cedoor
30af236547 feat(subgraph): add arbitrum subgraph
re #229


Former-commit-id: 22fb9ebb87
2023-01-23 16:22:59 +01:00
cedoor
d65b4aae47 style: format code with prettier
Former-commit-id: 45d5815d95
2023-01-23 15:45:03 +01:00
cedoor
245fb2cba8 chore(contracts): deploy contracts on arbitrum
Former-commit-id: ea86ae0a3d
2023-01-23 15:41:15 +01:00
cedoor
f469ccc36a Merge pull request #228 from semaphore-protocol/refactor/bytes32-greeting
`bytes32` greeting

Former-commit-id: 5b2944105c
2023-01-19 12:12:12 +01:00
cedoor
8ee1bd9c1b Merge pull request #226 from semaphore-protocol/chore/fixed-dependencies
No version range for `snarkjs` and `poseidon-lite` dependencies

Former-commit-id: 5c03b72d37
2023-01-19 12:10:03 +01:00
cedoor
348a4327d7 refactor(cli): update greeting type to bytes32
Former-commit-id: c0ec1b5ecf
2023-01-18 20:06:48 +01:00
cedoor
faffde79f0 chore: update lockfile
re #225


Former-commit-id: 95e4a743b2
2023-01-17 15:29:05 +01:00
cedoor
89a83c7b6b chore: make snarkjs and poseidon-lite versions fixed
re #225


Former-commit-id: 59f1f624f2
2023-01-17 15:13:41 +01:00
cedoor
f36e8c1536 Merge pull request #223 from semaphore-protocol/fix/add-ts-suppress-error-comment
Fix/add ts suppress error comment

Former-commit-id: bdfc8d68a2
2023-01-11 18:34:32 +01:00
vplasencia
46ed508de8 Add TypeScript suppress error comment
Former-commit-id: 07728848f2
2023-01-11 12:12:48 -05:00
cedoor
821cdb7fd3 chore: update lockfile
Former-commit-id: 3bcec50e19
2023-01-09 17:18:17 +01:00
cedoor
dd2df7ab06 chore: v3.0.0-beta.7
Former-commit-id: ab1115c77a
2023-01-09 17:14:50 +01:00
cedoor
71fdabe65c Merge pull request #220 from semaphore-protocol/refactor/cli-init
Semaphore `create` command

Former-commit-id: a411b041b8
2023-01-09 17:03:22 +01:00
cedoor
cce6c31461 refactor(cli): replace init command with create
Former-commit-id: 72859d9b98
2023-01-09 11:05:54 +01:00
aguzmant103
f1aced7ee3 docs: adding GitPOAP link
Former-commit-id: f7e87c4442
2023-01-05 20:06:10 -06:00
cedoor
bd8b06bb7b docs(hardhat): update readme usage section
Former-commit-id: 20fa45c8f3
2023-01-05 17:44:46 +01:00
cedoor
9f692e57e8 chore: v3.0.0-beta.6
Former-commit-id: 1df18f81f7
2023-01-04 19:16:42 +01:00
cedoor
32aabf81d2 fix(subgraph): set correct goerli subgraph url
Former-commit-id: ce5c30b816
2023-01-04 19:08:52 +01:00
cedoor
a72a57ef63 style(subgraph): format code with prettier
Former-commit-id: 469e2a1310
2023-01-04 19:08:32 +01:00
cedoor
4e5b4495a3 chore: update lockfile
Former-commit-id: 1d4e7c509e
2023-01-04 18:56:23 +01:00
cedoor
578d426d1a chore(cli): v3.0.0-beta.5
Former-commit-id: 9a2db4b3bf
2023-01-04 18:52:16 +01:00
cedoor
362b025fac chore(hardhat): v3.0.0-beta.5
Former-commit-id: 23ec6dc55c
2023-01-04 18:48:54 +01:00
cedoor
84aa8d0eac chore(subgraph): v3.0.0-beta.5
Former-commit-id: ca1485bea8
2023-01-04 18:12:06 +01:00
cedoor
6592a62f25 chore(proof): v3.0.0-beta.5
Former-commit-id: e097a86875
2023-01-04 18:09:22 +01:00
cedoor
a59a2af50b chore(contracts): v3.0.0-beta.5
Former-commit-id: 268ef49ec5
2023-01-04 18:09:03 +01:00
cedoor
1e68ed1fec chore(group): v3.0.0-beta.5
Former-commit-id: 3ca1f59472
2023-01-04 18:08:14 +01:00
cedoor
2abd068cf8 chore(identity): v3.0.0-beta.5
Former-commit-id: 7f9978eb4f
2023-01-04 18:07:49 +01:00
cedoor
8b746ff2bc style(contracts): format code with prettier
Former-commit-id: ef9f927cbd
2023-01-04 13:27:15 +01:00
cedoor
23d9786e16 chore(contracts): deploy contracts on goerli
Former-commit-id: 2f14cc9fa9
2023-01-04 13:21:57 +01:00
cedoor
3b20402476 refactor(contracts): update function to verify contracts
Former-commit-id: cd65440f2c
2023-01-04 13:20:54 +01:00
cedoor
91bcc66c17 chore(cli): add arbitrum network to cli hardhat template
Former-commit-id: 3cdf7daa0f
2023-01-04 12:42:11 +01:00
cedoor
bcf9dad496 docs: update readme description
Former-commit-id: 64e47907b9
2023-01-04 11:03:33 +01:00
cedoor
29195519fb chore(cli): v0.5.0
Former-commit-id: bd30127759
2023-01-03 20:37:44 +01:00
cedoor
17efdb38af refactor(cli): add more info to init command
Former-commit-id: 3d559a6491
2023-01-03 20:36:11 +01:00
cedoor
8713e2b339 chore(cli): add files to be included in the package
re #216


Former-commit-id: 51a9d17520
2023-01-03 20:35:16 +01:00
cedoor
ef69356dca docs(proof): update readme file
Former-commit-id: 55add650f9
2022-12-23 11:08:49 +01:00
cedoor
252b866daa docs(readme): update badge & package list
Former-commit-id: d03f15c263
2022-12-23 10:58:07 +01:00
cedoor
5627f6eae7 chore: update lockfile
Former-commit-id: fead45b069
2022-12-23 10:24:07 +01:00
cedoor
45ef560324 chore(contracts): update zk-kit dependency
Former-commit-id: 9e186f3da9
2022-12-23 10:19:34 +01:00
cedoor
ee80aa172e fix(contracts): set a nullifier hashes mapping for each poll
fix #211


Former-commit-id: 681128f468
2022-12-22 18:22:45 +01:00
cedoor
c0f106edb6 Merge pull request #210 from semaphore-protocol/refactor/general
General refactoring and additional documentation to contracts

Former-commit-id: 2f1fbd8411
2022-12-22 18:20:45 +01:00
cedoor
3aea38cc9b docs(contracts): update contract comments
Former-commit-id: 4c32f4f610
2022-12-22 15:49:08 +01:00
cedoor
c6fe15cf13 refactor(contracts): remove unused contract error
Former-commit-id: 2dd0737e2c
2022-12-22 15:15:33 +01:00
cedoor
6e948d63dc refactor(contracts): make some event parameteres indexed
Former-commit-id: cd4aeab0a6
2022-12-22 13:09:02 +01:00
cedoor
c2bd4df1d9 refactor(contracts): rename merkle trees' mapping
Former-commit-id: b1ce54f0b9
2022-12-22 13:07:21 +01:00
cedoor
06e3063c3e refactor(contracts): get merkle tree depth only once
Former-commit-id: 76d8e81b65
2022-12-22 13:06:29 +01:00
cedoor
cb52b3db20 Merge pull request #197 from semaphore-protocol/fix/zero-values
Generate zeroValue based on groupId

Former-commit-id: 5726c9896a
2022-12-20 11:56:06 +01:00
cedoor
88781ea466 style(contracts): format code with prettier
Former-commit-id: 218867747b
2022-12-20 11:51:26 +01:00
cedoor
2c47ad9f28 Merge branch 'dev' into fix/zero-values
Former-commit-id: a2e31b78d3
2022-12-20 11:44:26 +01:00
cedoor
228ebd941a Merge pull request #206 from semaphore-protocol/fix/group-existence
Tree depth to check group existence

Former-commit-id: f7367b63d0
2022-12-20 11:39:27 +01:00
cedoor
71f31f0910 Merge pull request #204 from semaphore-protocol/docs/circuit-tree-depth
Update circuits' nLevels comment

Former-commit-id: a30261c373
2022-12-20 11:38:28 +01:00
cedoor
7cf8eb11a1 Merge pull request #205 from semaphore-protocol/fix/members-loop
Increase size of iterator variable

Former-commit-id: 93c7445619
2022-12-20 11:37:37 +01:00
cedoor
6bbe45fb33 Merge pull request #208 from semaphore-protocol/fix/root-duration
New function to update merkle tree duration

Former-commit-id: 81ef86757e
2022-12-20 11:36:41 +01:00
cedoor
7b4e03c7fd style(contracts): format code with prettier
Former-commit-id: dabdfc036b
2022-12-19 13:43:09 +01:00
cedoor
8e0dd30ccc fix(contracts): add function to update merkle tree duration
This bug was found by Veridise during their audit of Semaphore.

fix #200


Former-commit-id: 70d7276928
2022-12-19 13:35:01 +01:00
cedoor
0661320c2a fix(contracts): use tree depth to check group existence
This bug was found by Veridise during their audit of Semaphore.

fix #202


Former-commit-id: 6458614a76
2022-12-19 13:02:16 +01:00
cedoor
b419344297 fix(contracts): increase size of members iterator variable
This bug was found by Veridise during their audit of Semaphore.

fix #201


Former-commit-id: 1c5ccb8af5
2022-12-19 12:51:09 +01:00
cedoor
fc636b732d docs(circuits): update nLevels comment
This issue was opened by Veridise during their audit of Semaphore.

re #203


Former-commit-id: f67d803b1b
2022-12-19 12:27:08 +01:00
cedoor
5ac1cad96c Merge pull request #199 from semaphore-protocol/fix/whistleblowing-entities
Editors can be associated with multiple entities

Former-commit-id: 6b876c1606
2022-12-19 11:57:20 +01:00
cedoor
33a6a3601e fix(contracts): associate editor with many entities
This bug was found by Veridise during their audit of Semaphore.

fix #198


Former-commit-id: 2f414484ed
2022-12-17 14:32:12 +01:00
cedoor
2dc8be161c Merge pull request #195 from semaphore-protocol/chore/hardhat-chai-matchers
Migrate from hardhat-waffle to hardhat-chai-matchers

Former-commit-id: f392afbefa
2022-12-17 13:00:25 +01:00
cedoor
a9dae718d3 Merge pull request #194 from semaphore-protocol/refactor/snark-identities
New hash function to generate identity secrets

Former-commit-id: 8c51b9e707
2022-12-17 12:59:04 +01:00
cedoor
f3ca0ce3d8 fix(contracts): generate zeroValue based on groupId
This bug was found by Veridise during their audit of Semaphore.


Former-commit-id: a6d3e0719f
2022-12-16 16:23:13 +01:00
cedoor
310b1a8dcd chore(contracts): migrate to hardhat-chai-matchers
Former-commit-id: 0d3e3c8459
2022-12-16 14:46:24 +01:00
cedoor
3c3d374c54 style(identity): format code with prettier
Former-commit-id: 62c048f964
2022-12-16 13:57:21 +01:00
cedoor
c6247ace3b refactor(identity): update hash function to generate identity secrets
Former-commit-id: d46c9306e6
2022-12-16 13:50:44 +01:00
cedoor
1e9d56d3da docs(readme): update badges urls
Former-commit-id: 9ea07a8b1b
2022-12-16 12:38:45 +01:00
cedoor
a52a3bee1b chore(contracts): update incremental-merkle-tree.sol dependency
Former-commit-id: f67c5c0fe4
2022-12-16 12:36:21 +01:00
cedoor
e91bc74ab0 Merge pull request #191 from semaphore-protocol/feat/semaphore-cli
Semaphore CLI

Former-commit-id: 85af25af58
2022-12-16 11:45:03 +01:00
cedoor
2594c4e1c2 chore(cli): v0.4.0
Former-commit-id: d4b3ff5f74
2022-12-16 11:41:37 +01:00
cedoor
a199b01a50 fix(cli): add check for network option
Former-commit-id: ee27d5a056
2022-12-16 11:41:02 +01:00
cedoor
c97a0cbbb5 style: format code
Former-commit-id: 1a60f28320
2022-12-15 14:14:00 +01:00
cedoor
04fd0a3d91 chore: add files to ignore for eslint and prettier
Former-commit-id: c1d4511c77
2022-12-15 14:13:34 +01:00
cedoor
3fb849f076 build(cli): add subgraph package ts path
Former-commit-id: fb00f0cf4a
2022-12-15 14:03:57 +01:00
cedoor
b3c83bac8b chore(cli): move dependency
Former-commit-id: 53e395d0d6
2022-12-15 13:57:56 +01:00
cedoor
00c302aefc docs(cli): update readme long description
Former-commit-id: a6511d2978
2022-12-15 13:43:02 +01:00
cedoor
feee90e69d chore(cli): v.0.3.0
Former-commit-id: dc9340a70f
2022-12-15 13:38:13 +01:00
cedoor
ca87f3601d docs(cli): update usage section
Former-commit-id: 65bf4f0366
2022-12-15 13:37:07 +01:00
cedoor
a3abb810a9 refactor(cli): add more info to init command
Former-commit-id: 0e9ae15156
2022-12-15 13:35:34 +01:00
cedoor
5d19919474 docs(cli): update description and readme file
Former-commit-id: 1450d78f5c
2022-12-15 13:34:57 +01:00
cedoor
5c66f16a5b feat(cli): create init command
Former-commit-id: 4241fb97d5
2022-12-14 20:24:55 +01:00
cedoor
4b2f9e4492 feat(cli): create new cli template
Former-commit-id: 621f3ab4e6
2022-12-14 17:01:37 +01:00
cedoor
b593d1a0e9 refactor(cli): set common error syntax
Former-commit-id: ff8c73b31b
2022-12-12 15:20:27 +01:00
cedoor
d3b206ec3a refactor(cli): set error messages
Former-commit-id: d5a599c7d5
2022-12-12 14:57:16 +01:00
cedoor
adadacb218 chore(cli): v0.1.0
Former-commit-id: 8d80ba2614
2022-12-12 13:03:43 +01:00
cedoor
b7411bfcb7 feat(cli): create get-groups command
Former-commit-id: 110942071a
2022-12-12 13:02:24 +01:00
cedoor
3feeb7f9fd feat(cli): create get-group command
Former-commit-id: 190fdaff22
2022-12-09 18:34:14 +01:00
cedoor
05125c11d9 chore(cli): add cli package and basic setup
Former-commit-id: d124b48903
2022-12-08 20:45:45 +01:00
cedoor
3188d3dbff Merge pull request #180 from semaphore-protocol/refactor/group-id
No SNARK restrictions for Group IDs

Former-commit-id: 27320f1723
2022-11-28 15:52:49 +01:00
cedoor
04f57db7f0 refactor(contracts): remove snark field check for group id values
Former-commit-id: c15145da2c
2022-11-28 15:31:04 +01:00
cedoor
066f38c471 chore: add license to contracts package
Former-commit-id: 0f24c01ff1
2022-11-23 13:04:38 +01:00
cedoor
37e8784471 docs(circuits): add readme file
Former-commit-id: 9cd0144734
2022-11-23 13:03:46 +01:00
cedoor
889cf1890a Merge pull request #173 from semaphore-protocol/chore/poseidon-lite
New Poseidon library

Former-commit-id: 8081766843
2022-11-23 12:00:17 +01:00
cedoor
1a4a7f36e0 chore: replace circomlibjs with poseidon-lite
Former-commit-id: df6ce176cb
2022-11-23 11:32:48 +01:00
cedoor
3d6c24a51b Merge pull request #170 from semaphore-protocol/refactor/normalize-signals
New hash function to normalize signal & external nullifier

Former-commit-id: 23fb94fd65
2022-11-22 15:25:07 +01:00
cedoor
781922436e refactor: create hash function to normalize snark signals
Former-commit-id: 7f872bcd92
2022-11-22 15:12:29 +01:00
cedoor
277a790e36 Merge pull request #168 from semaphore-protocol/refactor/hardcode-verification-keys
Hardcoded snark verification keys

Former-commit-id: 901531b062
2022-11-21 13:32:46 +01:00
cedoor
d880925604 refactor(proof): move zk verification keys to the code
Former-commit-id: 26d1c5153e
2022-11-21 13:16:56 +01:00
cedoor
5466178f40 Merge pull request #167 from semaphore-protocol/fix/merkle-root-creation-dates
Merkle roots for any tree update

Former-commit-id: 583311fc03
2022-11-20 19:58:22 +01:00
cedoor
6cc4dc07bb Merge pull request #166 from semaphore-protocol/refactor/semaphore-verifier
One Verifier to rule them all

Former-commit-id: 7061785fa0
2022-11-20 19:54:53 +01:00
cedoor
98a35c0a37 fix(contracts): save merkle roots after updates or removal of members
Former-commit-id: be4165afa5
2022-11-18 20:04:39 +01:00
cedoor
bfeb24791d chore(contracts): fix lint warnings
Former-commit-id: 22c7ec8bb3
2022-11-18 19:28:49 +01:00
cedoor
37e2614ac7 style: format code with prettier
Former-commit-id: 6f73de2daf
2022-11-18 17:42:02 +01:00
cedoor
84bb9c89a4 chore: add folder to ignore
Former-commit-id: 975aba3d7a
2022-11-18 17:41:38 +01:00
cedoor
a4aaf7f7ec fix: download snark artifacts in the right folder
Former-commit-id: ecd586a757
2022-11-18 16:36:13 +01:00
cedoor
b92a6e1c7a refactor(proof): update snark artifacts path
Former-commit-id: ec7f605551
2022-11-18 16:35:32 +01:00
cedoor
3afae28e06 refactor: remove unused solidity interface
Former-commit-id: 4f964c9d7f
2022-11-18 16:35:02 +01:00
cedoor
63cddf3da2 chore: add contracts files to ignore
Former-commit-id: eecc8fe97f
2022-11-18 16:34:38 +01:00
cedoor
499ec1cbeb refactor(contracts): replace old verifiers with a single semaphore verifier
Former-commit-id: 56ecb4a2a7
2022-11-18 16:33:58 +01:00
cedoor
fb1ffee89d ci: replace snark-artifacts folder for each download
Former-commit-id: 92d70e1050
2022-11-18 16:18:50 +01:00
cedoor
f7bc7900e0 ci: add env variables to workflows
Former-commit-id: 2ec07b4b99
2022-11-18 16:13:51 +01:00
cedoor
bc14210bc7 chore: add env var to download all snark artifacts
Former-commit-id: 8f269ecafc
2022-11-18 16:13:25 +01:00
cedoor
aabad94a81 Merge pull request #164 from semaphore-protocol/refactor/extension-contracts
Remove modifiers from proof verification functions

Former-commit-id: ba149545f2
2022-11-09 15:34:23 +01:00
cedoor
eeac211c01 refactor(contracts): remove modifier from proof verification functions
Former-commit-id: 99a358ca12
2022-11-09 15:13:12 +01:00
cedoor
6e0236e9bc Merge pull request #163 from semaphore-protocol/refactor/merkle-tree-attributes
Public `merkleTree` attribute and new method name

Former-commit-id: cf9f804651
2022-11-09 12:43:24 +01:00
cedoor
a9f8379545 refactor(groups): make attribute public and update method name
Former-commit-id: 822561a015
2022-11-09 12:29:58 +01:00
cedoor
ac3e7b42a3 chore: v2.6.1
Former-commit-id: ec5c69a795
2022-10-26 16:31:48 +02:00
cedoor
2b414f8c24 fix: set correct thegraph api urls
Former-commit-id: 29ebbe3b09
2022-10-26 16:28:26 +02:00
cedoor
1fcff83c1a style: format code with prettier
Former-commit-id: a5f1d80d84
2022-10-26 16:16:37 +02:00
cedoor
eb2d6ee62b chore: update arbitrum contract addresses
Former-commit-id: 6a60f727b8
2022-10-26 16:14:38 +02:00
cedoor
db624c24e0 style: format code with prettier
Former-commit-id: 9564ad19f0
2022-10-24 12:28:19 +02:00
cedoor
95e5ff669b chore: update goerli contract addresses
Former-commit-id: 88f44c3f49
2022-10-24 12:13:19 +02:00
cedoor
6a5e9e32d3 chore: update lockfile
Former-commit-id: c9b8ab574c
2022-10-19 19:06:50 +02:00
cedoor
08d7621fc2 chore: v2.6.0
Former-commit-id: 4e0500f9ce
2022-10-19 19:05:55 +02:00
cedoor
ca3a4c1971 style: format code with prettier
Former-commit-id: b574e6a1e8
2022-10-19 18:44:04 +02:00
cedoor
dc0ceee50d chore(contracts): update incremental-merkle-tree dep version
Former-commit-id: be82cf1104
2022-10-19 17:03:44 +02:00
cedoor
6fadd3e745 docs: update contributing file
Former-commit-id: fd9a00fd58
2022-10-19 09:57:47 +02:00
cedoor
e86228102e chore(contracts): update openzeppelin dependency version
Former-commit-id: 9eebe0173a
2022-10-19 09:55:40 +02:00
cedoor
91f56941b4 docs: update identity pkg readme description
Former-commit-id: 93e042cf34
2022-10-15 17:51:12 -05:00
cedoor
22aadf2745 docs: update identity pkg readme file
Former-commit-id: 5eb18bfe5d
2022-10-15 17:47:31 -05:00
cedoor
8458a623e0 Merge pull request #142 from semaphore-protocol/feat/identity-getters
New identity class getters

Former-commit-id: bbcb065224
2022-10-13 15:13:53 -05:00
cedoor
e6a3699a56 feat: add identity class getters
Former-commit-id: 401d303b39
2022-09-30 11:46:21 +02:00
cedoor
ed74eff52a docs: remove docs link for hardhat pkg
Former-commit-id: 26e0cbcc9d
2022-09-22 13:54:57 +02:00
cedoor
a7e5b28b00 docs: add hardhat package
Former-commit-id: 92dd1db419
2022-09-22 13:49:16 +02:00
cedoor
08576e1717 Merge pull request #140 from semaphore-protocol/feat/hardhat-plugin
feat: create semaphore hardhat plugin
Former-commit-id: ab41ff13fb
2022-09-22 13:39:01 +02:00
cedoor
80376ab81e feat: create semaphore hardhat plugin
Former-commit-id: 6ceb226f5e
2022-09-21 16:16:42 +02:00
cedoor
32efdd952b style: format code with prettier
Former-commit-id: d4f85d7d04
2022-09-19 17:13:46 +02:00
cedoor
f6b79ba5d2 chore: update goerli contract addresses
Former-commit-id: b117b1ff00
2022-09-19 17:09:16 +02:00
cedoor
1a995d7087 chore: v2.5.0
Former-commit-id: 68779e90a0
2022-09-19 16:54:51 +02:00
cedoor
20fc3c58d7 Merge pull request #138 from semaphore-protocol/feat/custom-nullifier-hashes
Custom nullifier hashes

Former-commit-id: 506fa0ab7d
2022-09-19 16:49:19 +02:00
cedoor
7329ca6a48 feat: move nullifier hashes out of SemaphoreCore
Former-commit-id: f57e21c77d
2022-09-19 16:36:30 +02:00
cedoor
0c9c0c9791 style: fix eslint errors
Former-commit-id: 0a821d8214
2022-09-19 13:15:19 +02:00
cedoor
39a7e32143 style: format code with prettier
Former-commit-id: eba7d053e7
2022-09-19 13:08:25 +02:00
cedoor
87c27b9d03 chore: update lockfile
Former-commit-id: 0654895c9a
2022-09-19 13:04:54 +02:00
cedoor
4d07a1ede5 chore: update semaphore dependencies
Former-commit-id: bf4f6f75cb
2022-09-19 13:02:30 +02:00
cedoor
55fbd0f2ed chore: v2.4.0
Former-commit-id: 21ea7e80e7
2022-09-19 13:00:18 +02:00
cedoor
6dca198995 refactor: update subgraph queries
Former-commit-id: f0825d738c
2022-09-19 12:57:59 +02:00
cedoor
5f80aab430 fix: set correct contract names
Former-commit-id: 13ca6a6854
2022-09-19 12:17:53 +02:00
cedoor
c30fbb8d1c chore: update goerli contract addresses
Former-commit-id: 58c08b1e41
2022-09-19 12:12:35 +02:00
cedoor
be1014452e refactor: update scripts and tasks to deploy contracts
Former-commit-id: e960722b08
2022-09-19 12:12:22 +02:00
cedoor
0036da93b1 Merge pull request #136 from semaphore-protocol/feat/group-nullifier-hashes
Feat/group nullifier hashes

Former-commit-id: f8d3b0ad0f
2022-09-18 21:03:12 +02:00
cedoor
c984adef0e feat: add proof parameters to ProofVerified event
Former-commit-id: 85d9de669b
2022-09-18 18:16:10 +02:00
cedoor
b2d8667963 feat: hash nullifier hash with group id
Former-commit-id: 0979b5aadd
2022-09-18 18:10:14 +02:00
cedoor
466be38e42 docs: fix circuit link
Former-commit-id: d5794cca97
2022-09-18 16:50:09 +02:00
cedoor
adcb8e085d ci: fix production workflow
Former-commit-id: 011ab2b053
2022-09-18 16:19:42 +02:00
cedoor
e9a3770a39 Merge pull request #134 from semaphore-protocol/chore/monorepo
Monorepo

Former-commit-id: 47b6f6eb39
2022-09-18 16:14:03 +02:00
cedoor
d9a1387f2a docs: update workflow label url
Former-commit-id: 6ad31e445a
2022-09-18 16:01:27 +02:00
cedoor
a6710ad435 ci: remove job dependency
Former-commit-id: 3a75b81dad
2022-09-18 16:01:16 +02:00
cedoor
3d3a63a10d build: set peer dependencies
Former-commit-id: 343e259956
2022-09-18 15:54:37 +02:00
cedoor
0daf5b7dae chore: move env variables to the root folder
Former-commit-id: 9d3fc642d2
2022-09-18 15:50:16 +02:00
cedoor
ef4b3dd4b2 ci: remove jobs dependencies
Former-commit-id: 7458bcc23c
2022-09-17 19:06:50 +02:00
cedoor
0f2a13463a chore: extend contracts tsconfig
Former-commit-id: af6e11c564
2022-09-17 18:52:39 +02:00
cedoor
0a305c019d ci: add script to build libs before testing
Former-commit-id: de26e4da81
2022-09-17 18:51:59 +02:00
cedoor
de8c7f20ca chore: set workspace dependencies
Former-commit-id: f048f4ec4e
2022-09-17 18:51:40 +02:00
cedoor
23d7fdff3a fix: set default tree depth
Former-commit-id: c488b6f8ed
2022-09-17 18:20:40 +02:00
cedoor
21b9965f57 ci: fix command name
Former-commit-id: a9315fc111
2022-09-17 12:52:49 +02:00
cedoor
023c8bae64 chore: ignore docs folder with eslint
Former-commit-id: 14fe1d531f
2022-09-17 12:50:40 +02:00
cedoor
0d771eb9fa ci: compile contracts before linting
Former-commit-id: 77604a2d64
2022-09-17 12:50:00 +02:00
cedoor
62f775737d style: format code with prettier
Former-commit-id: 6a65d6c2bf
2022-09-17 12:45:04 +02:00
cedoor
12aacf24b3 chore: ignore docs folder with prettier
Former-commit-id: 93bdfd4b14
2022-09-17 12:44:54 +02:00
cedoor
b450dcec79 ci: update github workflows
Former-commit-id: 9244f42c1a
2022-09-17 12:40:29 +02:00
cedoor
e909e1db99 test: set default tree depth
Former-commit-id: 024c16bcd2
2022-09-17 12:40:14 +02:00
cedoor
92c9c9bcc8 docs: set relative repo links
Former-commit-id: c163ff1dcc
2022-09-16 16:59:36 +02:00
cedoor
5588256072 docs: update readme files
Former-commit-id: 1e630902bc
2022-09-16 16:56:35 +02:00
cedoor
8cf04ddb98 chore: create semaphore monorepo
Former-commit-id: a38dd20276
2022-09-16 16:50:30 +02:00
cedoor
ecca5a4ee9 style: format code with prettier
Former-commit-id: 5fa34109c6
2022-09-15 15:52:27 +02:00
cedoor
0a5ebe60df chore: update goerli semaphore address
Former-commit-id: 1c41b8edf5
2022-09-14 16:22:57 +02:00
cedoor
12982f338a chore(contracts): v2.2.0
Former-commit-id: 8dc2c85b19
2022-09-14 15:31:32 +02:00
cedoor
47c7923723 Merge pull request #133 from semaphore-protocol/feat/member-index
feat: add member index parameter to events
Former-commit-id: 2bbacbe7cd
2022-09-14 15:30:02 +02:00
cedoor
a35a505b92 docs: fix typo
Former-commit-id: bcf09a6dd2
2022-09-14 15:25:34 +02:00
cedoor
9487de51b4 fix: set correct index value
Former-commit-id: cf3e877b36
2022-09-14 15:24:52 +02:00
cedoor
65fbd732f2 feat: add member index parameter to events
Former-commit-id: 21c461aaaf
2022-09-14 14:56:48 +02:00
cedoor
e6fe600ed0 docs: replace telegram chat with discord server
Former-commit-id: 8e841a36e5
2022-09-14 10:34:10 +02:00
cedoor
28694d3413 style: reformat code with prettier
Former-commit-id: c99579768a
2022-09-13 13:46:19 +02:00
cedoor
d5d065dfb0 chore: deploy new semaphore contract on georli
Former-commit-id: c179870662
2022-09-13 13:44:03 +02:00
cedoor
cb96c7c237 Merge branch 'dev' of github.com:semaphore-protocol/semaphore into dev
Former-commit-id: d9f23f76b4
2022-09-13 13:29:25 +02:00
cedoor
cca4cf4922 chore: remove kovan network
Former-commit-id: 6880f0d7f7
2022-09-13 13:28:29 +02:00
cedoor
a97a150e98 Merge pull request #131 from semaphore-protocol/feat/add-members
Function to add multiple members

Former-commit-id: 16b571fad9
2022-09-13 12:06:35 +02:00
cedoor
5167710bb2 feat: add function to add multiple members
Former-commit-id: 0100beafc7
2022-09-13 10:56:42 +02:00
cedoor
af878df5ab Merge pull request #129 from semaphore-protocol/refactor/extensions
Refactoring of extensions contracts

Former-commit-id: 2c2c02f82b
2022-09-09 16:34:23 +02:00
cedoor
e4e895a881 chore: update lockfile
Former-commit-id: be83f13ae8
2022-09-09 16:31:05 +02:00
cedoor
95ab343fcc refactor: create solidity errors for extensions
Former-commit-id: 4debf04e1b
2022-09-09 16:23:43 +02:00
cedoor
4f36e0587c refactor: create verifier struct for extensions
Former-commit-id: dad7efb9dd
2022-09-09 15:43:09 +02:00
cedoor
f50a0765fd chore: v2.1.0
Former-commit-id: 7620927c3c
2022-09-09 15:26:22 +02:00
cedoor
7739050346 Merge pull request #128 from semaphore-protocol/feat/update-member
New function to update group members

Former-commit-id: 2d4f2deb0a
2022-09-09 13:44:04 +02:00
cedoor
07f2e14fcb style: format code with prettier
Former-commit-id: 52837e7434
2022-09-09 13:38:17 +02:00
cedoor
f7d20a4760 feat: add function to update group members
Former-commit-id: 52645ae61a
2022-09-09 13:24:30 +02:00
cedoor
65e6d7b16c Merge pull request #124 from semaphore-protocol/feat/root-expirations
Merkle tree expiries

Former-commit-id: 4a94fb19a5
2022-09-09 11:39:43 +02:00
cedoor
dfac0716a5 feat: create struct for merkle tree expiries
Former-commit-id: eeb1a04baf
2022-09-09 11:33:14 +02:00
cedoor
43850ecd3c style: format code with prettier
Former-commit-id: aa01cd1016
2022-09-09 10:16:35 +02:00
cedoor
125947d179 feat: add merkle tree root expirations
Former-commit-id: 3495e147f1
2022-09-09 10:16:35 +02:00
cedoor
4643775745 refactor: update tree variable names
Former-commit-id: c191dbe0fc
2022-09-09 10:16:35 +02:00
cedoor
dd6b7765cf chore: update semaphore libraries
Former-commit-id: c2e0f372f1
2022-09-09 10:16:35 +02:00
cedoor
b7597485ec Merge pull request #126 from semaphore-protocol/fix/merkle-tree-dep
fix: bump version of incremental merkle tree pkg
Former-commit-id: f2bb6731eb
2022-09-09 10:13:24 +02:00
cedoor
47b06b057c fix: bump version of incremental merkle tree pkg
Former-commit-id: 5cd191e2d7
2022-09-09 09:57:19 +02:00
cedoor
c06a836687 fix: update tree depth uint type
Former-commit-id: 0f0fc95832
2022-08-22 18:59:51 +02:00
cedoor
7b3acfd68f Merge pull request #119 from semaphore-protocol/chore/etherscan-verification
Etherscan verification

Former-commit-id: 361bbf2d84
2022-08-22 18:57:51 +02:00
cedoor
972cbb632b chore: verify contracts on right networks
Former-commit-id: cfd678def2
2022-08-22 18:45:37 +02:00
cedoor
b37b0e2d7a chore: add @nomiclabs/hardhat-etherscan package
Former-commit-id: adc4489e19
2022-08-22 18:44:59 +02:00
cedoor
48928db10f chore: add etherscan verification after deployments
Former-commit-id: 03b9aa4198
2022-08-22 18:15:10 +02:00
cedoor
5fdf6c6547 style: format code with prettier
Former-commit-id: 4a2fddc5a0
2022-08-18 13:45:12 +02:00
cedoor
8be15f2926 Merge pull request #118 from DevABDee/main
Little More Gas Optimization

Former-commit-id: 7390c28ea1
2022-08-18 13:35:11 +02:00
ABDul Rehman
baf7b80f64 Merge branch 'semaphore-protocol:main' into main
Former-commit-id: 3b292393de
2022-08-17 21:18:52 +05:00
ABDul Rehman
b501fd6f01 Gas Optimization
Former-commit-id: bb7470ae8a
2022-08-17 21:17:43 +05:00
cedoor
78cbd16cb6 Merge pull request #117 from DevABDee/main
Little Gas Optimization

Former-commit-id: 96608b573d
2022-08-16 20:57:27 +02:00
ABDul Rehman
94331b07b0 Gas Optimization
Former-commit-id: e2912f1c0b
2022-08-16 18:06:51 +05:00
ABDul Rehman
f9ff3b1ac2 Gas Optimization
Former-commit-id: a87ea48b7f
2022-08-14 02:14:01 +05:00
cedoor
f59588ac2f Merge pull request #116 from DevABDee/main
Fix #115, Pragma Fixed

Former-commit-id: 708d93ce08
2022-08-10 17:02:29 +02:00
ABDul Rehman
b285a19186 Pragme Fixed
Former-commit-id: 866c54ddfe
2022-08-10 18:15:18 +05:00
cedoor
5e58a2dc4a perf: replace require with new gas-efficient errors
Former-commit-id: 9da8843487
2022-07-26 00:22:37 +02:00
cedoor
b7b6e452d8 chore: update snark artifacts url
Former-commit-id: 45b8e95a45
2022-07-26 00:20:00 +02:00
cedoor
78dcfe1816 chore: update lockfile
Former-commit-id: c9e20093e0
2022-07-26 00:19:22 +02:00
cedoor
f67cafeb02 Merge pull request #113 from DevABDee/main
Gas Optimized Semaphore.sol

Former-commit-id: 92c3b59cc1
2022-07-25 23:48:59 +02:00
AB Dee
9ca5d8b8cb Gas Optimized Semaphore.sol
Former-commit-id: c425695202
2022-07-25 19:49:34 +05:00
cedoor
b80fe7d1d9 chore: update incremental-merkle-tree.sol pkg
Former-commit-id: 76e5be06b2
2022-07-04 20:01:18 +02:00
cedoor
bf2f8024e3 chore: add yarn option to update lockfile
Former-commit-id: 44b5966633
2022-06-24 17:11:23 +02:00
cedoor
ba6acccffb docs: set dark-theme semaphore icon
Former-commit-id: e48d602c0e
2022-06-23 11:44:40 +02:00
cedoor
e829885311 style: format code with prettier
Former-commit-id: aba96f84f8
2022-06-22 20:31:31 +02:00
cedoor
84e92ed975 chore: deploy contracts on arbitrum
Former-commit-id: 1357c94b59
2022-06-22 20:17:38 +02:00
cedoor
05adc1e2fe chore(contracts): v2.0.0
Former-commit-id: 24c5bce29a
2022-06-22 11:29:09 +02:00
cedoor
971b354e1c chore: update semaphore-protocol packages
Former-commit-id: a9bc12927f
2022-06-15 15:27:06 +02:00
cedoor
fa1e86c3b0 chore: update prettier ignore file
Former-commit-id: 77ef2e4883
2022-06-09 10:43:55 +02:00
cedoor
621f56a0c6 docs: add network template
Former-commit-id: f538af070b
2022-06-09 10:42:04 +02:00
cedoor
5470804e1c ci: ignore checksum checks
Former-commit-id: 31d746e8e6
2022-06-08 14:45:30 +02:00
cedoor
17e683debe ci: add yarn command to update cache
Former-commit-id: 2c0e93923b
2022-06-08 14:16:09 +02:00
cedoor
29090843aa chore: update ethereum-waffle package
Former-commit-id: b2f71bbae9
2022-06-08 14:15:52 +02:00
cedoor
d7c677bb05 chore: update dependencies
Former-commit-id: 06ef87c734
2022-06-08 14:00:20 +02:00
cedoor
16ebaa61e5 ci: remove cache option
Former-commit-id: c9fc9a7b1e
2022-06-08 13:29:37 +02:00
cedoor
52581a6d56 ci: update github workflows and add cache action
Former-commit-id: 633fab3de4
2022-06-08 13:08:24 +02:00
cedoor
43803ec21d chore: update yarn to v3
Former-commit-id: a8fb2e8e50
2022-06-08 13:07:57 +02:00
cedoor
79313cbf6c chore: update ignore files
Former-commit-id: ba11a0ab35
2022-06-08 13:07:08 +02:00
cedoor
36c3252b0c docs(readme): add label for style github workflow
Former-commit-id: 16041ca76e
2022-06-08 13:06:28 +02:00
cedoor
168215d23e docs(readme): update usage section
Former-commit-id: bd90739de0
2022-06-08 12:29:33 +02:00
cedoor
75bef955ab docs(readme): add readme for contracts npm package
Former-commit-id: 2a84024d10
2022-06-08 12:09:58 +02:00
cedoor
68a65f9645 docs(readme): remove audit warning
Former-commit-id: 58f385fa7e
2022-06-07 15:16:33 +02:00
cedoor
13b724a34f docs: replace zk-kit with semaphore.js libs
Former-commit-id: add2e545dc
2022-06-06 16:36:37 +02:00
cedoor
073ec22b34 refactor: replace zk-kit packages with semaphore.js
Former-commit-id: bfa909f7e8
2022-06-06 15:35:28 +02:00
cedoor
5d6f7b0629 style: format code with prettier
Former-commit-id: 7826f6f7b3
2022-06-06 15:35:01 +02:00
cedoor
75fc12f867 ci: add env variables
Former-commit-id: e24ca5f8f4
2022-06-06 12:07:24 +02:00
cedoor
e21ccedc15 chore: update scripts to download snark artifacts
Former-commit-id: d9c069784f
2022-06-06 12:01:24 +02:00
cedoor
68187531a5 chore: remove unused extensions
Former-commit-id: 0ae62c1f16
2022-06-06 12:00:27 +02:00
cedoor
3dba37fd06 chore: add env variable for tree depth
Former-commit-id: 496d0748a5
2022-06-06 11:59:37 +02:00
cedoor
17234ddfd2 docs: update description
Former-commit-id: ae439cac78
2022-05-31 23:24:08 +02:00
cedoor
536cf452bb ci: add command to download zk files
Former-commit-id: e064191ba7
2022-05-31 19:15:03 +02:00
cedoor
efe56e80ac chore: ignore verifiers from test coverage
Former-commit-id: 0bcba687e8
2022-05-31 19:14:49 +02:00
cedoor
f09e930857 docs: update package descriptions
Former-commit-id: abc77d0cb4
2022-05-31 19:01:21 +02:00
cedoor
2e5650a5b8 chore: v0.2.0
Former-commit-id: b591914573
2022-05-31 18:49:15 +02:00
cedoor
7c3763c012 Merge pull request #109 from semaphore-protocol/feat/new-verifiers
Feat/new verifiers

Former-commit-id: d24c516e73
2022-05-31 18:25:53 +02:00
cedoor
e67cf5d75b style: format code with prettier
Former-commit-id: 491ec8b864
2022-05-31 18:22:30 +02:00
cedoor
5a99b66f18 chore: add some env variables
Former-commit-id: f5bc809010
2022-05-31 18:20:50 +02:00
cedoor
df9286a455 docs: add install and usage sections
Former-commit-id: 280289171f
2022-05-31 18:19:55 +02:00
cedoor
f4dd5ba694 chore: add new script to deploy all contracts
Former-commit-id: 2145c141a1
2022-05-30 21:34:55 +02:00
cedoor
8c49c4ed14 docs: update contract addresses
Former-commit-id: 6083ffdb72
2022-05-30 20:17:29 +02:00
cedoor
1f805543e8 ci: add script to download zk files
Former-commit-id: 89b5644c02
2022-05-30 20:17:29 +02:00
cedoor
a674301faf test: update tests with new verifiers
Former-commit-id: 44e21911c5
2022-05-30 20:17:16 +02:00
cedoor
12e92840a4 feat: add new scripts
Former-commit-id: c70b85e36c
2022-05-30 20:17:16 +02:00
cedoor
ac7f03a695 feat: generate new verifier contracts
Former-commit-id: 9c4b9efa10
2022-05-30 20:17:16 +02:00
cedoor
20036c3739 chore: remove old zk files
Former-commit-id: 550c9edc04
2022-05-30 20:17:16 +02:00
cedoor
8826ddb47b docs: add section for issues
Former-commit-id: 6fd358f8a2
2022-05-26 21:37:21 +02:00
cedoor
c074930aad chore: add issue template for semaphore projects
Former-commit-id: 22345287f5
2022-05-26 21:32:04 +02:00
cedoor
f2a1d50603 chore: update PR template
Former-commit-id: 2664ea8cdc
2022-05-26 21:07:05 +02:00
cedoor
3dc63c83bb docs: update issues' link
Former-commit-id: 608fa4f07a
2022-05-26 20:56:27 +02:00
cedoor
0f62fe1356 chore: remove old issue templates
Former-commit-id: d232e4546b
2022-05-26 20:31:20 +02:00
cedoor
10562ca54f chore: update issue templates
Former-commit-id: 943616f091
2022-05-26 20:30:21 +02:00
cedoor
f237a44980 docs: fix language label repo link
Former-commit-id: d2fc3543d3
2022-05-24 12:41:37 +02:00
cedoor
ec99ab0759 docs: update repo links
Former-commit-id: e69ba9f384
2022-05-24 12:40:06 +02:00
cedoor
7c48005647 chore: update repo links
Former-commit-id: ee7aad1dd7
2022-05-19 11:32:04 +02:00
cedoor
3b61ceebde chore: update license holder
Former-commit-id: f86e5b4217
2022-05-19 11:31:54 +02:00
cedoor
0d43e0b4c8 chore: update contracts package name
Former-commit-id: 35735c4e87
2022-05-17 12:54:11 +02:00
cedoor
6cf990bc22 Merge pull request #100 from semaphore-protocol/feat/new-snarks-template
feat: create new snarkjs groth16 template
Former-commit-id: 7f2042312d
2022-05-17 11:40:37 +02:00
cedoor
9875778ad9 chore: move docs to semaphore-protocol org
Former-commit-id: d88e4e9146
2022-05-07 11:01:21 +02:00
cedoor
6ef014fa7c chore: v0.10.0
Former-commit-id: 6d4bb60ea9
2022-05-07 10:58:06 +02:00
cedoor
06fbe09823 feat: add zero value parameter
Former-commit-id: 339d3ac7da
2022-05-07 10:56:51 +02:00
cedoor
80d3ffb622 chore: v0.9.0
Former-commit-id: 368b5ce2f2
2022-05-04 19:36:25 +02:00
cedoor
52dbe8b14e docs: add missing word
Former-commit-id: 5bd3df387d
2022-05-04 18:38:53 +02:00
cedoor
c4207c73b0 chore: remove unused cname file
Former-commit-id: 207da78b1a
2022-05-04 18:37:52 +02:00
cedoor
45a74798c7 Merge pull request #104 from appliedzkp/feat/semaphore-contract
feat: create new semaphore deployable contract
Former-commit-id: 248d7873df
2022-05-04 18:34:55 +02:00
cedoor
5e7c3a5ae9 style: format code with prettier
Former-commit-id: b29d6c5ba6
2022-05-04 18:32:15 +02:00
cedoor
4975db4f58 docs: add section for semaphore deployed contracts
Former-commit-id: 2f50cbd13f
2022-05-04 18:31:41 +02:00
cedoor
aa96f0bbc1 feat: create new semaphore deployable contract
Former-commit-id: 87c379f5a9
2022-05-04 15:46:07 +02:00
cedoor
6e5c6fc84c docs: fix broken link
Former-commit-id: c8fc878324
2022-05-04 11:05:27 +02:00
cedoor
8c1119dba1 Merge pull request #103 from 0xorbus/3-fix-quick-setup-tutorial
3 fix quick setup tutorial

Former-commit-id: 3ce7e3b8f3
2022-05-04 10:59:14 +02:00
0xorbus
68f4bead0e docs: quick-setup.md
- fix indent.

Former-commit-id: 9aa5b656a7
2022-05-03 22:33:07 -07:00
0xorbus
bd78a71387 docs: quick-setup.md
- fix indent

Former-commit-id: c24fe8cf6c
2022-05-03 22:32:08 -07:00
0xorbus
e8f34ea272 docs: update quick-setup.md
- improve static files requirement.

Former-commit-id: 35fe024e98
2022-05-03 22:29:54 -07:00
0xorbus
2a4e92449b Update quick-setup.md
- Cleanup and organize quick-setup.md

Former-commit-id: 6e6c5aacd3
2022-05-03 22:26:55 -07:00
0xorbus
57b61614c4 docs(quick-setup): fix contract, tests, and instructions
- Update Greeters.sol to match the example repo and fix the missing variables error.
- Add chai to dependencies to install for hardhat-waffle.
- Remove unnecessary $ to prevent copying them.
- Fix text.
- Add explanation.


Former-commit-id: 6ab4526b0e
2022-05-01 19:07:20 -05:00
0xorbus
45f48799f0 wip: remove unnecessary $ terminal prompts.
Former-commit-id: 079e6eac27
2022-05-01 18:32:14 -05:00
cedoor
42c934ec1b docs: set correct etherscan link
Former-commit-id: 95f127d149
2022-04-22 17:57:03 +02:00
cedoor
35822a480e feat: integrate georli network
Former-commit-id: 84d70cb863
2022-04-22 12:14:24 +02:00
cedoor
56edbb6cd7 chore: remove unused images
Former-commit-id: 72dbe85827
2022-04-19 16:35:33 +02:00
cedoor
d0962fda19 chore: update semaphore icon
Former-commit-id: 2b5849077d
2022-04-19 11:54:46 +02:00
cedoor
d17c4a6e0c chore: v0.8.1
Former-commit-id: 6b84d41ca3
2022-04-13 12:50:48 +02:00
cedoor
4080f4af20 docs: update quick-setup contract code
Former-commit-id: 64a63cbceb
2022-04-13 12:50:16 +02:00
Omar Desogus
9e74e1a278 Merge pull request #102 from 0xorbus/docs/basic-features
Docs/basic features

Former-commit-id: 7f0568b10c
2022-04-13 12:48:58 +02:00
0xorbus
a8e0c1474c docs: fix quick setup
- improve instruction
- fix caps
- fix list indent


Former-commit-id: ab88231e92
2022-04-12 21:44:12 -05:00
cedoor
d1fcf8bfe2 chore: update wrong license
Former-commit-id: ae7e18c120
2022-04-12 17:19:17 +02:00
0xorbus
5a895f42f8 docs: Replace names with handles.
- Quick start: replace package names with handles.


Former-commit-id: 702fbd406b
2022-04-12 00:01:15 -05:00
0xorbus
8a44757417 docs: revise Quick setup
- Revise intro, Hardhat, and libraries description.


Former-commit-id: d7da4e9fa8
2022-04-11 23:53:10 -05:00
0xorbus
ad1d77b200 docs: explain base contract step
- Provide context about importing Semaphore base contract.
- Add link.


Former-commit-id: e51af6e0e1
2022-04-11 23:51:49 -05:00
0xorbus
c31b9490ed docs: revise Quick Setup
- Revise Quick Setup intro and instructions.
- Make related and advanced usage less distracting for new devs.
- Add instruction to use Node.JS LTS given Hardhat install fails with
  Node.JS current.


Former-commit-id: bea97dae22
2022-04-11 23:51:49 -05:00
cedoor
4aeeb3e1cc docs: update quick-setup section
Former-commit-id: 42e6020380
2022-04-11 19:41:38 +02:00
cedoor
23dac4c6ed chore: deploy new verifier
Former-commit-id: b7aa75194c
2022-04-11 19:28:44 +02:00
cedoor
4c4bfb568a chore: v0.8.0
Former-commit-id: 54a5801b16
2022-04-11 19:15:51 +02:00
Omar Desogus
8595e3cd0f Merge pull request #101 from 0xorbus/docs/basic-features
docs:update links and revise docs instructions
Former-commit-id: 9f19a259de
2022-04-06 18:11:16 +02:00
0xorbus
01a5b156bb docs: Update docs/README.md
- Revise intro
Former-commit-id: e48e85b58c
2022-04-06 08:38:56 -05:00
0xorbus
dd19a5e213 docs:update links and revise docs instructions
- Update links to the new domain.
- Revise install, build, and run instructions for docs contributors.


Former-commit-id: b6cf8a2b6c
2022-04-06 08:21:29 -05:00
cedoor
9e2b54ef16 feat: create new snarkjs groth16 template
Former-commit-id: 74a5653406
2022-04-04 11:57:02 +02:00
Omar Desogus
51fe424473 Merge pull request #96 from recmo/recmo/chore-cleanup-verifier
Cleanup Verifier.sol and make error handling consistent

Former-commit-id: d001dd928b
2022-04-04 11:01:44 +02:00
Remco Bloemen
5dbfaf3518 Run prettier
Former-commit-id: 2ddf0f0b2e
2022-04-03 14:54:13 -07:00
Remco Bloemen
4e18efb75c Remove redundant return value.
Former-commit-id: 3e4a493177
2022-04-02 15:05:04 -07:00
cedoor
55a89753bb chore: update package.json license
Former-commit-id: 36824964f5
2022-03-31 19:06:09 +02:00
Omar Desogus
8105d9761b Merge pull request #99 from appliedzkp/chore/new-license
Update LICENSE

Former-commit-id: e19b78e90e
2022-03-31 19:01:57 +02:00
Omar Desogus
55cef34142 Update LICENSE
Former-commit-id: cfe2d92f58
2022-03-31 18:53:35 +02:00
Remco Bloemen
bf42264033 Minor fixes
Former-commit-id: 3be4b8cf49
2022-03-24 12:07:12 -07:00
Remco Bloemen
0035a62d7a Strict input validation in Pairing library
Former-commit-id: 7ec0831817
2022-03-24 10:36:59 -07:00
Remco Bloemen
d34bded3cc Unroll loop
Former-commit-id: cfa237ec90
2022-03-23 16:05:56 -07:00
Remco Bloemen
e156cf77c2 Update tests
Former-commit-id: 39cd58d218
2022-03-23 16:04:09 -07:00
Remco Bloemen
4d662a4a0d Changelog
Former-commit-id: 6407cefc40
2022-03-23 15:58:59 -07:00
Remco Bloemen
67e907da2c Remove redundant check
Former-commit-id: a46219f35f
2022-03-23 15:57:07 -07:00
Remco Bloemen
7771f15e5a Avoid an addition
Former-commit-id: 4ced797f9b
2022-03-23 15:53:14 -07:00
Remco Bloemen
aff0c87366 Inline pairingProd4
Former-commit-id: f263f40c13
2022-03-23 15:48:58 -07:00
Remco Bloemen
77bc53d9a7 Remove unused code
Former-commit-id: d205047891
2022-03-23 15:38:58 -07:00
Remco Bloemen
2965d8decf always throw on invalid proof
Former-commit-id: fde613e9c2
2022-03-23 15:37:56 -07:00
Remco Bloemen
528ad6ef4e Remove unused code
Former-commit-id: 475165fb77
2022-03-23 15:05:31 -07:00
Remco Bloemen
bd2145dc09 Moduli constants
Former-commit-id: 66681720bb
2022-03-23 11:59:11 -07:00
Remco Bloemen
67dd25e604 Inline verify
Former-commit-id: edd06371aa
2022-03-23 11:53:37 -07:00
Remco Bloemen
25379748e6 Avoid unecessary copy
Former-commit-id: 6677c27f92
2022-03-23 11:51:45 -07:00
Remco Bloemen
9e6c0df6a2 Remove invalid() hack
Former-commit-id: f4afe22822
2022-03-23 11:49:42 -07:00
Remco Bloemen
07cbe28701 Verify returns bool
Former-commit-id: 4c5fa94650
2022-03-23 11:42:05 -07:00
cedoor
d212947d07 chore: v0.7.0
Former-commit-id: 27ae2fd99e
2022-03-17 12:11:45 +01:00
Omar Desogus
bdffdfe200 Merge pull request #95 from appliedzkp/refactor/root-history
refactor: remove root history mapping
Former-commit-id: 555b397634
2022-03-17 12:09:16 +01:00
cedoor
a8922efae1 refactor: remove root history mapping
Former-commit-id: c6667d98b8
2022-03-17 12:02:19 +01:00
Omar Desogus
4ee9913035 Merge pull request #94 from CDDelta/patch-1
docs: correct `Nullifier` technical reference inputs
Former-commit-id: 4e6be04729
2022-03-12 14:02:04 +01:00
CDDelta
04df22ed56 docs: correct Nullifier technical reference inputs
Former-commit-id: 5c6d1a6af2
2022-03-12 16:07:54 +11:00
cedoor
abc8ef3cf6 chore: v0.6.2
Former-commit-id: 3d846dafbb
2022-03-10 18:52:14 +01:00
Omar Desogus
c2a8aee15e Merge pull request #93 from vplasencia/patch-1
Just a little typo Merke -> Merkle

Former-commit-id: 6034131b0c
2022-03-10 14:31:28 +01:00
Vivian Plasencia
292ce60b81 Just a little typo Merke -> Merkle
Former-commit-id: fa6410bd0c
2022-03-09 23:32:02 -05:00
Omar Desogus
3a64ab44dd Merge pull request #92 from tomoima525/tomoima525/fix-voting-interface
Correct interface arguments in Voting Contract

Former-commit-id: 7aff72cea8
2022-03-10 00:05:42 +01:00
Omar Desogus
d597b461a7 Merge pull request #91 from appliedzkp/fix/group-id-value
Fix/group id value

Former-commit-id: aacbb11640
2022-03-10 00:01:44 +01:00
Tomoaki Imai
a7a42f8d2c Correct interface arguments in Voting Contract
Former-commit-id: bd77784a3c
2022-03-09 10:13:34 -08:00
cedoor
9f7aa7955f chore: v0.6.1
Former-commit-id: 5d8243c879
2022-03-09 18:43:34 +01:00
cedoor
2ffaf28a12 fix: add check to ensure group id is valid zk value
Former-commit-id: fd3cc6f7db
2022-03-09 18:43:06 +01:00
cedoor
bfaeb19d14 chore: update zk-kit/incremental-merkle-tree.sol pkg
Former-commit-id: 8022e4bb50
2022-03-09 18:15:29 +01:00
cedoor
aed9fa6785 docs: update quick setup section
Former-commit-id: 5186a940ff
2022-03-04 12:44:32 +01:00
Omar Desogus
ac1ad33bfd Merge pull request #89 from appliedzkp/perf/signal-type
Perf/signal type

Former-commit-id: d70ae21ed9
2022-03-04 12:37:24 +01:00
cedoor
e0e366c52a chore: v0.6.0
Former-commit-id: a9ba5c550c
2022-03-04 12:33:51 +01:00
cedoor
e6f7df17a9 perf: change signal type from string to bytes32
Former-commit-id: a48eb58eff
2022-03-04 12:32:49 +01:00
cedoor
c610ddb45a chore: v0.5.0
Former-commit-id: 119c7d1880
2022-03-01 13:05:24 +01:00
cedoor
8c7d09a5c1 refactor: rename group 'getSize' function
Former-commit-id: db262484d0
2022-03-01 13:01:33 +01:00
cedoor
8d5968a3c0 docs: update quick-setup section
Former-commit-id: 1090307adf
2022-02-28 17:23:44 +01:00
cedoor
936e0d76a6 chore: update @zk-kit/protocols pkg
Former-commit-id: 79a15cd43b
2022-02-28 17:20:45 +01:00
cedoor
b5389fed3d chore: update @zk-kit/protocols pkg
Former-commit-id: 4aced8e73e
2022-02-27 19:37:40 +01:00
cedoor
5f1ed4e08e chore: v0.4.0
Former-commit-id: e56609cc4d
2022-02-25 11:03:53 +01:00
cedoor
37bb2976b8 feat: add parameter to set tree zero value
Former-commit-id: 547f5476f2
2022-02-25 10:59:38 +01:00
cedoor
17e6330798 style: format code with prettier
Former-commit-id: 116e683313
2022-02-25 10:59:06 +01:00
cedoor
a4ecc5a125 docs: update quick setup section
Former-commit-id: f0cf3327f7
2022-02-19 15:37:48 +01:00
cedoor
9bfe26d81d chore(contracts): v0.3.0
Former-commit-id: 6f870c84b9
2022-02-19 15:19:08 +01:00
Omar Desogus
9756917fc7 Merge pull request #88 from appliedzkp/feat/external-verifiers
Feat/external verifiers

Former-commit-id: b22e51c668
2022-02-18 22:19:28 +01:00
Omar Desogus
83e29909c3 docs: add deployed verifiers
Former-commit-id: d89e213abf
2022-02-18 16:07:48 +01:00
cedoor
ae22bd7be9 chore: add kovan & arbitrum networks
Former-commit-id: 7d88065862
2022-02-18 15:45:13 +01:00
cedoor
3295483a24 feat: make verifiers external contracts
Former-commit-id: 6fee508029
2022-02-18 15:36:34 +01:00
cedoor
b21a17ea70 chore: add prettier docs to be ignored
Former-commit-id: 69964939ea
2022-02-18 15:35:41 +01:00
cedoor
d1419045e3 docs: update interep links
Former-commit-id: bd0571d366
2022-02-16 17:54:01 +01:00
cedoor
c136ba809f docs: update technical circuit section
Former-commit-id: 6d724270cc
2022-02-15 11:34:51 +01:00
Omar Desogus
bf87f4a3af Merge pull request #87 from appliedzkp/feat/binary-tree
feat: replace quin tree with binary tree
Former-commit-id: 8546570942
2022-02-14 18:45:03 +01:00
cedoor
7ddd0e0920 docs: update quick-setup section
Former-commit-id: 4d85db7d40
2022-02-14 18:37:10 +01:00
cedoor
498d14cde1 chore(semaphore-contracts): v0.2.0
Former-commit-id: a2696d3729
2022-02-14 18:31:24 +01:00
cedoor
91867d53aa chore: update @zk-kit/protocols pkg
Former-commit-id: 0f576f972a
2022-02-14 18:20:37 +01:00
cedoor
dbc9ae303d test: update new identity commitments
Former-commit-id: 59a039fe5b
2022-02-14 17:58:42 +01:00
cedoor
0c9d717fa8 feat: replace quin tree with binary tree
Former-commit-id: 3bce72febe
2022-02-14 17:44:00 +01:00
cedoor
a6256d2cdb chore: update @zk-kit/protocols pkg
Former-commit-id: 286bb4a7b1
2022-02-14 13:59:35 +01:00
cedoor
9944eb3746 chore: update @zk-kit/protocols pkg
Former-commit-id: 0aaf342470
2022-02-14 13:29:46 +01:00
cedoor
d5fd1f99a3 docs: add semaphore v1 reference
Former-commit-id: 06beb5864a
2022-02-14 13:29:08 +01:00
Omar Desogus
71dc72daa8 Merge pull request #61 from appliedzkp/version/2.0.0
version 2.0

Former-commit-id: fffab693e1
2022-02-14 12:36:32 +01:00
cedoor
7dd398ebd9 docs: update quick-setup section
Former-commit-id: 928b4094f3
2022-02-14 12:23:16 +01:00
cedoor
28990a27f3 docs: update quick-setup section
Former-commit-id: f60cf41495
2022-02-14 12:18:56 +01:00
cedoor
7993440e53 chore: update @zk-kit/protocols pkg
Former-commit-id: eb611ddc63
2022-02-14 12:15:11 +01:00
cedoor
05c26c108c docs: update technical reference sections
Former-commit-id: a2bc731c77
2022-02-14 10:50:44 +01:00
cedoor
940e6fcb75 docs: remove old content
Former-commit-id: fc0e55368e
2022-02-14 10:50:00 +01:00
cedoor
31e885a075 docs: update introduction
Former-commit-id: 3a6289402e
2022-02-13 12:34:08 +01:00
cedoor
d37deffb73 docs: init contract & zk-kit technical sections
Former-commit-id: 77859a6424
2022-02-13 12:33:56 +01:00
Omar Desogus
9285fe54e6 docs: remove install & usage sections
Former-commit-id: 5bcbe8d483
2022-02-13 11:50:36 +01:00
cedoor
7095e03162 docs: fix worng link
Former-commit-id: adf6a0f866
2022-02-12 16:06:27 +01:00
cedoor
ce09c9e4dd docs: update offchain function to create 0 value
Former-commit-id: e029c722b6
2022-02-12 15:59:55 +01:00
cedoor
17d616e0ba chore: add verification_key zk file
Former-commit-id: ef8c4a7bfe
2022-02-12 15:59:04 +01:00
cedoor
af6f040429 docs: update quick-setup section
Former-commit-id: 8605f3a5b1
2022-02-12 15:58:32 +01:00
cedoor
eeb65e4639 docs: update introduction section
Former-commit-id: f075a148e1
2022-02-12 15:58:14 +01:00
cedoor
aa544bf2c9 docs: update semaphore contracts pkg name
Former-commit-id: 4c29901ce8
2022-02-11 09:50:56 +01:00
cedoor
967e93789e chore: update contract npm pkg name
Former-commit-id: 18c42499d0
2022-02-10 13:29:35 +01:00
cedoor
ec5c6a1c23 fix: remove wrong doc links
Former-commit-id: db9a65a2c6
2022-02-10 13:28:35 +01:00
cedoor
79a6bfcbf7 docs: create docs v2 structure
Former-commit-id: 7cf4bedfe6
2022-02-10 13:21:07 +01:00
cedoor
a08c5460c3 docs: remove new files from V1 doc
Former-commit-id: bb1aebc51b
2022-02-10 12:32:15 +01:00
cedoor
1259d8e53e build: uncomment zksnark commands for verifier
Former-commit-id: 7dfc2eea8d
2022-02-10 12:24:10 +01:00
cedoor
bea3aca4a9 chore: v0.1.0
Former-commit-id: 6fef3abb10
2022-02-10 11:35:04 +01:00
cedoor
04e89d83e0 chore: update snark files
Former-commit-id: 5dab02846a
2022-02-10 11:32:27 +01:00
cedoor
83798c959e chore: update zk-kit/protocols & snarkjs pkgs
Former-commit-id: 70aa93f2d6
2022-02-10 11:22:37 +01:00
cedoor
23a9fe78bf docs: create multi-version docs
Former-commit-id: a7e1805782
2022-02-09 16:58:12 +01:00
cedoor
108160740d chore: update zk-kit ts libraries
Former-commit-id: cfb532e07c
2022-02-09 15:30:58 +01:00
cedoor
fdc66d3769 chore: update verifier sol path
Former-commit-id: 441d4f799e
2022-02-09 12:39:07 +01:00
Omar Desogus
bad1176c60 docs: create initial install & usage sections
Former-commit-id: dd7f6ade4e
2022-02-08 13:15:34 +01:00
cedoor
6d8511c35c chore: create specific npm package for contracts
Former-commit-id: cb8143d612
2022-02-08 12:11:15 +01:00
cedoor
ec48e81fe0 style: format code with prettier
Former-commit-id: 7b1e95f1e3
2022-02-08 11:54:26 +01:00
cedoor
bf7dda0666 test: add missing tests
Former-commit-id: 671db41d80
2022-02-08 11:51:47 +01:00
cedoor
ccb1d762c4 refactor: remove unnecessary requires
Former-commit-id: f5d5320945
2022-02-08 11:51:30 +01:00
cedoor
6ecf6c20af fix: set correct require condition
Former-commit-id: 18fe0ed2af
2022-02-08 11:50:48 +01:00
cedoor
e575c6025b test: add tests & update fun to create mt proofs
Former-commit-id: 3a344ff2a7
2022-02-07 18:24:20 +01:00
cedoor
1f4120f30d feat: add method to remove whistleblowers
Former-commit-id: a9c5bcc2bf
2022-02-07 18:23:50 +01:00
cedoor
ea6ff9d6a9 refactor: remove unused core modifier
Former-commit-id: a8910477b7
2022-02-07 18:22:41 +01:00
cedoor
ec7387f1c5 test: add util function to create merkle proofs
Former-commit-id: e2e4201e45
2022-02-07 18:21:58 +01:00
cedoor
04e716a917 style: format code with prettier
Former-commit-id: f0751c978a
2022-02-07 17:09:20 +01:00
cedoor
3efea8c2bf revert: remove unused contract for external nullifiers
Former-commit-id: 413191ee39
2022-02-07 17:09:02 +01:00
cedoor
a38c5b4360 test: add whistleblowing contract base tests
Former-commit-id: 29e5970799
2022-02-07 17:01:24 +01:00
cedoor
fd7342f5b3 chore: add hardhat task to deploy whistleblowing contract
Former-commit-id: 7bbea2976c
2022-02-07 17:00:58 +01:00
cedoor
7ca5de85d6 refactor: replace signal bytes type with string
Former-commit-id: f1a1ca09ff
2022-02-07 16:25:30 +01:00
cedoor
6d313e194e feat: add whistleblowing extension contract
Former-commit-id: cec6ef81b0
2022-02-07 16:24:21 +01:00
cedoor
e9ed84c868 chore: update zk-kit ts packages
Former-commit-id: 1918e8508b
2022-02-07 12:23:10 +01:00
cedoor
010726618e perf: remove unnecessary root check
Former-commit-id: 9afd500455
2022-02-07 11:26:01 +01:00
cedoor
df0c87f5e7 style: format code with prettier
Former-commit-id: 905eca9a4b
2022-02-07 11:05:56 +01:00
cedoor
55079c25a9 chore: increase reason string length
Former-commit-id: a9b92c83dd
2022-02-07 11:05:17 +01:00
cedoor
1242e73d34 chore: update verifier path
Former-commit-id: f8e9b32580
2022-02-07 11:04:45 +01:00
cedoor
1be081c10a chore: create contract folders
Former-commit-id: 7153043dce
2022-02-07 10:54:51 +01:00
Omar Desogus
4a4ef3d3bf Merge pull request #79 from appliedzkp/feat/modular-contracts
Feat/modular contracts

Former-commit-id: fc6be0f842
2022-02-04 21:55:00 +01:00
cedoor
ba02e7719f test: add tests for semaphore voting contract
Former-commit-id: d9213a2737
2022-02-04 20:26:59 +01:00
cedoor
406424c0a3 refactor: remove timestamps and add poll state
Former-commit-id: 3d01e97c88
2022-02-04 20:26:27 +01:00
cedoor
633a1a7a19 feat: add new zero value constant
Former-commit-id: f4210d6936
2022-02-04 13:02:50 +01:00
cedoor
3680cc294d chore: update some function comments
Former-commit-id: 2e14916c59
2022-02-04 12:52:49 +01:00
cedoor
6d51e94a88 refactor: udpate method names
Former-commit-id: e1189f316d
2022-02-04 12:52:30 +01:00
cedoor
9bd085195f feat: create semaphore voting interface
Former-commit-id: 3f9e35315f
2022-02-04 12:51:04 +01:00
cedoor
0826bbcfa3 chore: update deploy task contract name
Former-commit-id: 2caed5d274
2022-02-03 21:52:50 +01:00
cedoor
4c643f012b perf: replace memory signal type with calldata
Former-commit-id: 67864e2e91
2022-02-03 21:49:13 +01:00
cedoor
1a3d35662c refactor: remove underscore from parameters
Former-commit-id: c4e71f5497
2022-02-03 21:47:49 +01:00
cedoor
064aa99b3d refactor: update group id type
Former-commit-id: 9f002d2967
2022-02-03 21:37:46 +01:00
cedoor
eec2ff5c1f feat: add core function to check proof validity
Former-commit-id: fdd4cef3b1
2022-02-03 21:37:22 +01:00
cedoor
7527f159ad feat: create semaphore voting contract
Former-commit-id: 55d2ff7b1f
2022-02-03 21:35:46 +01:00
cedoor
f06a12535f feat: create abstract contract for nullifiers
Former-commit-id: 7b2b4fd0c9
2022-02-03 15:39:27 +01:00
cedoor
7ad7acfb54 refactor: update semaphore group contract
Former-commit-id: 1f510d6011
2022-02-03 15:38:39 +01:00
cedoor
76092003f7 feat: create contract for shared constants
Former-commit-id: b9f9d2fdfc
2022-02-03 15:38:11 +01:00
cedoor
817783e797 feat: create semaphore core interface
Former-commit-id: 26db39573c
2022-02-03 15:37:37 +01:00
cedoor
14a7493cc8 feat: create abstract contract for groups
Former-commit-id: d2f2357f19
2022-02-03 15:00:49 +01:00
cedoor
f15ba8fcda feat: create core semaphore contract
Former-commit-id: d0af5644d4
2022-02-03 14:59:29 +01:00
cedoor
4e04ba2413 chore: update zk-kit mt libraries
Former-commit-id: 87e12dd277
2022-02-03 10:39:35 +01:00
cedoor
5b9a4aaceb chore: update circuit scheme
Former-commit-id: d97711438d
2022-02-03 10:38:51 +01:00
cedoor
af9b07aa20 refactor: add zk-kit solidity quin tree
Former-commit-id: 827654cba2
2022-02-02 18:02:56 +01:00
cedoor
1ca9e568c4 chore: add zk-kit mt contracts
Former-commit-id: 143a6572c1
2022-02-01 19:24:17 +01:00
cedoor
c21d0b6e6b feat: modularize contracts
Former-commit-id: 431cac261b
2022-02-01 15:25:50 +01:00
cedoor
56716cb258 chore: add circuit scheme
Former-commit-id: f169951820
2022-01-31 16:51:10 +01:00
Omar Desogus
04b585021f chore: update LICENSE file
Former-commit-id: 575b25f205
2022-01-28 20:06:04 +01:00
Omar Desogus
2a44bd6c75 docs: update README file
Former-commit-id: 895a7bcee0
2022-01-28 20:04:08 +01:00
cedoor
7d54825ba1 chore: update spec name
Former-commit-id: e3fe53368e
2022-01-28 17:18:26 +01:00
cedoor
0900615ae4 chore: add cname file for doc website
Former-commit-id: d8e3666970
2022-01-28 17:02:32 +01:00
cedoor
6837dd3cbd ci: add workflow for docs deploy
Former-commit-id: 0c8c264004
2022-01-28 16:53:59 +01:00
cedoor
7888aebcd7 chore: remove docs from prettier files to ignore
Former-commit-id: 8a955e46eb
2022-01-28 16:51:10 +01:00
cedoor
a6cf53520b chore: add docusaurus folder to ignore
Former-commit-id: b62a067811
2022-01-28 16:50:46 +01:00
cedoor
0b66144c76 chore: create docusaurus project
Former-commit-id: 147af8c6f8
2022-01-28 16:50:09 +01:00
cedoor
9f931d1f19 chore: move spec on docs
Former-commit-id: bdc09eb879
2022-01-28 16:49:45 +01:00
cedoor
db8da587ab ci: remove coveralls unused conf
Former-commit-id: a929851fb4
2022-01-28 11:25:46 +01:00
cedoor
96b5e10d75 ci: separate test & coverage workflows
Former-commit-id: 9143273166
2022-01-28 11:20:39 +01:00
cedoor
e15fd3174e chore: add deploy hardhat task
Former-commit-id: 0c603218da
2022-01-27 20:02:46 +01:00
cedoor
b0bbb981a0 chore: add zk essential files
Former-commit-id: 86caaf9127
2022-01-27 18:26:06 +01:00
cedoor
d7dc8bdd60 ci: add workflow for tests and coverage
Former-commit-id: b836549a8f
2022-01-27 18:25:36 +01:00
cedoor
21b7ccabd3 chore: add gas-reporter hardhat plugin
Former-commit-id: 38bf1f58ea
2022-01-27 16:37:04 +01:00
cedoor
778d5a1574 chore: add .env files & dotenv
Former-commit-id: 2dbc09a786
2022-01-27 16:36:27 +01:00
cedoor
e7c515aabc chore: add solidity-coverage hardhat plugin
Former-commit-id: c063641384
2022-01-27 15:51:29 +01:00
cedoor
a77fcf848f chore: add typechain
Former-commit-id: f2833daee5
2022-01-27 13:34:26 +01:00
cedoor
1c91e59f71 chore: add docs for repo community standards
Former-commit-id: 222f4847c3
2022-01-27 12:41:26 +01:00
cedoor
19e54ac348 chore: rename npm script to compile contracts
Former-commit-id: f93fadea07
2022-01-27 12:40:51 +01:00
cedoor
b7b8190edc chore: set .gitignore template
Former-commit-id: ca6eac64f9
2022-01-27 12:30:12 +01:00
cedoor
ead549e9f1 chore: add solhint
Former-commit-id: ddf2d54d26
2022-01-27 12:29:39 +01:00
cedoor
55938b0eaa style: fix contract syntax with prettier
Former-commit-id: 252788f172
2022-01-27 12:06:11 +01:00
cedoor
e614cc68ac chore: fix some eslint warnings
Former-commit-id: 19b0dfe0bc
2022-01-27 11:50:54 +01:00
cedoor
3a94fb72f9 chore: add some prettier files to ignore
Former-commit-id: d27cf6158b
2022-01-27 11:50:27 +01:00
cedoor
1772e776a7 chore: add eslint
Former-commit-id: 1499f0a2d9
2022-01-27 11:50:09 +01:00
cedoor
e6a5d1f4b6 chore: remove useless exclude option
Former-commit-id: 2b074a66d8
2022-01-27 11:49:17 +01:00
cedoor
5abfed2b77 style: fix syntax with prettier
Former-commit-id: f86391ad65
2022-01-27 11:24:48 +01:00
cedoor
82c4dea962 chore: remove unused utils
Former-commit-id: 5ddd03d09f
2022-01-27 11:24:27 +01:00
cedoor
544046a392 chore: remove unused lerna conf file
Former-commit-id: 323235efe8
2022-01-27 11:22:25 +01:00
cedoor
541cd4298b chore: add prettier
Former-commit-id: c80cca3120
2022-01-27 11:21:56 +01:00
cedoor
67c6af125e chore: add commitizen packages and conf
Former-commit-id: 0a7536fbc4
2022-01-27 10:51:48 +01:00
cedoor
a11449493b chore: update solidity version
Former-commit-id: 0771ddfc37
2022-01-27 10:45:17 +01:00
cedoor
42031746fa chore: update contract license
Former-commit-id: 7202ea2903
2022-01-27 10:41:37 +01:00
cedoor
ca2d5a193c chore: update @zk-kit/protocols lib
Former-commit-id: 1eb1a17cff
2022-01-26 22:54:23 +01:00
cedoor
3602219bb6 chore: merge tests
Former-commit-id: eb3d7da447
2022-01-26 21:13:04 +01:00
Omar Desogus
710e546eee chore: set original license
Former-commit-id: ffc2c0a91a
2022-01-25 20:23:30 +01:00
cedoor
882191996c chore: add external paths
Former-commit-id: 3547d8f16f
2022-01-25 20:17:53 +01:00
cedoor
a9630e436b chore: add snarks types
Former-commit-id: 700074acf0
2022-01-25 20:17:24 +01:00
cedoor
b524655db1 chore: add paths and update npm scripts
Former-commit-id: 6b37b11459
2022-01-25 20:16:57 +01:00
cedoor
7dead05108 chore: add ts script to compile circuits
Former-commit-id: 46fbe572b7
2022-01-25 20:15:32 +01:00
cedoor
ed355829cd chore: add GPL3 licence
Former-commit-id: bc0b485ab4
2022-01-25 20:14:17 +01:00
cedoor
c37496cf00 chore: add typescript hardhat support
Former-commit-id: 917b376da3
2022-01-25 18:21:44 +01:00
cedoor
1be8ac5df5 chore: update dev dependencies
Former-commit-id: 8536aef7f2
2022-01-25 18:10:31 +01:00
Andrija
bc8362f4f0 pck update
Former-commit-id: 051484c365
2021-11-25 16:19:38 +01:00
Andrija Novakovic
e84264b24d remove unused var
Former-commit-id: d83d8a7bb9
2021-11-25 12:50:31 +01:00
Andrija Novakovic
970b19257f remove n_levels from nullifier
Former-commit-id: 2f3374c534
2021-10-28 09:55:10 +02:00
Andrija Novakovic
421b7da0ba new version of libsem protocols
Former-commit-id: 7c5b0c2436
2021-10-25 22:37:00 +02:00
Andrija Novakovic
665ab42870 version compatible with js exports
Former-commit-id: c732da9cf4
2021-10-25 19:43:53 +02:00
Andrija Novakovic
69c25d4b05 circom 2.0
Former-commit-id: bac0ce2713
2021-10-25 16:32:21 +02:00
Andrija Novakovic
37337ccff6 updated libsem
Former-commit-id: 50bdccd843
2021-10-25 13:07:38 +02:00
Andrija Novakovic
583cb2fb2a new @libsem versions
Former-commit-id: 067f479cc9
2021-10-25 12:27:52 +02:00
Andrija Novakovic
d5a3781d01 export task
Former-commit-id: 8974444df4
2021-10-24 13:10:09 +02:00
Andrija Novakovic
4d6045a01c integration test
Former-commit-id: 900d554699
2021-10-24 12:31:14 +02:00
Andrija Novakovic
acf5d7dc98 fix deployment from abi and bytecode
Former-commit-id: 5bb77575fd
2021-10-24 12:13:57 +02:00
Andrija Novakovic
358dd69753 cleanup
Former-commit-id: 15b3b8ce76
2021-10-23 22:39:38 +02:00
Andrija Novakovic
57be569adb integration tests
Former-commit-id: 30dde96a11
2021-10-23 21:14:20 +02:00
Andrija Novakovic
948685edf2 integration tests
Former-commit-id: 5e17ae9eb6
2021-10-23 18:24:24 +02:00
Andrija Novakovic
548d7bbe31 full semaphore pipeline test
Former-commit-id: 6182041c52
2021-10-23 01:42:58 +02:00
Andrija Novakovic
ceb20422b7 tests
Former-commit-id: 9cc257fa21
2021-10-23 01:11:23 +02:00
Andrija Novakovic
8e41b6cffd parametrize depth
Former-commit-id: 640f2c5e8d
2021-10-22 21:09:54 +02:00
Andrija Novakovic
a4378925ac poseidon x
Former-commit-id: 03b123313c
2021-10-21 18:10:10 +02:00
Andrija Novakovic
8f0c937023 remove unused account names
Former-commit-id: 409a42a1e3
2021-10-21 01:06:10 +02:00
Andrija Novakovic
ad6873bfb3 separate poseidon deployment
Former-commit-id: 3299d1f698
2021-10-21 01:00:48 +02:00
Andrija Novakovic
2a5ebeb6fb deployment pattern like sushi swap
Former-commit-id: dcd9690f3e
2021-10-21 00:59:38 +02:00
Andrija Novakovic
bc4b0acefd deploy scripts with hardhat-deploy module
Former-commit-id: 16b46efcab
2021-10-21 00:14:20 +02:00
Andrija Novakovic
3824857b04 test compatibility with latest lib version
Former-commit-id: a76721ee40
2021-10-20 07:59:22 +02:00
Andrija Novakovic
d945172ce9 tests with new libsem
Former-commit-id: 53dfb5855d
2021-10-20 01:37:59 +02:00
Andrija Novakovic
8f7214a921 Update package.json
Co-authored-by: Koh Wei Jie <weijiekoh@users.noreply.github.com>
Former-commit-id: 7e3a8a4318
2021-10-10 13:04:03 +02:00
Andrija Novakovic
4510809a1b Update circuits/semaphore-base.circom
Co-authored-by: Koh Wei Jie <weijiekoh@users.noreply.github.com>
Former-commit-id: a63c517772
2021-10-10 13:02:48 +02:00
Andrija Novakovic
c7ca8dc02d version 2.0
Former-commit-id: 261fdc5b44
2021-10-10 12:06:43 +02:00
Koh Wei Jie
589ade76d5 Fixed wrong link to semaphore-base.circom in docs (#37)
* fixed wrong link to semaphore-base.circom in docs

* updated the docs build script to not delete CNAME; fixed some minor errors in the tutorial

* added warning about compiling scrypt in node 12

* added warning about lerna

Former-commit-id: 1e34d21f98
2020-03-22 14:23:43 +02:00
Koh Wei Jie
36d634c47e Audit report and formal spec (#39)
* fixed wrong link to semaphore-base.circom in docs

* added audit report and spec

Former-commit-id: 7a28c614de
2020-03-22 14:20:14 +02:00
Kobi Gurkan
dabd686b1f Create CNAME
Former-commit-id: a652d654ed
2020-03-03 23:37:13 +02:00
Kobi Gurkan
5f8ad2b71b update to audited semaphore
Former-commit-id: 9702b336da
2020-03-03 23:23:23 +02:00
332 changed files with 16273 additions and 5472 deletions

View File

@@ -1,66 +0,0 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:11.14.0
working_directory: ~/semaphore/semaphorejs
steps:
- checkout:
path: ~/semaphore
# restore or install npm packages
- restore_cache:
name: restore-npm-cache
keys:
- v1.10-dependencies-{{ checksum "package-lock.json" }}
- run: npm install
- save_cache:
paths:
- node_modules
key: v1.10-dependencies-{{ checksum "package-lock.json" }}
# checksum the snarks definitions
- run:
name: checksum-snarks
command: cd scripts && ./checksum_snarks.sh
# Download and cache dependencies
- restore_cache:
name: restore-snark-cache
keys:
- v1.13-dependencies-{{ checksum "build/.snark_checksum" }}
# build snarks
- run:
name: end-to-end
command: cd scripts && ./build_snarks.sh
no_output_timeout: 600m
# cache generated snark circuit and keys
- save_cache:
key: v1.13-dependencies-{{ checksum "build/.snark_checksum" }}
paths:
- build/circuit.json
- build/proving_key.bin
- build/proving_key.json
- build/verification_key.json
- build/verifier.sol
# build snarks
- run:
name: integration_tests
command: cd scripts && ./integration_tests.sh
no_output_timeout: 600m
- store_artifacts:
path: ~/semaphore/semaphorejs/build

3
.commitlintrc.json Normal file
View File

@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}

13
.editorconfig Normal file
View File

@@ -0,0 +1,13 @@
#root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
indent_size = 4
[*.md]
trim_trailing_whitespace = false

8
.env.example Normal file
View File

@@ -0,0 +1,8 @@
DEFAULT_NETWORK=hardhat
TREE_DEPTH=20
ALL_SNARK_ARTIFACTS=true
REPORT_GAS=false
BACKEND_PRIVATE_KEY=
INFURA_API_KEY=
COINMARKETCAP_API_KEY=
ETHERSCAN_API_KEY=

37
.eslintignore Normal file
View File

@@ -0,0 +1,37 @@
# dependencies
node_modules
package-lock.json
yarn.lock
.yarn
# testing
coverage
coverage.json
# hardhat
artifacts
cache
typechain-types
# types
types
# circuits
circuits
# production
dist
build
docs
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# packages
cli-template-*

24
.eslintrc.json Normal file
View File

@@ -0,0 +1,24 @@
{
"root": true,
"env": {
"es6": true
},
"extends": ["airbnb-base", "airbnb-typescript/base", "plugin:jest/recommended", "plugin:jest/style", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"project": ["./tsconfig.json", "./packages/**/tsconfig.json"]
},
"plugins": ["@typescript-eslint", "jest"],
"rules": {
"no-underscore-dangle": "off",
"import/no-extraneous-dependencies": "off",
"no-bitwise": "off",
"no-await-in-loop": "off",
"no-restricted-syntax": "off",
"no-console": ["warn", { "allow": ["info", "warn", "error"] }],
"@typescript-eslint/lines-between-class-members": "off",
"no-param-reassign": "off"
}
}

18
.github/ISSUE_TEMPLATE/----network.md vendored Normal file
View File

@@ -0,0 +1,18 @@
---
name: "\U0001F578 Network"
about: Propose a new network in which to deploy Semaphore contracts
title: ''
labels: ''
assignees: ''
---
**Provide data related to the network**
* Name
* Chain id
* URL
**Why are you using this network?**
Describe the reasons why you think it is important for Semaphore to be deployed on this network.

23
.github/ISSUE_TEMPLATE/----project.md vendored Normal file
View File

@@ -0,0 +1,23 @@
---
name: " \U0001F4A0 Project"
about: If you are using Semaphore we can help you share your project
title: ''
labels: "documentation \U0001F4D6"
assignees: ''
---
**Describe your project**
A brief description of your project. In what way have you used Semaphore?
**Other info**
- Name
- Tagline
- Icon
**Links**
- Website
- Github
- Socials

34
.github/ISSUE_TEMPLATE/---bug.md vendored Normal file
View File

@@ -0,0 +1,34 @@
---
name: "\U0001F41E Bug"
about: Create a report to help us improve
title: ''
labels: "bug \U0001F41B"
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Technologies (please complete the following information):**
- Node.js version
- NPM version
- Solidity version
**Additional context**
Add any other context about the problem here.

20
.github/ISSUE_TEMPLATE/---feature.md vendored Normal file
View File

@@ -0,0 +1,20 @@
---
name: "\U0001F680 Feature"
about: Suggest an idea for Semaphore
title: ''
labels: 'feature :rocket:'
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

14
.github/ISSUE_TEMPLATE/---package.md vendored Normal file
View File

@@ -0,0 +1,14 @@
---
name: "\U0001F4E6 Package"
about: Propose a new Semaphore package
title: ''
labels: 'feature :rocket:'
assignees: ''
---
**Describe the package you'd like**
A clear and concise description of the type of package you have in mind.
**Additional context**
Add any other context about the package here.

24
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,24 @@
<!-- Please refer to our contributing documentation for any questions on submitting a pull request -->
<!--- Provide a general summary of your changes in the Title above -->
## Description
<!--- Describe your changes in detail -->
## Related Issue
<!--- This project accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->
## Does this introduce a breaking change?
- [ ] Yes
- [ ] No
<!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. -->
## Other information
<!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->

14
.github/workflows/auto-assign.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
name: auto-assign
on:
pull_request:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/auto-assign@v3
with:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
reviewers: org/core-devs

46
.github/workflows/docs.yml vendored Normal file
View File

@@ -0,0 +1,46 @@
name: docs
on:
push:
branches:
- main
jobs:
gh-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
- name: Generate doc website
run: yarn docs
- name: Publish on Github Pages
uses: crazy-max/ghaction-github-pages@v2.5.0
with:
build_dir: docs
jekyll: false
fqdn: js.semaphore.appliedzkp.org
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

107
.github/workflows/production.yml vendored Normal file
View File

@@ -0,0 +1,107 @@
name: production
on:
push:
branches:
- main
env:
TREE_DEPTH: 20
ALL_SNARK_ARTIFACTS: false
jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
- name: Compile contracts
run: yarn compile:contracts
- name: Build libraries
run: yarn build:libraries
- name: Run Prettier
run: yarn prettier
- name: Run Eslint
run: yarn lint
test:
runs-on: ubuntu-latest
strategy:
matrix:
type:
- libraries
- contracts
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
- name: Build libraries
run: yarn build:libraries
- name: Test contracts and libraries
run: yarn test:${{ matrix.type }}
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.type }}
path-to-lcov: ./coverage/${{ matrix.type }}/lcov.info
parallel: true
coverage:
runs-on: ubuntu-latest
needs: test
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

81
.github/workflows/pull-requests.yml vendored Normal file
View File

@@ -0,0 +1,81 @@
name: pull-requests
on:
pull_request:
env:
TREE_DEPTH: 20
ALL_SNARK_ARTIFACTS: false
jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
- name: Compile contracts
run: yarn compile:contracts
- name: Build libraries
run: yarn build:libraries
- name: Run Prettier
run: yarn prettier
- name: Run Eslint
run: yarn lint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
- name: Build libraries
run: yarn build:libraries
- name: Test contracts and libraries
run: yarn test

43
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: release
permissions:
contents: write
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
- run: yarn version:release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

91
.gitignore vendored Normal file
View File

@@ -0,0 +1,91 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# IDE
.vscode
.idea
# Testing
coverage
coverage.json
*.lcov
# Dependency directories
node_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
.DS_Store
# Output of 'npm pack'
*.tgz
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# Production
build
dist
docs/*
!docs/CNAME
!docs/index.html
# Hardhat
artifacts
cache
typechain-types
packages/contracts/deployed-contracts/undefined.json
packages/contracts/deployed-contracts/hardhat.json
packages/contracts/deployed-contracts/localhost.json
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v3
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# Other
snark-artifacts

4
.husky/commit-msg Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx --no-install commitlint --edit $1

3
.lintstagedrc.json Normal file
View File

@@ -0,0 +1,3 @@
{
"**/*.{js,ts}": ["prettier --write", "eslint --fix"]
}

47
.prettierignore Normal file
View File

@@ -0,0 +1,47 @@
# dependencies
node_modules
package-lock.json
yarn.lock
.yarn
# testing
coverage
coverage.json
# hardhat
artifacts
cache
typechain-types
packages/contracts/deployed-contracts/undefined.json
packages/contracts/deployed-contracts/hardhat.json
packages/contracts/deployed-contracts/localhost.json
# circuits
circuits
# contracts
Verifier*.sol
# production
dist
build
docs
# github
.github/ISSUE_TEMPLATE
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# other
snark-artifacts
# Next.js
.next/
public

5
.prettierrc.json Normal file
View File

@@ -0,0 +1,5 @@
{
"semi": false,
"arrowParens": "always",
"trailingComma": "none"
}

View File

@@ -0,0 +1,23 @@
diff --git a/dist/shared/changelogithub.821fab93.mjs b/dist/shared/changelogithub.821fab93.mjs
index 5fc2100867613c20f7827eac8715a5fc28bdc39e..97bd8dff878b81c63d2220e496904f6f3933589a 100644
--- a/dist/shared/changelogithub.821fab93.mjs
+++ b/dist/shared/changelogithub.821fab93.mjs
@@ -181,7 +181,7 @@ function formatLine(commit, options) {
function formatTitle(name, options) {
if (!options.emoji)
name = name.replace(emojisRE, "");
- return `### &nbsp;&nbsp;&nbsp;${name.trim()}`;
+ return `## &nbsp;&nbsp;&nbsp;${name.trim()}`;
}
function formatSection(commits, sectionName, options) {
if (!commits.length)
@@ -198,7 +198,8 @@ function formatSection(commits, sectionName, options) {
Object.keys(scopes).sort().forEach((scope) => {
let padding = "";
let prefix = "";
- const scopeText = `**${options.scopeMap[scope] || scope}**`;
+ const url = `https://github.com/${options.github}/tree/main/packages/${scope}`
+ const scopeText = `[**@${options.github.split("/")[0]}/${options.scopeMap[scope] || scope}**](${url})`
if (scope && useScopeGroup) {
lines.push(`- ${scopeText}:`);
padding = " ";

View File

@@ -0,0 +1 @@
87de4f440a77841135f97a187e09140c6d4e6ae2

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
b3cadff6efb37a12712d12c2553ec703dbcaa4dd

11
.yarnrc.yml Normal file
View File

@@ -0,0 +1,11 @@
checksumBehavior: update
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"
yarnPath: .yarn/releases/yarn-3.2.1.cjs

127
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,127 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

111
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,111 @@
# Contributing
:tada: Thank you for being interested in contributing to the Semaphore project! :tada:
Feel welcome and read the following sections in order to know how to ask questions and how to work on something.
All members of our community are expected to follow our [Code of Conduct](/CODE_OF_CONDUCT.md). Please make sure you are welcoming and friendly in all of our spaces.
We're really glad you're reading this, because we need volunteer developers to help this project come to fruition. 👏
## Issues
The best way to contribute to our projects is by opening a [new issue](https://github.com/semaphore-protocol/semaphore/issues/new/choose) or tackling one of the issues listed [here](https://github.com/semaphore-protocol/semaphore/contribute).
## Pull Requests
Pull requests are great if you want to add a feature or fix a bug. Here's a quick guide:
1. Fork the repo.
2. Run the tests. We only take pull requests with passing tests.
3. Add a test for your change. Only refactoring and documentation changes require no new tests.
4. Make sure to check out the [Style Guide](/CONTRIBUTING#style-guide) and ensure that your code complies with the rules.
5. Make the test pass.
6. Commit your changes.
7. Push to your fork and submit a pull request on our `dev` branch. Please provide us with some explanation of why you made the changes you made. For new features make sure to explain a standard use case to us.
## CI (Github Actions) Tests
We use GitHub Actions to test each PR before it is merged.
When you submit your PR (or later change that code), a CI build will automatically be kicked off. A note will be added to the PR, and will indicate the current status of the build.
## Style Guide
### Code rules
We always use ESLint and Prettier. To check that your code follows the rules, simply run the npm script `yarn lint`.
### Commits rules
For commits it is recommended to use [Conventional Commits](https://www.conventionalcommits.org).
Don't worry if it looks complicated, in our repositories, after `git add`, you can usually run the npm script `yarn commit` to make many of these steps interactive.
Each commit message consists of a **header**, a **body** and a **footer**. The **header** has a special format that includes a **type**, a **scope** and a **subject**:
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
The **header** is mandatory and the **scope** of the header must contain the name of the package you are working on.
#### Type
The type must be one of the following:
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug nor adds a feature (improvements of the code structure)
- perf: A code change that improves the performance
- test: Adding missing or correcting existing tests
- build: Changes that affect the build system or external dependencies (example scopes: gulp, npm)
- ci: Changes to CI configuration files and scripts (example scopes: travis, circle)
- chore: Other changes that don't modify src or test files
- revert: Reverts a previous commit
#### Scope
The scope should be the name of the npm package affected (as perceived by the person reading the changelog generated from commit messages).
#### Subject
The subject contains a succinct description of the change:
- Use the imperative, present tense: "change" not "changed" nor "changes"
- Don't capitalize the first letter
- No dot (.) at the end
#### Body
Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
### Branch rules
- There must be a `main` branch, used only for the releases.
- There must be a `dev` branch, used to merge all the branches under it.
- Avoid long descriptive names for long-lived branches.
- Use kebab-case (no CamelCase).
- Use grouping tokens (words) at the beginning of your branch names (in a similar way to the `type` of commit).
- Define and use short lead tokens to differentiate branches in a way that is meaningful to your workflow.
- Use slashes to separate parts of your branch names.
- Remove branch after merge if it is not important.
Examples:
```bash
git branch -b docs/readme
git branch -b test/a-feature
git branch -b feat/sidebar
git branch -b fix/b-feature
```

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Ethereum Foundation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

556
README.md
View File

@@ -1,168 +1,486 @@
# Semaphore
<p align="center">
<h1 align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/semaphore-protocol/website/blob/main/static/img/semaphore-icon-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/semaphore-protocol/website/blob/main/static/img/semaphore-icon.svg">
<img width="40" alt="Semaphore icon." src="https://github.com/semaphore-protocol/website/blob/main/static/img/semaphore-icon.svg">
</picture>
Semaphore
</h1>
</p>
[![CircleCI](https://circleci.com/gh/kobigurk/semaphore.svg?style=svg&circle-token=57fa2a6c591cd8d09ddae610313452bdd7b0fb14)](https://circleci.com/gh/kobigurk/semaphore)
<p align="center">
<a href="https://github.com/semaphore-protocol" target="_blank">
<img src="https://img.shields.io/badge/project-Semaphore-blue.svg?style=flat-square">
</a>
<a href="/LICENSE">
<img alt="Github license" src="https://img.shields.io/github/license/semaphore-protocol/semaphore.svg?style=flat-square">
</a>
<a href="https://github.com/semaphore-protocol/semaphore/actions?query=workflow%3Aproduction">
<img alt="GitHub Workflow test" src="https://img.shields.io/github/actions/workflow/status/semaphore-protocol/semaphore/production.yml?branch=main&label=test&style=flat-square&logo=github">
</a>
<a href="https://coveralls.io/github/semaphore-protocol/semaphore">
<img alt="Coveralls" src="https://img.shields.io/coveralls/github/semaphore-protocol/semaphore?style=flat-square&logo=coveralls">
</a>
<a href="https://deepscan.io/dashboard#view=project&tid=16502&pid=22324&bid=657461">
<img src="https://deepscan.io/api/teams/16502/projects/22324/branches/657461/badge/grade.svg" alt="DeepScan grade">
</a>
<a href="https://eslint.org/">
<img alt="Linter eslint" src="https://img.shields.io/badge/linter-eslint-8080f2?style=flat-square&logo=eslint">
</a>
<a href="https://prettier.io/">
<img alt="Code style prettier" src="https://img.shields.io/badge/code%20style-prettier-f8bc45?style=flat-square&logo=prettier">
</a>
<img alt="Repository top language" src="https://img.shields.io/github/languages/top/semaphore-protocol/semaphore?style=flat-square">
<a href="https://www.gitpoap.io/gh/semaphore-protocol/semaphore" target="_blank">
<img src="https://public-api.gitpoap.io/v1/repo/semaphore-protocol/semaphore/badge">
</a>
Join the [Telegram group](https://t.me/joinchat/B-PQx1U3GtAh--Z4Fwo56A) to discuss.
</p>
## Introduction
<div align="center">
<h4>
<a href="/CONTRIBUTING.md">
👥 Contributing
</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a href="/CODE_OF_CONDUCT.md">
🤝 Code of conduct
</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a href="https://github.com/semaphore-protocol/semaphore/contribute">
🔎 Issues
</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a href="https://semaphore.appliedzkp.org/discord">
🗣️ Chat &amp; Support
</a>
</h4>
</div>
Semaphore has been introduced by [barryWhiteHat](https://github.com/barryWhiteHat) as a method of zero-knowledge signaling - a method for an approved user to broadcast an arbitrary string without exposing their identity. This repository is an implementation of an upgraded version of the concept, including the zero-knowledge circuits and the tools necessary to use it, both server-side and client-side.
| Semaphore is a protocol, designed to be a simple and generic privacy layer for Ethereum DApps. Using zero knowledge, Ethereum users can prove their membership of a group and send signals such as votes or endorsements without revealing their original identity. |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
The project is implemented in plain Node.JS and uses [circom](https://github.com/iden3/circom) for the zero-knowledge proofs.
The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/scheme.png). However Semaphore also provides [Solidity contracts](/packages/contracts) and JavaScript libraries to make the steps for offchain proof creation and onchain verification easier. To learn more about Semaphore visit [semaphore.appliedzkp.org](https://semaphore.appliedzkp.org).
## Design
Semaphore is comprised of a zkSNARK statement, a few smart contracts, a server application and a client application.
## 📦 Packages
### Smart contracts
Implemented in [**semaphorejs/contracts**](semaphorejs/contracts).
<table>
<th>Package</th>
<th>Version</th>
<th>Downloads</th>
<tbody>
<tr>
<td>
<a href="/packages/contracts">
@semaphore-protocol/contracts
</a>
</td>
<td>
<!-- NPM version -->
<a href="https://npmjs.org/package/@semaphore-protocol/contracts">
<img src="https://img.shields.io/npm/v/@semaphore-protocol/contracts.svg?style=flat-square" alt="NPM version" />
</a>
</td>
<td>
<!-- Downloads -->
<a href="https://npmjs.org/package/@semaphore-protocol/contracts">
<img src="https://img.shields.io/npm/dm/@semaphore-protocol/contracts.svg?style=flat-square" alt="Downloads" />
</a>
</td>
</tr>
<tr>
<td>
<a href="/packages/identity">
@semaphore-protocol/identity
</a>
<a href="https://js.semaphore.appliedzkp.org/identity">
(docs)
</a>
</td>
<td>
<!-- NPM version -->
<a href="https://npmjs.org/package/@semaphore-protocol/identity">
<img src="https://img.shields.io/npm/v/@semaphore-protocol/identity.svg?style=flat-square" alt="NPM version" />
</a>
</td>
<td>
<!-- Downloads -->
<a href="https://npmjs.org/package/@semaphore-protocol/identity">
<img src="https://img.shields.io/npm/dm/@semaphore-protocol/identity.svg?style=flat-square" alt="Downloads" />
</a>
</td>
</tr>
<tr>
<td>
<a href="/packages/group">
@semaphore-protocol/group
</a>
<a href="https://js.semaphore.appliedzkp.org/group">
(docs)
</a>
</td>
<td>
<!-- NPM version -->
<a href="https://npmjs.org/package/@semaphore-protocol/group">
<img src="https://img.shields.io/npm/v/@semaphore-protocol/group.svg?style=flat-square" alt="NPM version" />
</a>
</td>
<td>
<!-- Downloads -->
<a href="https://npmjs.org/package/@semaphore-protocol/group">
<img src="https://img.shields.io/npm/dm/@semaphore-protocol/group.svg?style=flat-square" alt="Downloads" />
</a>
</td>
</tr>
<tr>
<td>
<a href="/packages/proof">
@semaphore-protocol/proof
</a>
<a href="https://js.semaphore.appliedzkp.org/proof">
(docs)
</a>
</td>
<td>
<!-- NPM version -->
<a href="https://npmjs.org/package/@semaphore-protocol/proof">
<img src="https://img.shields.io/npm/v/@semaphore-protocol/proof.svg?style=flat-square" alt="NPM version" />
</a>
</td>
<td>
<!-- Downloads -->
<a href="https://npmjs.org/package/@semaphore-protocol/proof">
<img src="https://img.shields.io/npm/dm/@semaphore-protocol/proof.svg?style=flat-square" alt="Downloads" />
</a>
</td>
</tr>
<tr>
<td>
<a href="/packages/data">
@semaphore-protocol/data
</a>
<a href="https://js.semaphore.appliedzkp.org/data">
(docs)
</a>
</td>
<td>
<!-- NPM version -->
<a href="https://npmjs.org/package/@semaphore-protocol/data">
<img src="https://img.shields.io/npm/v/@semaphore-protocol/data.svg?style=flat-square" alt="NPM version" />
</a>
</td>
<td>
<!-- Downloads -->
<a href="https://npmjs.org/package/@semaphore-protocol/data">
<img src="https://img.shields.io/npm/dm/@semaphore-protocol/data.svg?style=flat-square" alt="Downloads" />
</a>
</td>
</tr>
<tr>
<td>
<a href="/packages/hardhat">
@semaphore-protocol/hardhat
</a>
</td>
<td>
<!-- NPM version -->
<a href="https://npmjs.org/package/@semaphore-protocol/hardhat">
<img src="https://img.shields.io/npm/v/@semaphore-protocol/hardhat.svg?style=flat-square" alt="NPM version" />
</a>
</td>
<td>
<!-- Downloads -->
<a href="https://npmjs.org/package/@semaphore-protocol/hardhat">
<img src="https://img.shields.io/npm/dm/@semaphore-protocol/hardhat.svg?style=flat-square" alt="Downloads" />
</a>
</td>
</tr>
<tr>
<td>
<a href="/packages/cli">
@semaphore-protocol/cli
</a>
</td>
<td>
<!-- NPM version -->
<a href="https://npmjs.org/package/@semaphore-protocol/cli">
<img src="https://img.shields.io/npm/v/@semaphore-protocol/cli.svg?style=flat-square" alt="NPM version" />
</a>
</td>
<td>
<!-- Downloads -->
<a href="https://npmjs.org/package/@semaphore-protocol/cli">
<img src="https://img.shields.io/npm/dm/@semaphore-protocol/cli.svg?style=flat-square" alt="Downloads" />
</a>
</td>
</tr>
<tr>
<td>
<a href="/packages/heyauthn">
@semaphore-protocol/heyauthn
</a>
<a href="https://js.semaphore.appliedzkp.org/heyauthn">
(docs)
</a>
</td>
<td>
<!-- NPM version -->
<a href="https://npmjs.org/package/@semaphore-protocol/heyauthn">
<img src="https://img.shields.io/npm/v/@semaphore-protocol/heyauthn.svg?style=flat-square" alt="NPM version" />
</a>
</td>
<td>
<!-- Downloads -->
<a href="https://npmjs.org/package/@semaphore-protocol/heyauthn">
<img src="https://img.shields.io/npm/dm/@semaphore-protocol/heyauthn.svg?style=flat-square" alt="Downloads" />
</a>
</td>
</tr>
<tbody>
</table>
#### Semaphore
The Semaphore contract is the base layer of Semaphore. Other contracts can build upon this to create applications that rely on anonymous signaling. Semaphore has a tree of allowed identities, a tree of signals, a set of previously broadcast nullifiers hashes, multiple external nullifiers and a gas price refund price:
## 💡 Projects
* The tree of allowed identities allows a prover to show that they are an identity which is approved to signal.
* The tree of signals allows a user to verify the integrity of a list of signals.
* The nullifiers hashes set and external nullifier allows the contract to prevent double signals by the same user, within the context of each external nullifier, without exposing the specific user.
* The gas price refund price is a mechanism that supports transaction abstraction - a server can broadcast on behalf of a user to provide further anonymity, and in return they receive a refund and a small reward, with a maximum gas price for their transaction.
The following are some of the internal and external projects that use Semaphore. If you want to include your project, open an [issue](https://github.com/semaphore-protocol/semaphore/issues/new?assignees=&labels=documentation++%F0%9F%93%96&template=----project.md&title=) or create a PR by adding the project information to the `projects.json` file.
The contract allows administrative operations that only the owner is allowed to perform:
<table>
<th>Project</th>
<th>Description</th>
<th>Links</th>
<tbody>
<tr>
<td>
<a href="https://explorer.semaphore.appliedzkp.org">
Semaphore Explorer
</a>
</td>
<td>
Semaphore explorer for on-chain groups.
</td>
<td>
<a href="https://github.com/semaphore-protocol/explorer">
Github
</a>|
<a href="https://semaphore.appliedzkp.org/discord">
Discord
</a>
</td>
</tr>
<tr>
<td>
<a href="https://discord.com/api/oauth2/authorize?client_id=1082429985496772628&permissions=1024&scope=bot">
Semaphore Discord Bot
</a>
</td>
<td>
A Discord bot for Semaphore.
</td>
<td>
<a href="https://github.com/semaphore-protocol/discord-bot">
Github
</a>|
<a href="https://semaphore.appliedzkp.org/discord">
Discord
</a>
</td>
</tr>
<tr>
<td>
<a href="https://developer.unirep.io">
Unirep
</a>
</td>
<td>
Private and nonrepudiable reputation system based on ZKP.
</td>
<td>
<a href="https://github.com/Unirep">
Github
</a>|
<a href="https://discord.gg/VzMMDJmYc5">
Discord
</a>
</td>
</tr>
<tr>
<td>
<a href="https://zk-proof-of-humanity.vercel.app">
ZK Proof of Humanity
</a>
</td>
<td>
A project to allows humans, registered in Proof of Humanity, to prove their humanity without doxing.
</td>
<td>
<a href="https://github.com/elmol/zk-proof-of-humanity">
Github
</a>
</td>
</tr>
<tr>
<td>
Plurality
</td>
<td>
An Identity Lego Building Block for dapp creators that lets them identify their users without</br> using any third-party KYC provider or other middlemen, whilst preserving the privacy of users.
</td>
<td>
<a href="https://github.com/Web3-Plurality">
Github
</a>
</td>
</tr>
<tr>
<td>
<a href="https://zerotherapy.vercel.app">
ZeroTherapy
</a>
</td>
<td>
AMA privacy application built with Semaphore.
</td>
<td>
<a href="https://github.com/Pushpit07/ZeroTherapy">
Github
</a>
</td>
</tr>
<tr>
<td>
<a href="https://bq2.netlify.app/">
Block Qualified
</a>
</td>
<td>
On-chain and privacy preserving education platform built on Semaphore.
</td>
<td>
<a href="https://github.com/0xdeenz/bq2">
Github
</a>
</td>
</tr>
<tr>
<td>
<a href="https://stealthcomms.surge.sh/">
StealthComms
</a>
</td>
<td>
A project that allows users to prove their membership in a group and send messages/signals without revealing their original identity.
</td>
<td>
<a href="https://github.com/atomniketh/zk-app">
Github
</a>
</td>
</tr>
<tbody>
</table>
* Managing identities using the **insertIdentity** and **updateIdentity** methods.
* Adding or removing an **external_nullifier**.
* Setting the broadcast permissioning - whether only the owner can broadcast.
## 🛠 Install
The contract allows anyone to read the current state:
Clone this repository:
* Reading the roots of the two trees.
* Reading the current parameters of **external_nullifier**.
```bash
git clone https://github.com/semaphore-protocol/semaphore.git
```
The contract allows anyone to attempt broadcasting a signal, given a signal, a proof and the relevant public inputs.
The contract allows anyone to fund the contract for gas refund and rewards.
And install the dependencies:
Lastly, the contract has a few events to allow a server to build a local state to serve users wishing to generate proofs:
```bash
cd semaphore && yarn
```
* **Funded** - when the contract has received some funding for refunds and rewards.
* **SignalBroadcast** - when a signal has been broadcast successfully, after verification of the proof, the public inputs and double-signaling checks.
* **LeafAdded**, **LeafUpdated** (from MerkleTreeLib) - when the trees have been updated.
## 📜 Usage
Copy the `.env.example` file as `.env`:
#### MerkleTreeLib
```bash
cp .env.example .env
```
Manages a number of append-only Merkle trees with efficient inserts and updates.
And add your environment variables.
### zkSNARK statement
Implemented in [**semaphorejs/snark**](semaphorejs/snark).
### Code quality and formatting
The statement assures that given public inputs:
Run [ESLint](https://eslint.org/) to analyze the code and catch bugs:
* **signal_hash**
* **external_nullifier**
* **root**
* **nullifiers_hash**
```bash
yarn lint
```
and private inputs:
* **identity_pk**
* **identity_nullifier**
* **identity_trapdoor**
* **identity_path_elements**
* **identity_path_index**
* **auth_sig_r**
* **auth_sig_s**
Run [Prettier](https://prettier.io/) to check formatting rules:
the following conditions hold:
```bash
yarn prettier
```
* The commitment of the identity structure (**identity_pk**, **identity_nullifier**, **identity_trapdoor**) exists in the identity tree with the root **root**, using the path (**identity_path_elements**, **identity_path_index**). This ensures that the user was added to the system at some point in the past.
* **nullifiers_hash** is uniquely derived from **external_nullifier**, **identity_nullifier** and **identity_path_index**. This ensures a user cannot broadcast a signal with the same **external_nullifier** more than once.
* The message (**external_nullifier**, **signal_hash**) is signed by the secret key corresponding to **identity_pk**, having the signature (**auth_sig_r**, **auth_sig_s**). This ensures that a state of the contract having a specific **external_nullifier**, ensuring no double-signaling.
Or to automatically format the code:
#### Cryptographic primitives
```bash
yarn prettier:write
```
Semaphore uses a few cryptographic primitives provided by circomlib:
### Conventional commits
* MiMCHash for the Merkle tree, the identity commitments and the message hash in the signature.
* EdDSA for the signature.
Semaphore uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). A [command line utility](https://github.com/commitizen/cz-cli) to commit using the correct syntax can be used by running:
Note: MiMCHash, and especially the specific paramteres used in the circuit, have not been heavily audited yet by the cryptography community. Additionally, the circuit and code should also receive further review before relying on it for production applications.
```bash
yarn commit
```
### Server
It will also automatically check that the modified files comply with ESLint and Prettier rules.
Implemented in [**semaphorejs/src/server/server.js**](semaphorejs/src/server/server.js). Acts as a manager of the identities merkle tree and as an identity onboarder. The REST API allows:
### Snark artifacts
* An owner to submit a transaction that adds an identity to the merkle tree, provided proper authentication.
* A client to ask for a path from an identity commitment to the current root of the tree, relieving the client from the need to manage this tree by themselves.
* A client to ask a list of signals, together with their paths to the signals tree root.
* An owner to set the external nullifier.
Download the Semaphore snark artifacts needed to generate and verify proofs:
The server relies on an Ethereum node and the events in the smart contract to synchronize to the current state and handle rollbacks if they occur.
```bash
yarn download:snark-artifacts
```
It uses [**semaphore-merkle-tree**](https://github.com/weijiekoh/semaphore-merkle-tree) - Semaphore requires managing a growing merkle tree containing the identities allowed to signal and the signals broadcast by users. semaphore-merkle-tree manages the trees either in-memory, for browser usage or a database, making the tree scale by the disk size.
### Testing
### Client
Run [Jest](https://jestjs.io/) to test the JS libraries:
Implemented in [**src/client/client.js**](semaphorejs/src/client/client.js). Enables signaling a user's support of an arbitrary statemnt, given identity secrets of an identity existing in the tree. The client has 2 CLI functions:
```bash
yarn test:libraries
```
* **generate_identity** - generate random identity secrets and randomness, save them to disk and print the identity commitment. The client can then send the commitment to the onboarder (using another channel), requesting they add them to the tree.
* **signal STRING** - given an arbitrary string, generates a zero-knowledge proof of the client's authorization to signal. The signalling requests the path of the identity commitment from the server, and broadcasts the transaction directly to the contract.
Run [Mocha](https://mochajs.org/) to test the contracts:
### Web
```bash
yarn test:contracts
```
A web interface to run the server and client APIs, generate identities and proofs directly in the browser and broadcast signals.
Or test everything with:
## Running modes
```bash
yarn test
```
Schematically, Semaphore has the following actors:
### Build libraries & compile contracts
![Semaphore architecture](docs/Semaphore.svg)
Run [Rollup](https://www.rollupjs.org) to build all the packages:
There are 3 main running modes:
```bash
yarn build:libraries
```
* One server is the owner of the Semaphore contract, other servers act as intermediate miners and clients uses them to broadcast their signals. This the lightest running mode for clients, as they rely on servers to provide them with tree paths, a list of signals and broadcast. This is the default mode that is exposed in the CLI and web clients.
* One server is the owner of the Semaphore contract and clients broadcast directly. This is still a light running mode for clients, and is less prone to server censorship, at the cost of less anonymity - as the user's Ethereum address is exposed.
* One server is the owner of the Semaphore contract and clients run a server locally. This is a heavier running mode, allowing the clients to run autonomously, reconstructing the signals and identities states locally.
Compile the smart contracts with [Hardhat](https://hardhat.org/):
## Configuration
```bash
yarn compile:contracts
```
The server and the client look for **server-config.json** and **client-config.json**, respectively. They can also accept their configuration as environment variables:
* **server**:
* CONFIG_ENV - load configuration from environment variables rather than a file.
* CONFIG_PATH - location of the configuration file.
* LOG_LEVEL - error, info, debug or verbose.
* DB_PATH - location of the RocksDB database.
* CHAIN_ID - chain ID of the Ethereum network.
* CONTRACT_ADDRESS - the deployed Semaphore contract address.
* CREATION_HASH - the transaction hash in which the contract was created, to allow for faster initial sync.
* NODE_URL - the RPC URL of the Ehtereum node.
* SEMAPHORE_PORT - the port on which to serve the Semaphore server REST API.
* SEMAPHORE_LOGIN - the password with which clients communicating with the Semaphore server REST API must authenticate.
* FROM_ADDRESS - the address to send transactions from.
* FROM_PRIVATE_KEY - the private key of FROM_ADDRESS.
* TRANSACTION_CONFIRMATION_BLOCKS - the amount of blocks to wait until a transaction is considered confirmed. The default is 24.
* **client:**
* CONFIG_ENV - load configuration from environment variables rather than a file.
* LOG_LEVEL - error, info, debug or verbose.
* IDENTITY_PATH - location of the identity secrets file.
* CHAIN_ID - chain ID of the Ethereum network.
* CONTRACT_ADDRESS - the deployed Semaphore contract address.
* NODE_URL - the RPC URL of the Ehtereum node.
* FROM_ADDRESS - the address to send transactions from.
* FROM_PRIVATE_KEY - the private key of FROM_ADDRESS.
* TRANSACTION_CONFIRMATION_BLOCKS - the amount of blocks to wait until a transaction is considered confirmed. The default is 24.
* EXTERNAL_NULLIFIER - the external nullifier to be used with the signal. Must match the one in the contract.
* SEMAPHORE_SERVER_URL - the URL of the Semaphore REST server.
* BROADCASTER_ADDRESS - the address of the Semaphore server that will be allowed to broadcast the client's signals.
### Documentation (JS libraries)
## Running
Run [TypeDoc](https://typedoc.org/) to generate a documentation website for each package:
The easiest way to try Semaphore out is to use [https://semaphore.kobi.one](https://semaphore.kobi.one) - a web interface to broadcast to a remote server and generate proofs locally. First, load the Rinkeby config using the button at the top. Then, you can generate an identity and send the commitment to @kobigurk on Telegram or open an issue in the repository. Then, you can broadcast signals, including the proof generation, directly in the browser. Lastly, you can see the signals that have been broadcast to date in the table.
```bash
yarn docs
```
* To try out Semaphore locally you can clone the repository and run the following in `semaphore/semaphorejs/`:
* **npm install && npm link**
* **cd scripts && ./compile.sh && ./do_setup.sh && ./build_verifier.sh** - compile, do a setup and build the verifier of the Semaphore circuit.
* **scripts/run_ganache.sh** - runs ganache with appropriate parameters for Semaphore testing.
* **scripts/run_all_test.sh** - runs a server and a client, generates a new random identity and broadcasts a signal.
It assumes bash, node and truffle are globally available.
Examples of run commands (roughly matching the test contract deployed on Rinkeby):
* `LOG_LEVEL=debug CHAIN_ID=4 CONTRACT_ADDRESS=0x3dE2c3f8853594440c3363f8D491449Defa0bE1F NODE_URL=https://rinkeby.infura.io/v3/f4a3ad81db3f4750bd201955c8d20066 SEMAPHORE_PORT=3000 FROM_ADDRESS=0x1929c15f4e818abf2549510622a50c440c474223 FROM_PRIVATE_KEY=0x6738837df169e8d6ffc6e33a2947e58096d644fa4aa6d74358c8d9d57c12cd21 TRANSACTION_CONFIRMATION_BLOCKS=1 CREATION_HASH=0x4d6998f49f3ebb6e2bd3567c5adbf3f5ab711fbb24e618b4b53498d521f9c758 SEMAPHORE_LOGIN=test123 CONFIG_ENV=true npx semaphorejs-server`
* `LOG_LEVEL=debug TRANSACTION_CONFIRMATION_BLOCKS=1 CHAIN_ID=4 CONTRACT_ADDRESS=0x3dE2c3f8853594440c3363f8D491449Defa0bE1F NODE_URL=https://rinkeby.infura.io/v3/f4a3ad81db3f4750bd201955c8d20066 EXTERNAL_NULLIFIER=12312 SEMAPHORE_SERVER_URL=https://semaphore-server.kobi.one BROADCASTER_ADDRESS=0x1929c15f4e818abf2549510622a50c440c474223 CONFIG_ENV=true npx semaphorejs-client signal "I vote for fork A"`
The output will be placed on the `docs` folder.

3
babel.config.json Normal file
View File

@@ -0,0 +1,3 @@
{
"presets": [["@babel/preset-env", { "targets": { "node": "current" } }], "@babel/preset-typescript"]
}

View File

@@ -0,0 +1,7 @@
{
"types": {
"feat": { "title": "🚀 Features" },
"fix": { "title": "🐞 Bug Fixes" },
"refactor": { "title": "♻️ Refactoring" }
}
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 25 KiB

123
docs/index.html Normal file
View File

@@ -0,0 +1,123 @@
<!DOCTYPE html>
<html style="height: 100%">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<title>Semaphore packages</title>
<meta
name="description"
content="A monorepo of Semaphore packages."
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
</head>
<body
style="
margin: 0;
background-color: #EAF0F4;
color: #000;
height: 100%;
font-family: 'Courier New', monospace;
display: flex;
flex-direction: column;
justify-content: space-between;
"
>
<div
style="
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex: 1;
padding: 0 20px;
text-align: center;
"
>
<div style="display: flex">
<span style="margin-right: 5px">
<img width="40" src="https://raw.githubusercontent.com/semaphore-protocol/website/main/static/img/semaphore-icon.svg">
</span>
<h1 style="margin: 0; font-size: 40px">Semaphore packages</h1>
</div>
<p style="max-width: 500px">
A monorepo of Semaphore packages.
</p>
<ul style="list-style-type: none; padding: 0; margin: 0; margin-top: 10px"></ul>
</div>
<footer
style="
display: flex;
justify-content: center;
padding: 15px 20px;
background-color: #EAF0F4;
"
>
<div
style="
display: flex;
justify-content: space-between;
align-items: center;
width: 900px;
"
>
<p style="margin: 0; font-size: 16px">
Copyright © 2022 Ethereum Foundation
</p>
<div>
<a
style="margin-right: 15px; text-decoration: none"
target="_blank"
href="https://github.com/semaphore-protocol/semaphore"
>
<i
class="fa fa-github"
style="font-size: 24px; color: #000"
></i>
</a>
</div>
</div>
</footer>
</body>
<script>
const url =
"https://api.github.com/repos/semaphore-protocol/semaphore/contents?ref=gh-pages"
function insertLinks(packages) {
const [element] = window.document.getElementsByTagName("ul")
let html = ""
for (const package of packages) {
html += `<li style="display: flex; align-items: center; margin-bottom: 8px">
<a style="margin-right: 15px" target="_blank" href="https://github.com/semaphore-protocol/semaphore/tree/main/packages/${package}">
<i class="fa fa-github" style="font-size: 24px; color: #000"></i>
</a>
<a style="color: #000; text-decoration: none; font-size: 16px"
onmouseover="this.style.color='#404A4E';"
onmouseout="this.style.color='#000';"
target="_blank" href="https://semaphore-protocol.github.io/semaphore/${package}">
@semaphore-protocol/${package} >
</a></li>`
}
element.innerHTML = html
}
fetch(url)
.then((response) => response.json())
.then((data) => {
const ignore = [".nojekyll", "index.html", "CNAME"]
const packages = data
.map((c) => c.name)
.filter((name) => !ignore.includes(name))
localStorage.setItem("packages", JSON.stringify(packages))
insertLinks(packages)
})
</script>
</html>

29
jest.config.ts Normal file
View File

@@ -0,0 +1,29 @@
import fs from "fs"
import type { Config } from "@jest/types"
const projects: any = fs
.readdirSync("./packages", { withFileTypes: true })
.filter((directory) => directory.isDirectory())
.map(({ name }) => ({
rootDir: `packages/${name}`,
displayName: name,
setupFiles: ["dotenv/config"],
moduleNameMapper: {
"@semaphore-protocol/(.*)": "<rootDir>/../$1/src/index.ts" // Interdependency packages.
}
}))
export default async (): Promise<Config.InitialOptions> => ({
projects,
verbose: true,
coverageDirectory: "./coverage/libraries",
collectCoverageFrom: ["<rootDir>/src/**/*.ts", "!<rootDir>/src/**/index.ts", "!<rootDir>/src/**/*.d.ts"],
coverageThreshold: {
global: {
branches: 90,
functions: 95,
lines: 95,
statements: 95
}
}
})

90
package.json Normal file
View File

@@ -0,0 +1,90 @@
{
"name": "semaphore-protocol",
"description": "A zero-knowledge protocol for anonymous signalling on Ethereum.",
"license": "MIT",
"repository": "git@github.com:semaphore-protocol/semaphore.git",
"homepage": "https://github.com/semaphore-protocol/semaphore",
"bugs": "https://github.com/semaphore-protocol/semaphore/issues",
"private": true,
"scripts": {
"build:libraries": "yarn workspaces foreach -t --no-private run build",
"compile:contracts": "yarn workspace contracts compile",
"download:snark-artifacts": "rimraf snark-artifacts && ts-node scripts/download-snark-artifacts.ts",
"remove:template-files": "ts-node scripts/remove-template-files.ts",
"test": "yarn test:libraries && yarn test:contracts",
"test:libraries": "jest --coverage",
"test:contracts": "yarn workspace contracts test:coverage",
"lint": "eslint . --ext .js,.ts && yarn workspace contracts lint",
"prettier": "prettier -c .",
"prettier:write": "prettier -w .",
"docs": "yarn workspaces foreach --no-private run docs",
"version:bump": "yarn workspaces foreach --no-private version -d ${0} && yarn version apply --all && git commit -am \"chore: v${0}\" && git tag v${0}",
"version:publish": "yarn build:libraries && yarn remove:template-files && yarn workspaces foreach --no-private npm publish --tolerate-republish --access public",
"version:release": "changelogithub",
"commit": "cz",
"precommit": "lint-staged",
"postinstall": "yarn download:snark-artifacts && husky install"
},
"keywords": [
"ethereum",
"semaphore",
"solidity",
"circom",
"javascript",
"typescript",
"zero-knowledge",
"zk-snarks",
"zero-knowledge-proofs",
"proof-of-membership",
"monorepo"
],
"workspaces": [
"packages/*",
"packages/contracts/contracts"
],
"packageManager": "yarn@3.2.1",
"devDependencies": {
"@babel/core": "^7.16.7",
"@babel/preset-env": "^7.16.8",
"@babel/preset-typescript": "^7.17.12",
"@commitlint/cli": "^16.0.2",
"@commitlint/config-conventional": "^16.0.0",
"@rollup/plugin-typescript": "^8.3.0",
"@types/download": "^8.0.1",
"@types/glob": "^7.2.0",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.9",
"@types/rimraf": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^5.9.1",
"@typescript-eslint/parser": "^5.9.1",
"babel-jest": "^27.4.6",
"changelogithub": "0.12.7",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "^3.3.0",
"dotenv": "^16.0.2",
"eslint": "^8.2.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^25.7.0",
"husky": "^8.0.3",
"jest": "^27.4.1",
"jest-config": "^27.4.7",
"lint-staged": "^12.1.7",
"prettier": "^2.5.1",
"rimraf": "^3.0.2",
"rollup": "^2.64.0",
"ts-node": "^10.4.0",
"tslib": "^2.3.1",
"typescript": "^4.7.0"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"resolutions": {
"changelogithub@0.12.7": "patch:changelogithub@npm:0.12.7#.yarn/patches/changelogithub-npm-0.12.7-72f348805d.patch"
}
}

View File

@@ -0,0 +1,37 @@
<p align="center">
<h1 align="center">
Semaphore circuits
</h1>
<p align="center">Semaphore circuits to create and verify zero-knowledge proofs.</p>
</p>
<p align="center">
<a href="https://github.com/semaphore-protocol">
<img src="https://img.shields.io/badge/project-Semaphore-blue.svg?style=flat-square">
</a>
<a href="https://github.com/semaphore-protocol/semaphore/blob/main/LICENSE">
<img alt="Github license" src="https://img.shields.io/github/license/semaphore-protocol/semaphore.svg?style=flat-square">
</a>
</p>
<div align="center">
<h4>
<a href="https://github.com/semaphore-protocol/semaphore/blob/main/CONTRIBUTING.md">
👥 Contributing
</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a href="https://github.com/semaphore-protocol/semaphore/blob/main/CODE_OF_CONDUCT.md">
🤝 Code of conduct
</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a href="https://github.com/semaphore-protocol/semaphore/contribute">
🔎 Issues
</a>
<span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
<a href="https://semaphore.appliedzkp.org/discord">
🗣️ Chat &amp; Support
</a>
</h4>
</div>
To learn more about circuits visit [semaphore.appliedzkp.org](https://semaphore.appliedzkp.org/docs/technical-reference/circuits).

View File

@@ -0,0 +1,7 @@
{
"name": "circuits",
"private": true,
"dependencies": {
"circomlib": "^2.0.2"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,90 @@
pragma circom 2.0.0;
include "../node_modules/circomlib/circuits/poseidon.circom";
include "./tree.circom";
template CalculateSecret() {
signal input identityNullifier;
signal input identityTrapdoor;
signal output out;
component poseidon = Poseidon(2);
poseidon.inputs[0] <== identityNullifier;
poseidon.inputs[1] <== identityTrapdoor;
out <== poseidon.out;
}
template CalculateIdentityCommitment() {
signal input secret;
signal output out;
component poseidon = Poseidon(1);
poseidon.inputs[0] <== secret;
out <== poseidon.out;
}
template CalculateNullifierHash() {
signal input externalNullifier;
signal input identityNullifier;
signal output out;
component poseidon = Poseidon(2);
poseidon.inputs[0] <== externalNullifier;
poseidon.inputs[1] <== identityNullifier;
out <== poseidon.out;
}
// The current Semaphore smart contracts require nLevels <= 32 and nLevels >= 16.
template Semaphore(nLevels) {
signal input identityNullifier;
signal input identityTrapdoor;
signal input treePathIndices[nLevels];
signal input treeSiblings[nLevels];
signal input signalHash;
signal input externalNullifier;
signal output root;
signal output nullifierHash;
component calculateSecret = CalculateSecret();
calculateSecret.identityNullifier <== identityNullifier;
calculateSecret.identityTrapdoor <== identityTrapdoor;
signal secret;
secret <== calculateSecret.out;
component calculateIdentityCommitment = CalculateIdentityCommitment();
calculateIdentityCommitment.secret <== secret;
component calculateNullifierHash = CalculateNullifierHash();
calculateNullifierHash.externalNullifier <== externalNullifier;
calculateNullifierHash.identityNullifier <== identityNullifier;
component inclusionProof = MerkleTreeInclusionProof(nLevels);
inclusionProof.leaf <== calculateIdentityCommitment.out;
for (var i = 0; i < nLevels; i++) {
inclusionProof.siblings[i] <== treeSiblings[i];
inclusionProof.pathIndices[i] <== treePathIndices[i];
}
root <== inclusionProof.root;
// Dummy square to prevent tampering signalHash.
signal signalHashSquared;
signalHashSquared <== signalHash * signalHash;
nullifierHash <== calculateNullifierHash.out;
}
component main {public [signalHash, externalNullifier]} = Semaphore(20);

View File

@@ -0,0 +1,40 @@
pragma circom 2.0.0;
include "../node_modules/circomlib/circuits/poseidon.circom";
include "../node_modules/circomlib/circuits/mux1.circom";
template MerkleTreeInclusionProof(nLevels) {
signal input leaf;
signal input pathIndices[nLevels];
signal input siblings[nLevels];
signal output root;
component poseidons[nLevels];
component mux[nLevels];
signal hashes[nLevels + 1];
hashes[0] <== leaf;
for (var i = 0; i < nLevels; i++) {
pathIndices[i] * (1 - pathIndices[i]) === 0;
poseidons[i] = Poseidon(2);
mux[i] = MultiMux1(2);
mux[i].c[0][0] <== hashes[i];
mux[i].c[0][1] <== siblings[i];
mux[i].c[1][0] <== siblings[i];
mux[i].c[1][1] <== hashes[i];
mux[i].s <== pathIndices[i];
poseidons[i].inputs[0] <== mux[i].out[0];
poseidons[i].inputs[1] <== mux[i].out[1];
hashes[i + 1] <== poseidons[i].out;
}
root <== hashes[nLevels];
}

View File

@@ -0,0 +1,4 @@
INFURA_API_KEY=
ETHEREUM_PRIVATE_KEY=
REPORT_GAS=false
COINMARKETCAP_API_KEY=

View File

@@ -0,0 +1,10 @@
node_modules
.env
coverage
coverage.json
typechain
typechain-types
# Hardhat files
cache
artifacts

View File

@@ -0,0 +1,54 @@
# Semaphore Hardhat template
This project demonstrates a basic Semaphore use case. It comes with a sample contract, a test for that contract and a sample task that deploys that contract.
## Usage
### Compile
```bash
yarn compile
```
### Testing
```bash
yarn test
```
You can also generate a test coverage report:
```bash
yarn test:coverage
```
Or a test gas report:
```bash
yarn test:report-gas
```
### Deploy
1. Copy the `.env.example` file as `.env`.
```bash
cp .env.example .env
```
2. Add your environment variables.
> **Note**
> You should at least set a valid Ethereum URL (e.g. Infura) and a private key with some ethers.
3. And deploy your contract.
```bash
yarn deploy --semaphore <semaphore-address> --group <group-id> --network goerli
```
> **Note**
> Check the Semaphore contract addresses [here](https://semaphore.appliedzkp.org/docs/deployed-contracts#semaphore).
> **Warning**
> The group id is a number!

View File

@@ -0,0 +1,30 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@semaphore-protocol/contracts/interfaces/ISemaphore.sol";
contract Feedback {
ISemaphore public semaphore;
uint256 public groupId;
constructor(address semaphoreAddress, uint256 _groupId) {
semaphore = ISemaphore(semaphoreAddress);
groupId = _groupId;
semaphore.createGroup(groupId, 20, address(this));
}
function joinGroup(uint256 identityCommitment) external {
semaphore.addMember(groupId, identityCommitment);
}
function sendFeedback(
uint256 feedback,
uint256 merkleTreeRoot,
uint256 nullifierHash,
uint256[8] calldata proof
) external {
semaphore.verifyProof(groupId, merkleTreeRoot, feedback, nullifierHash, groupId, proof);
}
}

View File

@@ -0,0 +1,77 @@
import "@nomiclabs/hardhat-ethers"
import "@nomicfoundation/hardhat-chai-matchers"
import "@semaphore-protocol/hardhat"
import "@typechain/hardhat"
import { config as dotenvConfig } from "dotenv"
import "hardhat-gas-reporter"
import { HardhatUserConfig } from "hardhat/config"
import { NetworksUserConfig } from "hardhat/types"
import "solidity-coverage"
import { config } from "./package.json"
import "./tasks/deploy"
dotenvConfig()
function getNetworks(): NetworksUserConfig {
if (!process.env.INFURA_API_KEY || !process.env.ETHEREUM_PRIVATE_KEY) {
return {}
}
const accounts = [`0x${process.env.ETHEREUM_PRIVATE_KEY}`]
const infuraApiKey = process.env.INFURA_API_KEY
return {
goerli: {
url: `https://goerli.infura.io/v3/${infuraApiKey}`,
chainId: 5,
accounts
},
sepolia: {
url: `https://sepolia.infura.io/v3/${infuraApiKey}`,
chainId: 11155111,
accounts
},
mumbai: {
url: `https://polygon-mumbai.infura.io/v3/${infuraApiKey}`,
chainId: 80001,
accounts
},
"optimism-goerli": {
url: `https://optimism-goerli.infura.io/v3/${infuraApiKey}`,
chainId: 420,
accounts
},
arbitrum: {
url: `https://arbitrum-mainnet.infura.io/v3/${infuraApiKey}`,
chainId: 42161,
accounts
}
}
}
const hardhatConfig: HardhatUserConfig = {
solidity: config.solidity,
paths: {
sources: config.paths.contracts,
tests: config.paths.tests,
cache: config.paths.cache,
artifacts: config.paths.build.contracts
},
networks: {
hardhat: {
chainId: 1337
},
...getNetworks()
},
gasReporter: {
currency: "USD",
enabled: process.env.REPORT_GAS === "true",
coinmarketcap: process.env.COINMARKETCAP_API_KEY
},
typechain: {
outDir: config.paths.build.typechain,
target: "ethers-v5"
}
}
export default hardhatConfig

View File

@@ -0,0 +1,78 @@
{
"name": "@semaphore-protocol/cli-template-contracts-hardhat",
"version": "3.11.0",
"description": "Semaphore Hardhat template.",
"license": "Unlicense",
"files": [
"files.tgz",
"contracts/",
"scripts/",
"tasks/",
"test/",
".env.example",
"hardhat.config.ts",
"tsconfig.json",
"README.md"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"dev": "hardhat node & yarn compile && yarn deploy --network localhost",
"compile": "hardhat compile",
"download:snark-artifacts": "hardhat run scripts/download-snark-artifacts.ts",
"deploy": "yarn compile && hardhat deploy",
"test": "hardhat run scripts/download-snark-artifacts.ts && hardhat test",
"test:report-gas": "REPORT_GAS=true hardhat test",
"test:coverage": "hardhat coverage",
"typechain": "hardhat typechain",
"prepublish": "tar -czf files.tgz .gitignore"
},
"devDependencies": {
"@ethersproject/abi": "^5.4.7",
"@ethersproject/providers": "^5.4.7",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.0",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-toolbox": "^2.0.0",
"@nomiclabs/hardhat-ethers": "^2.0.0",
"@nomiclabs/hardhat-etherscan": "^3.0.0",
"@semaphore-protocol/group": "3.11.0",
"@semaphore-protocol/hardhat": "3.11.0",
"@semaphore-protocol/identity": "3.11.0",
"@semaphore-protocol/proof": "3.11.0",
"@typechain/ethers-v5": "^10.1.0",
"@typechain/hardhat": "^6.1.2",
"@types/chai": "^4.2.0",
"@types/download": "^8.0.1",
"@types/mocha": "^9.1.0",
"@types/node": ">=12.0.0",
"chai": "^4.2.0",
"dotenv": "^16.0.3",
"download": "^8.0.0",
"ethers": "^5.4.7",
"hardhat": "^2.11.0",
"hardhat-gas-reporter": "^1.0.8",
"solidity-coverage": "^0.8.1",
"ts-node": ">=8.0.0",
"typechain": "^8.1.0",
"typescript": ">=4.5.0"
},
"dependencies": {
"@semaphore-protocol/contracts": "3.11.0"
},
"config": {
"solidity": {
"version": "0.8.4"
},
"paths": {
"contracts": "./contracts",
"tests": "./test",
"cache": "./cache",
"build": {
"snark-artifacts": "./build/snark-artifacts",
"contracts": "./build/contracts",
"typechain": "./build/typechain"
}
}
}
}

View File

@@ -0,0 +1,24 @@
import download from "download"
import fs from "fs"
import { config } from "../package.json"
async function main() {
const snarkArtifactsPath = config.paths.build["snark-artifacts"]
const url = `http://www.trusted-setup-pse.org/semaphore/${20}`
if (!fs.existsSync(snarkArtifactsPath)) {
fs.mkdirSync(snarkArtifactsPath, { recursive: true })
}
if (!fs.existsSync(`${snarkArtifactsPath}/semaphore.zkey`)) {
await download(`${url}/semaphore.wasm`, snarkArtifactsPath)
await download(`${url}/semaphore.zkey`, snarkArtifactsPath)
}
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error)
process.exit(1)
})

View File

@@ -0,0 +1,31 @@
import { task, types } from "hardhat/config"
task("deploy", "Deploy a Feedback contract")
.addOptionalParam("semaphore", "Semaphore contract address", undefined, types.string)
.addOptionalParam("group", "Group id", "42", types.string)
.addOptionalParam("logs", "Print the logs", true, types.boolean)
.setAction(async ({ logs, semaphore: semaphoreAddress, group: groupId }, { ethers, run }) => {
if (!semaphoreAddress) {
const { semaphore } = await run("deploy:semaphore", {
logs
})
semaphoreAddress = semaphore.address
}
if (!groupId) {
groupId = process.env.GROUP_ID
}
const FeedbackFactory = await ethers.getContractFactory("Feedback")
const feedbackContract = await FeedbackFactory.deploy(semaphoreAddress, groupId)
await feedbackContract.deployed()
if (logs) {
console.info(`Feedback contract has been deployed to: ${feedbackContract.address}`)
}
return feedbackContract
})

View File

@@ -0,0 +1,69 @@
import { Group } from "@semaphore-protocol/group"
import { Identity } from "@semaphore-protocol/identity"
import { generateProof } from "@semaphore-protocol/proof"
import { expect } from "chai"
import { formatBytes32String } from "ethers/lib/utils"
import { run } from "hardhat"
// @ts-ignore: typechain folder will be generated after contracts compilation
import { Feedback } from "../build/typechain"
import { config } from "../package.json"
describe("Feedback", () => {
let feedbackContract: Feedback
let semaphoreContract: string
const groupId = "42"
const group = new Group(groupId)
const users: Identity[] = []
before(async () => {
const { semaphore } = await run("deploy:semaphore", {
logs: false
})
feedbackContract = await run("deploy", { logs: false, group: groupId, semaphore: semaphore.address })
semaphoreContract = semaphore
users.push(new Identity())
users.push(new Identity())
})
describe("# joinGroup", () => {
it("Should allow users to join the group", async () => {
for await (const [i, user] of users.entries()) {
const transaction = feedbackContract.joinGroup(user.commitment)
group.addMember(user.commitment)
await expect(transaction)
.to.emit(semaphoreContract, "MemberAdded")
.withArgs(groupId, i, user.commitment, group.root)
}
})
})
describe("# sendFeedback", () => {
const wasmFilePath = `${config.paths.build["snark-artifacts"]}/semaphore.wasm`
const zkeyFilePath = `${config.paths.build["snark-artifacts"]}/semaphore.zkey`
it("Should allow users to send feedback anonymously", async () => {
const feedback = formatBytes32String("Hello World")
const fullProof = await generateProof(users[1], group, groupId, feedback, {
wasmFilePath,
zkeyFilePath
})
const transaction = feedbackContract.sendFeedback(
feedback,
fullProof.merkleTreeRoot,
fullProof.nullifierHash,
fullProof.proof
)
await expect(transaction)
.to.emit(semaphoreContract, "ProofVerified")
.withArgs(groupId, fullProof.merkleTreeRoot, fullProof.nullifierHash, groupId, fullProof.signal)
})
})
})

View File

@@ -0,0 +1,15 @@
{
"compilerOptions": {
"moduleResolution": "Node",
"noImplicitAny": true,
"resolveJsonModule": true,
"target": "ES2018",
"module": "CommonJS",
"strict": true,
"esModuleInterop": true,
"outDir": "dist",
"typeRoots": ["node_modules/@types", "types"]
},
"include": ["scripts/**/*", "tasks/**/*", "test/**/*", "build/typechain/**/*", "types/**/*"],
"files": ["./hardhat.config.ts"]
}

View File

@@ -0,0 +1,13 @@
#root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
indent_size = 4
[*.md]
trim_trailing_whitespace = false

View File

@@ -0,0 +1,10 @@
DEFAULT_NETWORK=localhost
INFURA_API_KEY=
ETHEREUM_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
FEEDBACK_CONTRACT_ADDRESS=0x5fc8d32690cc91d4c39d9d3abcbd16989f875707
SEMAPHORE_CONTRACT_ADDRESS=0xdc64a140aa3e981100a9beca4e685f962f0cf6c9
OPENZEPPELIN_AUTOTASK_WEBHOOK=
GROUP_ID=42
REPORT_GAS=false
COINMARKETCAP_API_KEY=
ETHERSCAN_API_KEY=

View File

@@ -0,0 +1,45 @@
# dependencies
node_modules
package-lock.json
yarn.lock
.yarn
# testing
coverage
coverage.json
# docs
docs
# types
types
# production
dist
build
cache
contract-artifacts
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Next.js
.next/
out/
# The Graph
generated
# Auto Generated PWA files
**/public/sw.js
**/public/workbox-*.js
**/public/worker-*.js
**/public/sw.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map

View File

@@ -0,0 +1,36 @@
{
"root": true,
"env": {
"es6": true
},
"extends": ["airbnb-base", "airbnb-typescript/base", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"project": ["./**/tsconfig.json"]
},
"plugins": ["@typescript-eslint"],
"rules": {
"no-underscore-dangle": "off",
"no-alert": "off",
"no-nested-ternary": "off",
"import/no-extraneous-dependencies": "off",
"import/extensions": "off",
"import/no-relative-packages": "off",
"no-await-in-loop": "off",
"no-bitwise": "off",
"no-restricted-syntax": "off",
"no-console": ["warn", { "allow": ["info", "warn", "error"] }],
"@typescript-eslint/lines-between-class-members": "off",
"no-param-reassign": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase", "PascalCase", "UPPER_CASE", "snake_case"],
"leadingUnderscore": "allow"
}
]
}
}

View File

@@ -0,0 +1,122 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# IDE
.vscode
.idea
# Cargo
target
# Testing
coverage
coverage.json
*.lcov
# Dependency directories
node_modules/
# TypeScript cache
*.tsbuildinfo
# Output of 'npm pack'
*.tgz
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Yarn Integrity file
.yarn-integrity
# Generate output
dist
build
cache
# Next.js
.next/
out/
# vercel
.vercel
# typescript
next-env.d.ts
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# Optional npm cache directory
.npm
*.DS_Store
# yarn v3
.pnp.*
.pnp.js
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# The Graph
generated
# Auto Generated PWA files
**/public/sw.js
**/public/workbox-*.js
**/public/worker-*.js
**/public/sw.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map
#amplify-do-not-edit-begin
amplify/\#current-cloud-backend
amplify/.config/local-*
amplify/logs
amplify/mock-data
amplify/mock-api-resources
amplify/backend/amplify-meta.json
amplify/backend/.temp
build/
dist/
node_modules/
aws-exports.js
awsconfiguration.json
amplifyconfiguration.json
amplifyconfiguration.dart
amplify-build-config.json
amplify-gradle-config.json
amplifytools.xcconfig
.secret-*
**.sample
#amplify-do-not-edit-end
# Others
files.tgz

View File

@@ -0,0 +1,45 @@
# dependencies
node_modules
package-lock.json
yarn.lock
.yarn
# testing
coverage
coverage.json
# docs
docs
# production
dist
build
cache
contract-artifacts
# github
.github/ISSUE_TEMPLATE
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Next.js
.next/
out/
# The Graph
generated
# Auto Generated PWA files
**/public/sw.js
**/public/workbox-*.js
**/public/worker-*.js
**/public/sw.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map

View File

@@ -0,0 +1,5 @@
{
"semi": false,
"arrowParens": "always",
"trailingComma": "none"
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
b3cadff6efb37a12712d12c2553ec703dbcaa4dd

View File

@@ -0,0 +1,9 @@
checksumBehavior: update
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
yarnPath: .yarn/releases/yarn-3.2.1.cjs

View File

@@ -0,0 +1,59 @@
# Semaphore Hardhat + Next.js + SemaphoreEthers template
This project is a complete application that demonstrates a basic Semaphore use case. It comes with a sample contract, a test for that contract and a sample task that deploys that contract. It also contains a frontend to play around with the contract.
## 📜 Usage
Copy the `.env.example` file as `.env`:
```bash
cp .env.example .env
```
and add your environment variables or run the app in a local network.
### Local server
You can start your app locally with:
```bash
yarn dev
```
### Deploy the contract
1. Go to the `apps/contracts` directory and deploy your contract:
```bash
yarn deploy --semaphore <semaphore-address> --group <group-id> --network arbitrum-goerli
```
2. Update your `.env` file with your new contract address, the group id and the semaphore contract address.
3. Copy your contract artifacts from `apps/contracts/build/contracts/contracts` folder to `apps/web-app/contract-artifacts` folders manually. Or run `yarn copy:contract-artifacts` in the project root to do it automatically.
> **Note**
> Check the Semaphore contract addresses [here](https://semaphore.appliedzkp.org/docs/deployed-contracts).
> **Warning**
> The group id is a number!
### Code quality and formatting
Run [ESLint](https://eslint.org/) to analyze the code and catch bugs:
```bash
yarn lint
```
Run [Prettier](https://prettier.io/) to check formatting rules:
```bash
yarn prettier
```
or to automatically format the code:
```bash
yarn prettier:write
```

View File

@@ -0,0 +1,3 @@
{
"extends": "solhint:default"
}

View File

@@ -0,0 +1,30 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@semaphore-protocol/contracts/interfaces/ISemaphore.sol";
contract Feedback {
ISemaphore public semaphore;
uint256 public groupId;
constructor(address semaphoreAddress, uint256 _groupId) {
semaphore = ISemaphore(semaphoreAddress);
groupId = _groupId;
semaphore.createGroup(groupId, 20, address(this));
}
function joinGroup(uint256 identityCommitment) external {
semaphore.addMember(groupId, identityCommitment);
}
function sendFeedback(
uint256 feedback,
uint256 merkleTreeRoot,
uint256 nullifierHash,
uint256[8] calldata proof
) external {
semaphore.verifyProof(groupId, merkleTreeRoot, feedback, nullifierHash, groupId, proof);
}
}

View File

@@ -0,0 +1,87 @@
import "@nomicfoundation/hardhat-chai-matchers"
import "@nomiclabs/hardhat-ethers"
import "@nomiclabs/hardhat-etherscan"
import "@semaphore-protocol/hardhat"
import "@typechain/hardhat"
import { config as dotenvConfig } from "dotenv"
import "hardhat-gas-reporter"
import { HardhatUserConfig } from "hardhat/config"
import { NetworksUserConfig } from "hardhat/types"
import { resolve } from "path"
import "solidity-coverage"
import { config } from "./package.json"
import "./tasks/deploy"
dotenvConfig({ path: resolve(__dirname, "../../.env") })
function getNetworks(): NetworksUserConfig {
if (!process.env.INFURA_API_KEY || !process.env.ETHEREUM_PRIVATE_KEY) {
return {}
}
const accounts = [`0x${process.env.ETHEREUM_PRIVATE_KEY}`]
const infuraApiKey = process.env.INFURA_API_KEY
return {
goerli: {
url: `https://goerli.infura.io/v3/${infuraApiKey}`,
chainId: 5,
accounts
},
sepolia: {
url: `https://sepolia.infura.io/v3/${infuraApiKey}`,
chainId: 11155111,
accounts
},
mumbai: {
url: `https://polygon-mumbai.infura.io/v3/${infuraApiKey}`,
chainId: 80001,
accounts
},
"optimism-goerli": {
url: `https://optimism-goerli.infura.io/v3/${infuraApiKey}`,
chainId: 420,
accounts
},
"arbitrum-goerli": {
url: "https://goerli-rollup.arbitrum.io/rpc",
chainId: 421613,
accounts
},
arbitrum: {
url: "https://arb1.arbitrum.io/rpc",
chainId: 42161,
accounts
}
}
}
const hardhatConfig: HardhatUserConfig = {
solidity: config.solidity,
paths: {
sources: config.paths.contracts,
tests: config.paths.tests,
cache: config.paths.cache,
artifacts: config.paths.build.contracts
},
networks: {
hardhat: {
chainId: 1337
},
...getNetworks()
},
gasReporter: {
currency: "USD",
enabled: process.env.REPORT_GAS === "true",
coinmarketcap: process.env.COINMARKETCAP_API_KEY
},
typechain: {
outDir: config.paths.build.typechain,
target: "ethers-v5"
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY
}
}
export default hardhatConfig

View File

@@ -0,0 +1,60 @@
{
"name": "monorepo-ethers-contracts",
"version": "1.0.0",
"private": true,
"main": "index.js",
"scripts": {
"dev": "hardhat node & yarn compile && yarn deploy --network localhost",
"compile": "hardhat compile",
"download:snark-artifacts": "hardhat run scripts/download-snark-artifacts.ts",
"deploy": "yarn compile && hardhat deploy",
"test": "hardhat run scripts/download-snark-artifacts.ts && hardhat test",
"test:report-gas": "REPORT_GAS=true hardhat test",
"test:coverage": "hardhat coverage",
"typechain": "hardhat typechain",
"lint": "solhint 'contracts/**/*.sol'"
},
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^1.0.5",
"@nomiclabs/hardhat-ethers": "^2.0.0",
"@nomiclabs/hardhat-etherscan": "^3.1.7",
"@semaphore-protocol/group": "3.11.0",
"@semaphore-protocol/hardhat": "3.11.0",
"@semaphore-protocol/identity": "3.11.0",
"@semaphore-protocol/proof": "3.11.0",
"@typechain/ethers-v5": "^10.0.0",
"@typechain/hardhat": "^6.0.0",
"@types/chai": "^4.3.1",
"@types/download": "^8.0.1",
"@types/mocha": "^9.1.1",
"chai": "^4.2.0",
"dotenv": "^14.3.2",
"download": "^8.0.0",
"ethers": "^5.0.0",
"hardhat": "^2.8.4",
"hardhat-gas-reporter": "^1.0.8",
"prettier-plugin-solidity": "^1.0.0-beta.19",
"solhint": "^3.3.6",
"solhint-plugin-prettier": "^0.0.5",
"solidity-coverage": "^0.7.21",
"typechain": "^8.0.0"
},
"dependencies": {
"@semaphore-protocol/contracts": "3.11.0"
},
"config": {
"solidity": {
"version": "0.8.4"
},
"paths": {
"contracts": "./contracts",
"tests": "./test",
"cache": "./cache",
"build": {
"snark-artifacts": "./build/snark-artifacts",
"contracts": "./build/contracts",
"typechain": "./build/typechain"
}
}
}
}

View File

@@ -0,0 +1,24 @@
import download from "download"
import fs from "fs"
import { config } from "../package.json"
async function main() {
const snarkArtifactsPath = config.paths.build["snark-artifacts"]
const url = `http://www.trusted-setup-pse.org/semaphore/${20}`
if (!fs.existsSync(snarkArtifactsPath)) {
fs.mkdirSync(snarkArtifactsPath, { recursive: true })
}
if (!fs.existsSync(`${snarkArtifactsPath}/semaphore.zkey`)) {
await download(`${url}/semaphore.wasm`, snarkArtifactsPath)
await download(`${url}/semaphore.zkey`, snarkArtifactsPath)
}
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error)
process.exit(1)
})

View File

@@ -0,0 +1,31 @@
import { task, types } from "hardhat/config"
task("deploy", "Deploy a Feedback contract")
.addOptionalParam("semaphore", "Semaphore contract address", undefined, types.string)
.addOptionalParam("group", "Group id", "42", types.string)
.addOptionalParam("logs", "Print the logs", true, types.boolean)
.setAction(async ({ logs, semaphore: semaphoreAddress, group: groupId }, { ethers, run }) => {
if (!semaphoreAddress) {
const { semaphore } = await run("deploy:semaphore", {
logs
})
semaphoreAddress = semaphore.address
}
if (!groupId) {
groupId = process.env.GROUP_ID
}
const FeedbackFactory = await ethers.getContractFactory("Feedback")
const feedbackContract = await FeedbackFactory.deploy(semaphoreAddress, groupId)
await feedbackContract.deployed()
if (logs) {
console.info(`Feedback contract has been deployed to: ${feedbackContract.address}`)
}
return feedbackContract
})

View File

@@ -0,0 +1,69 @@
import { Group } from "@semaphore-protocol/group"
import { Identity } from "@semaphore-protocol/identity"
import { generateProof } from "@semaphore-protocol/proof"
import { expect } from "chai"
import { formatBytes32String } from "ethers/lib/utils"
import { run } from "hardhat"
// @ts-ignore: typechain folder will be generated after contracts compilation
import { Feedback } from "../build/typechain"
import { config } from "../package.json"
describe("Feedback", () => {
let feedbackContract: Feedback
let semaphoreContract: string
const groupId = "42"
const group = new Group(groupId)
const users: Identity[] = []
before(async () => {
const { semaphore } = await run("deploy:semaphore", {
logs: false
})
feedbackContract = await run("deploy", { logs: false, group: groupId, semaphore: semaphore.address })
semaphoreContract = semaphore
users.push(new Identity())
users.push(new Identity())
})
describe("# joinGroup", () => {
it("Should allow users to join the group", async () => {
for await (const [i, user] of users.entries()) {
const transaction = feedbackContract.joinGroup(user.commitment)
group.addMember(user.commitment)
await expect(transaction)
.to.emit(semaphoreContract, "MemberAdded")
.withArgs(groupId, i, user.commitment, group.root)
}
})
})
describe("# sendFeedback", () => {
const wasmFilePath = `${config.paths.build["snark-artifacts"]}/semaphore.wasm`
const zkeyFilePath = `${config.paths.build["snark-artifacts"]}/semaphore.zkey`
it("Should allow users to send feedback anonymously", async () => {
const feedback = formatBytes32String("Hello World")
const fullProof = await generateProof(users[1], group, groupId, feedback, {
wasmFilePath,
zkeyFilePath
})
const transaction = feedbackContract.sendFeedback(
feedback,
fullProof.merkleTreeRoot,
fullProof.nullifierHash,
fullProof.proof
)
await expect(transaction)
.to.emit(semaphoreContract, "ProofVerified")
.withArgs(groupId, fullProof.merkleTreeRoot, fullProof.nullifierHash, groupId, fullProof.signal)
})
})
})

View File

@@ -0,0 +1,15 @@
{
"compilerOptions": {
"moduleResolution": "Node",
"noImplicitAny": true,
"resolveJsonModule": true,
"target": "ES2018",
"module": "CommonJS",
"strict": true,
"esModuleInterop": true,
"outDir": "dist",
"typeRoots": ["node_modules/@types", "types"]
},
"include": ["scripts/**/*", "tasks/**/*", "test/**/*", "build/typechain/**/*", "types/**/*"],
"files": ["./hardhat.config.ts"]
}

View File

@@ -0,0 +1,94 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "Feedback",
"sourceName": "contracts/Feedback.sol",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "semaphoreAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "_groupId",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "groupId",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "identityCommitment",
"type": "uint256"
}
],
"name": "joinGroup",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "semaphore",
"outputs": [
{
"internalType": "contract ISemaphore",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "feedback",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "merkleTreeRoot",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "nullifierHash",
"type": "uint256"
},
{
"internalType": "uint256[8]",
"name": "proof",
"type": "uint256[8]"
}
],
"name": "sendFeedback",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b506040516106e13803806106e18339818101604052810190610032919061013c565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060018190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c1121416001546014306040518463ffffffff1660e01b81526004016100d9939291906101a5565b600060405180830381600087803b1580156100f357600080fd5b505af1158015610107573d6000803e3d6000fd5b505050505050610258565b6000815190506101218161022a565b92915050565b60008151905061013681610241565b92915050565b6000806040838503121561014f57600080fd5b600061015d85828601610112565b925050602061016e85828601610127565b9150509250929050565b610181816101dc565b82525050565b61019081610218565b82525050565b61019f8161020e565b82525050565b60006060820190506101ba6000830186610196565b6101c76020830185610187565b6101d46040830184610178565b949350505050565b60006101e7826101ee565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006102238261020e565b9050919050565b610233816101dc565b811461023e57600080fd5b50565b61024a8161020e565b811461025557600080fd5b50565b61047a806102676000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80637b5d253414610051578063a0f44c921461006f578063d18ed1e91461008d578063eed02e4b146100a9575b600080fd5b6100596100c5565b604051610066919061030f565b60405180910390f35b6100776100e9565b604051610084919061032a565b60405180910390f35b6100a760048036038101906100a2919061027c565b6100ef565b005b6100c360048036038101906100be9190610253565b61018e565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633bc778e3600154858786600154876040518763ffffffff1660e01b81526004016101569695949392919061036e565b600060405180830381600087803b15801561017057600080fd5b505af1158015610184573d6000803e3d6000fd5b5050505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631783efc3600154836040518363ffffffff1660e01b81526004016101eb929190610345565b600060405180830381600087803b15801561020557600080fd5b505af1158015610219573d6000803e3d6000fd5b5050505050565b60008190508260206008028201111561023857600080fd5b92915050565b60008135905061024d8161042d565b92915050565b60006020828403121561026557600080fd5b60006102738482850161023e565b91505092915050565b600080600080610160858703121561029357600080fd5b60006102a18782880161023e565b94505060206102b28782880161023e565b93505060406102c38782880161023e565b92505060606102d487828801610220565b91505092959194509250565b6102ed610100838361041e565b5050565b6102fa816103fa565b82525050565b610309816103f0565b82525050565b600060208201905061032460008301846102f1565b92915050565b600060208201905061033f6000830184610300565b92915050565b600060408201905061035a6000830185610300565b6103676020830184610300565b9392505050565b60006101a0820190506103846000830189610300565b6103916020830188610300565b61039e6040830187610300565b6103ab6060830186610300565b6103b86080830185610300565b6103c560a08301846102e0565b979650505050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006104058261040c565b9050919050565b6000610417826103d0565b9050919050565b82818337600083830152505050565b610436816103f0565b811461044157600080fd5b5056fea26469706673582212204d8dc3161abc759242364c3a754a86e5eb8653092bcdf1e20bd6fcd368e1997664736f6c63430008040033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80637b5d253414610051578063a0f44c921461006f578063d18ed1e91461008d578063eed02e4b146100a9575b600080fd5b6100596100c5565b604051610066919061030f565b60405180910390f35b6100776100e9565b604051610084919061032a565b60405180910390f35b6100a760048036038101906100a2919061027c565b6100ef565b005b6100c360048036038101906100be9190610253565b61018e565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633bc778e3600154858786600154876040518763ffffffff1660e01b81526004016101569695949392919061036e565b600060405180830381600087803b15801561017057600080fd5b505af1158015610184573d6000803e3d6000fd5b5050505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631783efc3600154836040518363ffffffff1660e01b81526004016101eb929190610345565b600060405180830381600087803b15801561020557600080fd5b505af1158015610219573d6000803e3d6000fd5b5050505050565b60008190508260206008028201111561023857600080fd5b92915050565b60008135905061024d8161042d565b92915050565b60006020828403121561026557600080fd5b60006102738482850161023e565b91505092915050565b600080600080610160858703121561029357600080fd5b60006102a18782880161023e565b94505060206102b28782880161023e565b93505060406102c38782880161023e565b92505060606102d487828801610220565b91505092959194509250565b6102ed610100838361041e565b5050565b6102fa816103fa565b82525050565b610309816103f0565b82525050565b600060208201905061032460008301846102f1565b92915050565b600060208201905061033f6000830184610300565b92915050565b600060408201905061035a6000830185610300565b6103676020830184610300565b9392505050565b60006101a0820190506103846000830189610300565b6103916020830188610300565b61039e6040830187610300565b6103ab6060830186610300565b6103b86080830185610300565b6103c560a08301846102e0565b979650505050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006104058261040c565b9050919050565b6000610417826103d0565b9050919050565b82818337600083830152505050565b610436816103f0565b811461044157600080fd5b5056fea26469706673582212204d8dc3161abc759242364c3a754a86e5eb8653092bcdf1e20bd6fcd368e1997664736f6c63430008040033",
"linkReferences": {},
"deployedLinkReferences": {}
}

View File

@@ -0,0 +1,45 @@
/** @type {import('next').NextConfig} */
const fs = require("fs")
const withPWA = require("next-pwa")
if (!fs.existsSync("./.env")) {
// eslint-disable-next-line global-require
require("dotenv").config({ path: "../../.env" })
}
const nextConfig = withPWA({
dest: "public",
disable: process.env.NODE_ENV === "development"
})({
eslint: {
ignoreDuringBuilds: true
},
reactStrictMode: true,
swcMinify: true,
env: {
DEFAULT_NETWORK: process.env.DEFAULT_NETWORK,
INFURA_API_KEY: process.env.INFURA_API_KEY,
ETHEREUM_PRIVATE_KEY: process.env.ETHEREUM_PRIVATE_KEY,
FEEDBACK_CONTRACT_ADDRESS: process.env.FEEDBACK_CONTRACT_ADDRESS,
SEMAPHORE_CONTRACT_ADDRESS: process.env.SEMAPHORE_CONTRACT_ADDRESS
},
publicRuntimeConfig: {
DEFAULT_NETWORK: process.env.DEFAULT_NETWORK,
FEEDBACK_CONTRACT_ADDRESS: process.env.FEEDBACK_CONTRACT_ADDRESS,
SEMAPHORE_CONTRACT_ADDRESS: process.env.SEMAPHORE_CONTRACT_ADDRESS,
OPENZEPPELIN_AUTOTASK_WEBHOOK: process.env.OPENZEPPELIN_AUTOTASK_WEBHOOK,
GROUP_ID: process.env.GROUP_ID
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.fallback = {
fs: false
}
}
return config
}
})
module.exports = nextConfig

View File

@@ -0,0 +1,27 @@
{
"name": "monorepo-ethers-web-app",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"export": "next export",
"start": "next start"
},
"dependencies": {
"@next/font": "13.0.3",
"@semaphore-protocol/data": "3.11.0",
"@semaphore-protocol/group": "3.11.0",
"@semaphore-protocol/identity": "3.11.0",
"@semaphore-protocol/proof": "3.11.0",
"@types/react": "18.0.25",
"@types/react-dom": "18.0.8",
"dotenv": "^16.0.3",
"ethers": "^5.7.2",
"next": "13.0.3",
"next-pwa": "^5.6.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "^4.7.3"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,31 @@
{
"theme_color": "#ebedff",
"background_color": "#ebedff",
"display": "standalone",
"scope": "/",
"start_url": "/",
"name": "Semaphore Boilerplate",
"short_name": "Semaphore",
"icons": [
{
"src": "/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "/icon-384x384.png",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

View File

@@ -0,0 +1,29 @@
export type StepperProps = {
step: number
onPrevClick?: () => void
onNextClick?: () => void
}
export default function Stepper({ step, onPrevClick, onNextClick }: StepperProps) {
return (
<div className="stepper">
{onPrevClick !== undefined ? (
<button className="button-stepper" disabled={!onPrevClick} onClick={onPrevClick || undefined}>
Prev
</button>
) : (
<span></span>
)}
<p>{step.toString()}/3</p>
{onNextClick !== undefined ? (
<button className="button-stepper" disabled={!onNextClick} onClick={onNextClick || undefined}>
Next
</button>
) : (
<span></span>
)}
</div>
)
}

View File

@@ -0,0 +1,11 @@
import React from "react"
export type LogsContextType = {
_logs: string
setLogs: (logs: string) => void
}
export default React.createContext<LogsContextType>({
_logs: "",
setLogs: (logs: string) => logs
})

View File

@@ -0,0 +1,19 @@
import React from "react"
export type SemaphoreContextType = {
_users: string[]
_feedback: string[]
refreshUsers: () => Promise<void>
addUser: (user: string) => void
refreshFeedback: () => Promise<void>
addFeedback: (feedback: string) => void
}
export default React.createContext<SemaphoreContextType>({
_users: [],
_feedback: [],
refreshUsers: () => Promise.resolve(),
addUser: () => {},
refreshFeedback: () => Promise.resolve(),
addFeedback: () => {}
})

View File

@@ -0,0 +1,57 @@
import { SemaphoreEthers } from "@semaphore-protocol/data"
import { BigNumber, utils } from "ethers"
import getNextConfig from "next/config"
import { useCallback, useState } from "react"
import { SemaphoreContextType } from "../context/SemaphoreContext"
const { publicRuntimeConfig: env } = getNextConfig()
const ethereumNetwork = env.DEFAULT_NETWORK === "localhost" ? "http://localhost:8545" : env.DEFAULT_NETWORK
export default function useSemaphore(): SemaphoreContextType {
const [_users, setUsers] = useState<any[]>([])
const [_feedback, setFeedback] = useState<string[]>([])
const refreshUsers = useCallback(async (): Promise<void> => {
const semaphore = new SemaphoreEthers(ethereumNetwork, {
address: env.SEMAPHORE_CONTRACT_ADDRESS
})
const members = await semaphore.getGroupMembers(env.GROUP_ID)
setUsers(members)
}, [])
const addUser = useCallback(
(user: any) => {
setUsers([..._users, user])
},
[_users]
)
const refreshFeedback = useCallback(async (): Promise<void> => {
const semaphore = new SemaphoreEthers(ethereumNetwork, {
address: env.SEMAPHORE_CONTRACT_ADDRESS
})
const proofs = await semaphore.getGroupVerifiedProofs(env.GROUP_ID)
setFeedback(proofs.map(({ signal }: any) => utils.parseBytes32String(BigNumber.from(signal).toHexString())))
}, [])
const addFeedback = useCallback(
(feedback: string) => {
setFeedback([..._feedback, feedback])
},
[_feedback]
)
return {
_users,
_feedback,
refreshUsers,
addUser,
refreshFeedback,
addFeedback
}
}

View File

@@ -0,0 +1,58 @@
import "../styles/globals.css"
import type { AppProps } from "next/app"
import Head from "next/head"
import { useRouter } from "next/router"
import { useEffect, useState } from "react"
import LogsContext from "../context/LogsContext"
import SemaphoreContext from "../context/SemaphoreContext"
import useSemaphore from "../hooks/useSemaphore"
import { Inter } from "@next/font/google"
const inter = Inter({ subsets: ["latin"] })
export default function App({ Component, pageProps }: AppProps) {
const router = useRouter()
const semaphore = useSemaphore()
const [_logs, setLogs] = useState<string>("")
useEffect(() => {
semaphore.refreshUsers()
semaphore.refreshFeedback()
}, [])
return (
<div className={inter.className}>
<Head>
<title>Semaphore template</title>
<link rel="icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#ebedff" />
</Head>
<div>
<div className="container">
<div id="body">
<SemaphoreContext.Provider value={semaphore}>
<LogsContext.Provider
value={{
_logs,
setLogs
}}
>
<Component {...pageProps} />
</LogsContext.Provider>
</SemaphoreContext.Provider>
</div>
</div>
<div className="footer">
{_logs.endsWith("...")}
<p>{_logs || `Current step: ${router.route}`}</p>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,48 @@
import { Contract, providers, Wallet } from "ethers"
import type { NextApiRequest, NextApiResponse } from "next"
import Feedback from "../../../contract-artifacts/Feedback.json"
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (typeof process.env.FEEDBACK_CONTRACT_ADDRESS !== "string") {
throw new Error("Please, define FEEDBACK_CONTRACT_ADDRESS in your .env file")
}
if (typeof process.env.DEFAULT_NETWORK !== "string") {
throw new Error("Please, define DEFAULT_NETWORK in your .env file")
}
if (typeof process.env.INFURA_API_KEY !== "string") {
throw new Error("Please, define INFURA_API_KEY in your .env file")
}
if (typeof process.env.ETHEREUM_PRIVATE_KEY !== "string") {
throw new Error("Please, define ETHEREUM_PRIVATE_KEY in your .env file")
}
const ethereumPrivateKey = process.env.ETHEREUM_PRIVATE_KEY
const ethereumNetwork = process.env.DEFAULT_NETWORK
const infuraApiKey = process.env.INFURA_API_KEY
const contractAddress = process.env.FEEDBACK_CONTRACT_ADDRESS
const provider =
ethereumNetwork === "localhost"
? new providers.JsonRpcProvider()
: new providers.InfuraProvider(ethereumNetwork, infuraApiKey)
const signer = new Wallet(ethereumPrivateKey, provider)
const contract = new Contract(contractAddress, Feedback.abi, signer)
const { feedback, merkleTreeRoot, nullifierHash, proof } = req.body
try {
const transaction = await contract.sendFeedback(feedback, merkleTreeRoot, nullifierHash, proof)
await transaction.wait()
res.status(200).end()
} catch (error: any) {
console.error(error)
res.status(500).end()
}
}

View File

@@ -0,0 +1,48 @@
import { Contract, providers, Wallet } from "ethers"
import type { NextApiRequest, NextApiResponse } from "next"
import Feedback from "../../../contract-artifacts/Feedback.json"
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (typeof process.env.FEEDBACK_CONTRACT_ADDRESS !== "string") {
throw new Error("Please, define FEEDBACK_CONTRACT_ADDRESS in your .env file")
}
if (typeof process.env.DEFAULT_NETWORK !== "string") {
throw new Error("Please, define DEFAULT_NETWORK in your .env file")
}
if (typeof process.env.INFURA_API_KEY !== "string") {
throw new Error("Please, define INFURA_API_KEY in your .env file")
}
if (typeof process.env.ETHEREUM_PRIVATE_KEY !== "string") {
throw new Error("Please, define ETHEREUM_PRIVATE_KEY in your .env file")
}
const ethereumPrivateKey = process.env.ETHEREUM_PRIVATE_KEY
const ethereumNetwork = process.env.DEFAULT_NETWORK
const infuraApiKey = process.env.INFURA_API_KEY
const contractAddress = process.env.FEEDBACK_CONTRACT_ADDRESS
const provider =
ethereumNetwork === "localhost"
? new providers.JsonRpcProvider()
: new providers.InfuraProvider(ethereumNetwork, infuraApiKey)
const signer = new Wallet(ethereumPrivateKey, provider)
const contract = new Contract(contractAddress, Feedback.abi, signer)
const { identityCommitment } = req.body
try {
const transaction = await contract.joinGroup(identityCommitment)
await transaction.wait()
res.status(200).end()
} catch (error: any) {
console.error(error)
res.status(500).end()
}
}

View File

@@ -0,0 +1,136 @@
import { Identity } from "@semaphore-protocol/identity"
import getNextConfig from "next/config"
import { useRouter } from "next/router"
import { useCallback, useContext, useEffect, useState } from "react"
import Feedback from "../../contract-artifacts/Feedback.json"
import Stepper from "../components/Stepper"
import LogsContext from "../context/LogsContext"
import SemaphoreContext from "../context/SemaphoreContext"
const { publicRuntimeConfig: env } = getNextConfig()
export default function GroupsPage() {
const router = useRouter()
const { setLogs } = useContext(LogsContext)
const { _users, refreshUsers, addUser } = useContext(SemaphoreContext)
const [_loading, setLoading] = useState(false)
const [_identity, setIdentity] = useState<Identity>()
useEffect(() => {
const identityString = localStorage.getItem("identity")
if (!identityString) {
router.push("/")
return
}
setIdentity(new Identity(identityString))
}, [])
useEffect(() => {
if (_users.length > 0) {
setLogs(`${_users.length} user${_users.length > 1 ? "s" : ""} retrieved from the group 🤙🏽`)
}
}, [_users])
const joinGroup = useCallback(async () => {
if (!_identity) {
return
}
setLoading(true)
setLogs(`Joining the Feedback group...`)
let response: any
if (env.OPENZEPPELIN_AUTOTASK_WEBHOOK) {
response = await fetch(env.OPENZEPPELIN_AUTOTASK_WEBHOOK, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
abi: Feedback.abi,
address: env.FEEDBACK_CONTRACT_ADDRESS,
functionName: "joinGroup",
functionParameters: [_identity.commitment.toString()]
})
})
} else {
response = await fetch("api/join", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
identityCommitment: _identity.commitment.toString()
})
})
}
if (response.status === 200) {
addUser(_identity.commitment.toString())
setLogs(`You joined the Feedback group event 🎉 Share your feedback anonymously!`)
} else {
setLogs("Some error occurred, please try again!")
}
setLoading(false)
}, [_identity])
const userHasJoined = useCallback((identity: Identity) => _users.includes(identity.commitment.toString()), [_users])
return (
<>
<h2>Groups</h2>
<p>
Semaphore{" "}
<a
href="https://semaphore.appliedzkp.org/docs/guides/groups"
target="_blank"
rel="noreferrer noopener nofollow"
>
groups
</a>{" "}
are binary incremental Merkle trees in which each leaf contains an identity commitment for a user.
Groups can be abstracted to represent events, polls, or organizations.
</p>
<div className="divider"></div>
<div className="text-top">
<h3>Feedback users ({_users.length})</h3>
<button className="button-link" onClick={refreshUsers}>
Refresh
</button>
</div>
<div>
<button
className="button"
onClick={joinGroup}
disabled={_loading || !_identity || userHasJoined(_identity)}
>
<span>Join group</span>
{_loading && <div className="loader"></div>}
</button>
</div>
{_users.length > 0 && (
<div>
{_users.map((user, i) => (
<div key={i}>
<p className="box box-text">{user}</p>
</div>
))}
</div>
)}
<div className="divider"></div>
<Stepper
step={2}
onPrevClick={() => router.push("/")}
onNextClick={_identity && userHasJoined(_identity) ? () => router.push("/proofs") : undefined}
/>
</>
)
}

View File

@@ -0,0 +1,89 @@
import { Identity } from "@semaphore-protocol/identity"
import { useRouter } from "next/router"
import { useCallback, useContext, useEffect, useState } from "react"
import Stepper from "../components/Stepper"
import LogsContext from "../context/LogsContext"
export default function IdentitiesPage() {
const router = useRouter()
const { setLogs } = useContext(LogsContext)
const [_identity, setIdentity] = useState<Identity>()
useEffect(() => {
const identityString = localStorage.getItem("identity")
if (identityString) {
const identity = new Identity(identityString)
setIdentity(identity)
setLogs("Your Semaphore identity was retrieved from the browser cache 👌🏽")
} else {
setLogs("Create your Semaphore identity 👆🏽")
}
}, [])
const createIdentity = useCallback(async () => {
const identity = new Identity()
setIdentity(identity)
localStorage.setItem("identity", identity.toString())
setLogs("Your new Semaphore identity was just created 🎉")
}, [])
return (
<>
<h2 className="font-size: 3rem;">Identities</h2>
<p>
Users interact with the protocol using a Semaphore{" "}
<a
href="https://semaphore.appliedzkp.org/docs/guides/identities"
target="_blank"
rel="noreferrer noopener nofollow"
>
identity
</a>{" "}
(similar to Ethereum accounts). It contains three values:
</p>
<ol>
<li>Trapdoor: private, known only by user</li>
<li>Nullifier: private, known only by user</li>
<li>Commitment: public</li>
</ol>
<div className="divider"></div>
<div className="text-top">
<h3>Identity</h3>
{_identity && (
<button className="button-link" onClick={createIdentity}>
New
</button>
)}
</div>
{_identity ? (
<div>
<div className="box">
<p className="box-text">Trapdoor: {_identity.trapdoor.toString()}</p>
<p className="box-text">Nullifier: {_identity.nullifier.toString()}</p>
<p className="box-text">Commitment: {_identity.commitment.toString()}</p>
</div>
</div>
) : (
<div>
<button className="button" onClick={createIdentity}>
Create identity
</button>
</div>
)}
<div className="divider"></div>
<Stepper step={1} onNextClick={_identity && (() => router.push("/groups"))} />
</>
)
}

View File

@@ -0,0 +1,156 @@
import { Group } from "@semaphore-protocol/group"
import { Identity } from "@semaphore-protocol/identity"
import { generateProof } from "@semaphore-protocol/proof"
import { BigNumber, utils } from "ethers"
import getNextConfig from "next/config"
import { useRouter } from "next/router"
import { useCallback, useContext, useEffect, useState } from "react"
import Feedback from "../../contract-artifacts/Feedback.json"
import Stepper from "../components/Stepper"
import LogsContext from "../context/LogsContext"
import SemaphoreContext from "../context/SemaphoreContext"
const { publicRuntimeConfig: env } = getNextConfig()
export default function ProofsPage() {
const router = useRouter()
const { setLogs } = useContext(LogsContext)
const { _users, _feedback, refreshFeedback, addFeedback } = useContext(SemaphoreContext)
const [_loading, setLoading] = useState(false)
const [_identity, setIdentity] = useState<Identity>()
useEffect(() => {
const identityString = localStorage.getItem("identity")
if (!identityString) {
router.push("/")
return
}
setIdentity(new Identity(identityString))
}, [])
useEffect(() => {
if (_feedback.length > 0) {
setLogs(`${_feedback.length} feedback retrieved from the group 🤙🏽`)
}
}, [_feedback])
const sendFeedback = useCallback(async () => {
if (!_identity) {
return
}
const feedback = prompt("Please enter your feedback:")
if (feedback && _users) {
setLoading(true)
setLogs(`Posting your anonymous feedback...`)
try {
const group = new Group(env.GROUP_ID)
const signal = BigNumber.from(utils.formatBytes32String(feedback)).toString()
group.addMembers(_users)
const { proof, merkleTreeRoot, nullifierHash } = await generateProof(
_identity,
group,
env.GROUP_ID,
signal
)
let response: any
if (env.OPENZEPPELIN_AUTOTASK_WEBHOOK) {
response = await fetch(env.OPENZEPPELIN_AUTOTASK_WEBHOOK, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
abi: Feedback.abi,
address: env.FEEDBACK_CONTRACT_ADDRESS,
functionName: "sendFeedback",
functionParameters: [signal, merkleTreeRoot, nullifierHash, proof]
})
})
} else {
response = await fetch("api/feedback", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
feedback: signal,
merkleTreeRoot,
nullifierHash,
proof
})
})
}
if (response.status === 200) {
addFeedback(feedback)
setLogs(`Your feedback was posted 🎉`)
} else {
setLogs("Some error occurred, please try again!")
}
} catch (error) {
console.error(error)
setLogs("Some error occurred, please try again!")
} finally {
setLoading(false)
}
}
}, [_identity])
return (
<>
<h2>Proofs</h2>
<p>
Semaphore members can anonymously{" "}
<a
href="https://semaphore.appliedzkp.org/docs/guides/proofs"
target="_blank"
rel="noreferrer noopener nofollow"
>
prove
</a>{" "}
that they are part of a group and that they are generating their own signals. Signals could be anonymous
votes, leaks, reviews, or feedback.
</p>
<div className="divider"></div>
<div className="text-top">
<h3>Feedback signals ({_feedback.length})</h3>
<button className="button-link" onClick={refreshFeedback}>
Refresh
</button>
</div>
<div>
<button className="button" onClick={sendFeedback} disabled={_loading}>
<span>Send Feedback</span>
{_loading && <div className="loader"></div>}
</button>
</div>
{_feedback.length > 0 && (
<div>
{_feedback.map((f, i) => (
<div key={i}>
<p className="box box-text">{f}</p>
</div>
))}
</div>
)}
<div className="divider"></div>
<Stepper step={3} onPrevClick={() => router.push("/groups")} />
</>
)
}

View File

@@ -0,0 +1,179 @@
:root {
--slate100: #f1f5f9;
--slate300: #cbd5e1;
--slate400: #94a3b8;
--slate700: #334155;
--blue200: #bfdbfe;
--blue600: #2563eb;
--blue800: #1e40af;
--blue900: #1e3a8a;
}
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html,
body {
max-width: 100vw;
overflow-x: hidden;
}
body {
color: var(--slate700);
}
p {
line-height: 1.5rem;
}
.container {
display: flex;
flex-direction: column;
height: 100%;
max-width: 32rem;
margin: auto;
padding: 1rem;
min-height: calc(100vh - 3.5rem);
}
.container #body {
margin-top: 3rem;
}
.text-top {
display: flex;
justify-content: space-between;
margin-bottom: 1rem;
}
ol {
padding: 1rem;
}
li {
margin-top: 1rem;
}
h2 {
font-size: 2.25rem;
font-weight: 700;
margin-bottom: 1rem;
}
h3 {
font-size: 1.125rem;
font-weight: 700;
}
.divider {
height: 1px;
background: var(--slate400);
margin: 2rem 0;
}
.stepper {
display: flex;
justify-content: space-between;
margin-bottom: 1rem;
}
a {
color: var(--blue600);
}
.button {
background-color: var(--blue800);
width: 100%;
padding: 0.8rem 1rem;
border-radius: 4px;
cursor: pointer;
color: var(--slate100);
font-size: 1.125rem;
font-weight: 700;
transition: all 200ms linear;
margin-top: 1rem;
margin-bottom: 1.5rem;
opacity: 0.9;
display: flex;
justify-content: space-between;
height: 3.5rem;
align-items: center;
}
.button:hover {
background-color: var(--blue900);
}
.button:disabled {
cursor: not-allowed;
opacity: 0.5;
}
.button:disabled:hover {
background-color: var(--blue800);
}
.button-stepper {
cursor: pointer;
color: var(--blue900);
font-size: 1.1rem;
border: none;
background: none;
}
.button-link {
cursor: pointer;
color: var(--slate700);
font-size: 1.1rem;
border: none;
background: none;
}
.box {
padding: 0.8rem;
border-style: solid;
border-width: 1px;
border-color: var(--slate300);
border-radius: 4px;
}
.box-text {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
margin: 0.5rem;
}
.footer {
background-color: var(--blue200);
padding: 1rem 0;
height: 3.5rem;
display: flex;
justify-content: center;
align-items: center;
font-weight: 700;
}
.loader {
width: 25px;
height: 25px;
border-radius: 50%;
border-top: 2px solid var(--slate100);
border-right: 2px solid transparent;
animation: spin 1s linear infinite;
z-index: 20;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}

View File

@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
},
"include": ["next.config.js", "next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}

View File

@@ -0,0 +1,44 @@
{
"name": "@semaphore-protocol/cli-template-monorepo-ethers",
"version": "3.11.0",
"description": "Semaphore Hardhat + Next.js + SemaphoreEthers template.",
"license": "Unlicense",
"files": [
"files.tgz",
"scripts/",
".editorconfig",
".env.example",
".eslintignore",
".eslintrc.json",
".prettierignore",
".prettierrc.json",
"tsconfig.json",
"README.md"
],
"scripts": {
"dev": "yarn workspaces foreach -pi run dev",
"dev:web-app": "yarn workspace monorepo-ethers-web-app dev",
"dev:contracts": "yarn workspace monorepo-ethers-contracts dev",
"lint": "eslint . --ext .js,.ts",
"prettier": "prettier -c .",
"prettier:write": "prettier -w .",
"copy:contract-artifacts": "ts-node scripts/copy-contract-artifacts.ts",
"prepublish": "tar -czf files.tgz .gitignore .yarn .yarnrc.yml apps"
},
"workspaces": [
"apps/*"
],
"devDependencies": {
"@types/node": "^17.0.9",
"@typescript-eslint/eslint-plugin": "^5.9.1",
"@typescript-eslint/parser": "^5.9.1",
"eslint": "^8.2.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.2",
"prettier": "^2.5.1",
"ts-node": "^10.8.1",
"typescript": "^4.7.3"
}
}

View File

@@ -0,0 +1,15 @@
import * as fs from "fs"
async function main() {
const contractArtifactsPath = "apps/contracts/build/contracts/contracts/Feedback.sol"
const webAppArtifactsPath = "apps/web-app/contract-artifacts"
await fs.promises.copyFile(`${contractArtifactsPath}/Feedback.json`, `${webAppArtifactsPath}/Feedback.json`)
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error)
process.exit(1)
})

View File

@@ -0,0 +1,3 @@
{
"include": ["scripts/**/*"]
}

View File

@@ -0,0 +1,13 @@
#root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
indent_size = 4
[*.md]
trim_trailing_whitespace = false

View File

@@ -0,0 +1,10 @@
DEFAULT_NETWORK=localhost
INFURA_API_KEY=
ETHEREUM_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
FEEDBACK_CONTRACT_ADDRESS=0x5fc8d32690cc91d4c39d9d3abcbd16989f875707
SEMAPHORE_CONTRACT_ADDRESS=0xdc64a140aa3e981100a9beca4e685f962f0cf6c9
OPENZEPPELIN_AUTOTASK_WEBHOOK=
GROUP_ID=42
REPORT_GAS=false
COINMARKETCAP_API_KEY=
ETHERSCAN_API_KEY=

Some files were not shown because too many files have changed in this diff Show More