semaphore-protocol / semaphore

A zero-knowledge protocol for anonymous interactions.
https://semaphore.pse.dev
MIT License
887 stars 194 forks source link

Add tree depth constants to JavaScript libraries and Solidity contracts #711

Closed vplasencia closed 6 months ago

vplasencia commented 6 months ago

Description

This PR adds tree depth constants to JavaScript libraries and Solidity contracts to follow good practices and make it easier to update these important values.

There is a new export in the @semaphore-protocol/utils library called constants which has the minimum and maximum Semaphore supported tree depth.

There is a new file called Constants.sol in the packages/contracts/contracts/base folder which has the minimum and maximum Semaphore supported tree depth.

With these updates, when the supported tree depths change, only these two files should be updated with the VK_POINTS variable in the SemaphoreVerifier.sol contract.

Related Issue(s)

Closes #683

Checklist

openzeppelin-code[bot] commented 6 months ago

Add tree depth constants to JavaScript libraries and Solidity contracts

Generated at commit: c3b9b98370598b78bc1d6d9d7e91546773f37631

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
0
0
0
4
16
20
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

aguzmant103 commented 5 months ago

@gitpoap-bot @0xbok @0xDatapunk

gitpoap-bot[bot] commented 5 months ago

Congrats, @0xbok @0xDatapunk ! You've earned a GitPOAP for your contribution!

GitPOAP: 2024 Semaphore Contributor:

GitPOAP: 2024 Semaphore Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

0xbok commented 5 months ago

wowow, thanks @aguzmant103 :)

0xDatapunk commented 5 months ago

Amazing!

On Mar 18, 2024, at 10:30 AM, 0xbok @.***> wrote:

wowow, thanks @aguzmant103https://github.com/aguzmant103 :)

— Reply to this email directly, view it on GitHubhttps://github.com/semaphore-protocol/semaphore/pull/711#issuecomment-2004074132, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AU3UMTQEADKX7XMUP4QKI3LYY33A7AVCNFSM6AAAAABEX6YKUCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUGA3TIMJTGI. You are receiving this because you were mentioned.Message ID: @.***>