privacy-scaling-explorations / zk-kit.solidity

A monorepo of reusable contracts for zero-knowledge technologies.
MIT License
10 stars 2 forks source link

ZK-Kit logo Solidity

Github license GitHub Main Workflow Coveralls Code style prettier Commitizen friendly

👥 Contributing   |   🤝 Code of conduct   |   🔎 Issues   |   🗣️ Chat & Support

| ZK-Kit is a set of libraries (algorithms or utility functions) that can be reused in different projects and zero-knowledge protocols, making it easier for developers to access user-friendly, tested, and documented code for common tasks. ZK-Kit provides different repositories for each language - this one contains Solidity code only. | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ## 🗂️ Repositories - Javascript: https://github.com/privacy-scaling-explorations/zk-kit - Solidity: https://github.com/privacy-scaling-explorations/zk-kit.solidity - Circom: https://github.com/privacy-scaling-explorations/zk-kit.circom - Noir: https://github.com/privacy-scaling-explorations/zk-kit.noir ## 📦 Packages
Package Version Downloads Audited
@zk-kit/imt.sol NPM version Downloads
@zk-kit/lean-imt.sol NPM version Downloads ✔️
@zk-kit/lazy-imt.sol NPM version Downloads
@zk-kit/excubiae NPM version Downloads
## 👥 Ways to contribute - 🔧 Work on [open issues](https://github.com/privacy-scaling-explorations/zk-kit.solidity/contribute) - 📦 Suggest new [packages](https://github.com/privacy-scaling-explorations/zk-kit.solidity/issues/new?assignees=&labels=feature+%3Arocket%3A&template=---package.md&title=) - 🚀 Share ideas for new [features](https://github.com/privacy-scaling-explorations/zk-kit.solidity/issues/new?assignees=&labels=feature+%3Arocket%3A&template=---feature.md&title=) - 🐛 Create a report if you find any [bugs](https://github.com/privacy-scaling-explorations/zk-kit.solidity/issues/new?assignees=&labels=bug+%F0%9F%90%9B&template=---bug.md&title=) in the code ## 🛠 Install Clone this repository: ```bash git clone https://github.com/privacy-scaling-explorations/zk-kit.solidity.git ``` and install the dependencies: ```bash cd zk-kit.solidity && yarn ``` ## 📜 Usage ### Code formatting Run [Prettier](https://prettier.io/) to check formatting rules: ```bash yarn format ``` or to automatically format the code: ```bash yarn format:write ``` ### Linting ```bash yarn lint ``` Will lint all the packages with [`solhint`](https://github.com/protofire/solhint) ### Static Analysis ```bash yarn slither ``` Will perform a static analysis of all the contracts with [`slither`](https://github.com/crytic/slither) to identify potential vulnerabilities. You'll need to [install slither](https://github.com/crytic/slither?tab=readme-ov-file#how-to-install) beforehand. ### Conventional commits ZK-Kit 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: ```bash yarn commit ``` It will also automatically check that the modified files comply with ESLint and Prettier rules. ### Testing Test the code: ```bash yarn test ``` ### Build Compile all contracts: ```bash yarn compile ``` ### Releases 1. Bump a new version of the package with: ```bash yarn version:bump # e.g. yarn version:bump imt.sol 2.0.0 ``` This step creates a commit and a git tag. 2. Push the changes to main: ```bash git push origin main ``` 3. Push the new git tag: ```bash git push origin - # e.g. git push origin imt.sol-v2.0.0 ``` After pushing the new git tag, a workflow will be triggered and will publish the package on [npm](https://www.npmjs.com/) and release a new version on Github with its changelogs automatically.