diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.yml b/.github/ISSUE_TEMPLATE/01_bug_report.yml new file mode 100644 index 00000000..7c17bb2e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01_bug_report.yml @@ -0,0 +1,100 @@ +name: "🐛 Bug Report" +description: Create a report to help us improve +title: "[Bug]: " +labels: ["bug", "triage"] +projects: ["OpenZeppelin/41"] + +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + + If you’re unsure whether the issue you’re having is a bug, you can post in [Discussions](https://github.com/OpenZeppelin/midnight-contracts/discussions) instead. + + - type: checkboxes + id: prerequisites + attributes: + label: Prerequisites + description: Please ensure you have completed all of the following. + options: + - label: I have read the [Contributing Guidelines](https://github.com/OpenZeppelin/midnight-contracts/CONTRIBUTING.md#creating-an-issue). + required: true + - label: I agree to follow the [Code of Conduct](https://github.com/OpenZeppelin/midnight-contracts/CODE_OF_CONDUCT.md). + required: true + - label: I have searched for [existing issues](https://github.com/OpenZeppelin/midnight-contracts/issues) that already report this problem, without success. + required: true + + - type: textarea + id: bug-steps + attributes: + label: What are the steps to reproduce this issue? + placeholder: | + 1. Clone repo + 2. Run `turbo compact` + 3. … + 4. See error + validations: + required: true + + - type: textarea + id: bug-description + attributes: + label: What happens? + description: A clear and concise description of what the bug is. + validations: + required: true + + - type: textarea + id: bug-expectation + attributes: + label: What were you expecting to happen? + description: A clear and concise description of what was supposed to happen. + validations: + required: true + + - type: textarea + id: bug-logs + attributes: + label: Paste any relevant logs, error output, etc. + description: | + Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + (If it’s long, please paste to https://gist.github.com/ and insert the link here.) + render: shell + + - type: textarea + id: bug-context + attributes: + label: Additional context + description: Add any other context you can provide about the problem here. + + - type: input + id: reproduction-url + attributes: + label: Code Reproduction URL + description: | + Reproduce this issue in a blank [Compact starter application](https://github.com/midnightntwrk/example-counter/tree/main) + + Reproductions must be minimal and focused around the specific problem you are experiencing. This is the best way to ensure this issue is triaged quickly. Issues without a code reproduction may be closed if the OpenZeppelin Team cannot reproduce the issue you are reporting. + placeholder: https://github.com/... + validations: + required: false + + - type: markdown + attributes: + value: | + ---- + + # Details of your setup + + - type: dropdown + id: version + attributes: + label: Version + description: What version of Compact are you running? + options: + - 0.23.0 (Default) + default: 0 + validations: + required: true + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md similarity index 88% rename from .github/ISSUE_TEMPLATE/feature_request.md rename to .github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md index 2e09ebfb..13851bf2 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md @@ -1,8 +1,8 @@ --- name: Feature request about: Suggest an idea for this project -title: '' -labels: '' +title: 'feat: ' +labels: 'enhancement' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md b/.github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md new file mode 100644 index 00000000..a4fd902d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md @@ -0,0 +1,7 @@ +--- +name: Codebase improvement +about: Provide your feedback for the existing codebase. Suggest a better solution for algorithms, development tools, etc. +title: "dev: " +labels: "enhancement" +assignees: "" +--- \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 2a32821c..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - - - - - -**📝 Details** - - - -**🔢 Code to reproduce bug** - - diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..b1bfe71a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: OpenZeppelin Midnight Contracts Community Support + url: https://github.com/OpenZeppelin/midnight-contracts/discussions + about: Please ask and answer questions here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b1e26cc5..2a869fcb 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,16 +3,32 @@ +## Types of changes + +What types of changes does your code introduce to OpenZeppelin Midnight Contracts? +_Put an `x` in the boxes that apply_ + +- [ ] Bugfix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] Documentation Update (if none of the other choices apply) + Fixes #??? -#### PR Checklist +## PR Checklist -- [ ] Tests -- [ ] Documentation +- [ ] I have read the [Contributing Guide](CONTRIBUTING.md) +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] I have added documentation of new methods and any new behavior or changes to existing behavior +- [ ] CI Workflows Are Passing + +#### Further comments + +If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..99293832 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,133 @@ +# 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, caste, color, 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 email 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 at +[contact@openzeppelin.com][contact us]. +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.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations +[contact us]: mailto:contact@openzeppelin.com diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..7894df29 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,272 @@ +# Contributing to OpenZeppelin Contracts for Compact + +👍🎉 First off, thanks for taking the time to contribute! 🎉👍 + +We really appreciate and value contributions to OpenZeppelin Contracts for Compact. Please take 5' to review the items listed below to make sure that your contributions are merged and questions are answered. + +## Table Of Contents + +[Code of Conduct](#code-of-conduct) + +[I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question) + +[What should I know before I get started?](#what-should-i-know-before-i-get-started) + +* [What Is OpenZeppelin Contracts for Compact](#what-is-openzeppelin-contracts-for-compact) +* [Compact Contracts Design Decisions](#compact-contracts-design-decisions) + +[How Can I Contribute?](#how-can-i-contribute) + +* [Reporting Bugs](#reporting-bugs) +* [Suggesting Enhancements](#suggesting-enhancements) +* [Your First Code Contribution](#your-first-code-contribution) +* [Pull Requests](#pull-requests) +* [Opening an Issue](#opening-an-issue) + +[Styleguides](#styleguides) + +* [Git Commit Messages](#git-commit-messages) +* [TypeScript Styleguide](#typescript-styleguide) + +[Additional Notes](#additional-notes) + +* [Issue and Pull Request Labels](#issue-and-pull-request-labels) + +## Code of Conduct + +This project and everyone participating in it is governed by the [OpenZeppelin Compact Contracts Code of Conduct](CODE_OF_CONDUCT.md). +By participating, you are expected to uphold this code. +Please report unacceptable behavior to [contact@openzeppelin.com](contact@openzeppelin.com). + +## I don't want to read this whole thing I just have a question!!! + +> **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below. + +We have an official message board where the community chimes in with helpful advice if you have questions. + +* [Github Discussions](https://github.com/OpenZeppelin/compact-contracts/discussions) + +## What should I know before I get started? + +### What Is OpenZeppelin Contracts for Compact? + +**A library for secure smart contract development** written in Compact for [Midnight](https://midnight.network/). + +> ## ⚠️ WARNING! ⚠️ +> +> This repo contains highly experimental code. +> Expect rapid iteration. +> **Use at your own risk.** + +### Compact Contracts Design Decisions + +We try our best to document important design decisions, limitations, and pitfalls in each module using the [NatSpec format](https://docs.soliditylang.org/en/latest/natspec-format.html). If you have a question about module that's not answered by this documentation please use the [Discussion Board](https://github.com/OpenZeppelin/compact-contracts/discussions). + +## How Can I Contribute? + +### Reporting Bugs + +This section guides you through submitting a bug report for Compact Contracts. Following these guidelines helps maintainers and the community understand your report :pencil:, reproduce the behavior :computer: :computer:, and find related reports :mag_right:. + +Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](https://github.com/OpenZeppelin/compact-contracts/blob/main/.github/ISSUE_TEMPLATE/01_BUG_REPORT.yml), the information it asks for helps us resolve issues faster. + +> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one. + +#### Before Submitting A Bug Report + +* **Check the [discussions](https://github.com/OpenZeppelin/compact-contracts/discussions)** for a list of common questions and problems. +* **Perform a [cursory search](https://github.com/search?q=repo%3AOpenZeppelin%2Fcompact-contracts%20is%3Aissue&type=issues)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one. + +#### How Do I Submit A (Good) Bug Report? + +Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information by filling in [the template](https://github.com/OpenZeppelin/compact-contracts/issues/new?template=01_BUG_REPORT.yml). + +Explain the problem and include additional details to help maintainers reproduce the problem: + +* **Use a clear and descriptive title** for the issue to identify the problem. +* **Describe the exact steps which reproduce the problem** in as many details as possible. When listing steps, **don't just say what you did, but explain how you did it**. +* **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines). +* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior. +* **Explain which behavior you expected to see instead and why.** +* **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem. + +Include details about your configuration and environment: + +* **Which version of compactc are you using?** You can get the exact version by running `compactc --version` in your terminal. + +### Suggesting Enhancements + +This section guides you through submitting an enhancement suggestion for OpenZeppelin, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion :pencil: and find related suggestions :mag_right:. + +Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). Fill in [the template](https://github.com/OpenZeppelin/.github/blob/master/.github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md), including the steps that you imagine you would take if the feature you're requesting existed. + +#### Before Submitting An Enhancement Suggestion + +* **Check if you're using the latest version of contracts** +* **Perform a [cursory search](https://github.com/search?q=+is%3Aissue+user%3AOpenZeppelin)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. + +#### How Do I Submit A (Good) Enhancement Suggestion? + +Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information: + +* **Use a clear and descriptive title** for the issue to identify the suggestion. +* **Provide a step-by-step description of the suggested enhancement** in as many details as possible. +* **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines). +* **Describe the current behavior** and **explain which behavior you expected to see instead** and why. +* **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of the contracts library the suggestion is related to. +* **Explain why this enhancement would be useful** to most OpenZeppelin contracts users +* **Specify which version of Compact you're using.** You can get the exact version by running `compactc --version` in your terminal + +### Your First Code Contribution + +Unsure where to begin contributing to Compact Contracts? You can start by looking through these `beginner` and `help-wanted` issues: + +* [Beginner issues][beginner] - issues which should only require a few lines of code, and a test or two. +* [Help wanted issues][help-wanted] - issues which should be a bit more involved than `beginner` issues. + +Both issue lists are sorted by total number of comments. While not perfect, number of comments is a reasonable proxy for impact a given change will have. + +### Pull Requests + +The process described here has several goals: + +* Maintain Compact Contracts quality. +* Fix problems that are important to users. +* Engage the community in working toward the best possible Compact smart contracts library. +* Enable a sustainable system for Compact Contract's maintainers to review contributions. + +Any non-trivial code contribution must be first discussed with the maintainers in an issue (see [Opening an issue](#opening-an-issue)). Only very minor changes are accepted without prior discussion. + +Please follow these steps to have your contribution considered by the maintainers: + +1. [Open an issue](#opening-an-issue). +2. Fork the repository and create a new branch. +3. Follow all instructions in [the template](.github/PULL_REQUEST_TEMPLATE.md) +4. Follow the [engineering guidelines](./GUIDELINES.md). +5. Follow the [styleguides](#styleguides) +6. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) are passing.
What if the status checks are failing? +If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on the pull request explaining why you believe the failure is unrelated. +A maintainer will re-run the status check for you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our status check suite.
+ +While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted. + +## Styleguides + +### TypeScript Styleguide + +All TypeScript code is linted with [Biomejs](https://biomejs.dev/). + +Quickly fix all formatting and linting errors with the `turbo fmt:fix` and `turbo lint:fix` commands. + +## Opening an issue + +You can [open an issue] to suggest a feature or report a minor bug. For serious bugs please do not open an issue, instead refer to our [security policy] for appropriate steps. + +If you believe your issue may be due to user error and not a problem in the library, consider instead posting a question on the [OpenZeppelin Forum]. + +Before opening an issue, be sure to search through the existing open and closed issues, and consider posting a comment in one of those instead. + +When requesting a new feature, include as many details as you can, especially around the use cases that motivate it. Features are prioritized according to the impact they may have on the ecosystem, so we appreciate information showing that the impact could be high. + +[security policy]: https://github.com/OpenZeppelin/compact-contracts/security +[open an issue]: https://github.com/OpenZeppelin/compact-contracts/issues/new/choose + +## Additional Notes + +### Issue and Pull Request Labels + +This section lists the labels we use to help us track and manage issues and pull requests. + +[GitHub search](https://help.github.com/articles/searching-issues/) makes it easy to use labels for finding groups of issues or pull requests you're interested in. +For example, you might be interested in [open issues across `OpenZeppelin` and all OpenZeppelin-owned packages which are labeled as bugs, but still need to be reliably reproduced](https://github.com/search?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Abug) or perhaps [open pull requests in `OpenZeppelin/compact-contracts` which haven't been reviewed yet](https://github.com/search?utf8=%E2%9C%93&q=is%3Aopen+is%3Apr+repo%3AOpenZeppelin%2Fcompact-contracts+comments%3A0). +To help you find issues and pull requests, each label is listed with search links for finding open items with that label in `OpenZeppelin/compact-contracts` only and also across all OpenZeppelin repositories. +We encourage you to read about [other search filters](https://help.github.com/articles/searching-issues/) which will help you write more focused queries. + +The labels are loosely grouped by their purpose, but it's not required that every issue has a label from every group or that an issue can't have more than one label from the same group. + +Please open an issue on `OpenZeppelin/compact-contracts` if you have suggestions for new labels, and if you notice some labels are missing on some repositories, then please open an issue on that repository. + +#### Type of Issue and Issue State + +| Label name | `OpenZeppelin/compact-contracts` :mag_right: | `OpenZeppelin`‑org :mag_right: | Description | +| --- | --- | --- | --- | +| `enhancement` | [search][search-OpenZeppelin-repo-label-enhancement] | [search][search-OpenZeppelin-org-label-enhancement] | Feature requests. | +| `bug` | [search][search-OpenZeppelin-repo-label-bug] | [search][search-OpenZeppelin-org-label-bug] | Confirmed bugs or reports that are very likely to be bugs. | +| `question` | [search][search-OpenZeppelin-repo-label-question] | [search][search-OpenZeppelin-org-label-question] | Questions more than bug reports or feature requests (e.g. how do I do X). | +| `feedback` | [search][search-OpenZeppelin-repo-label-feedback] | [search][search-OpenZeppelin-org-label-feedback] | General feedback more than bug reports or feature requests. | +| `help-wanted` | [search][search-OpenZeppelin-repo-label-help-wanted] | [search][search-OpenZeppelin-org-label-help-wanted] | The OpenZeppelin core team would appreciate help from the community in resolving these issues. | +| `beginner` | [search][search-OpenZeppelin-repo-label-beginner] | [search][search-OpenZeppelin-org-label-beginner] | Less complex issues which would be good first issues to work on for users who want to contribute to OpenZeppelin. | +| `more-information-needed` | [search][search-OpenZeppelin-repo-label-more-information-needed] | [search][search-OpenZeppelin-org-label-more-information-needed] | More information needs to be collected about these problems or feature requests (e.g. steps to reproduce). | +| `needs-reproduction` | [search][search-OpenZeppelin-repo-label-needs-reproduction] | [search][search-OpenZeppelin-org-label-needs-reproduction] | Likely bugs, but haven't been reliably reproduced. | +| `blocked` | [search][search-OpenZeppelin-repo-label-blocked] | [search][search-OpenZeppelin-org-label-blocked] | Issues blocked on other issues. | +| `duplicate` | [search][search-OpenZeppelin-repo-label-duplicate] | [search][search-OpenZeppelin-org-label-duplicate] | Issues which are duplicates of other issues, i.e. they have been reported before. | +| `wontfix` | [search][search-OpenZeppelin-repo-label-wontfix] | [search][search-OpenZeppelin-org-label-wontfix] | The OpenZeppelin core team has decided not to fix these issues for now, either because they're working as intended or for some other reason. | +| `invalid` | [search][search-OpenZeppelin-repo-label-invalid] | [search][search-OpenZeppelin-org-label-invalid] | Issues which aren't valid (e.g. user errors). | + +#### Topic Categories + +| Label name | `OpenZeppelin/compact-contracts` :mag_right: | `OpenZeppelin`‑org :mag_right: | Description | +| --- | --- | --- | --- | +| `documentation` | [search][search-OpenZeppelin-repo-label-documentation] | [search][search-OpenZeppelin-org-label-documentation] | Improvements or additions to documentation. | +| `performance` | [search][search-OpenZeppelin-repo-label-performance] | [search][search-OpenZeppelin-org-label-performance] | Improvements related to circuit size, gas optimization, or code efficiency. | +| `security` | [search][search-OpenZeppelin-repo-label-security] | [search][search-OpenZeppelin-org-label-security] | Related to security. | +| `deprecation-help` | [search][search-OpenZeppelin-repo-label-deprecation-help] | [search][search-OpenZeppelin-org-label-deprecation-help] | Issues for helping package authors remove usage of deprecated APIs in packages. | + +#### Pull Request Labels + +| Label name | `OpenZeppelin/compact-contracts` :mag_right: | `OpenZeppelin`‑org :mag_right: | Description +| --- | --- | --- | --- | +| `work-in-progress` | [search][search-OpenZeppelin-repo-label-work-in-progress] | [search][search-OpenZeppelin-org-label-work-in-progress] | Pull requests which are still being worked on, more changes will follow. | +| `needs-review` | [search][search-OpenZeppelin-repo-label-needs-review] | [search][search-OpenZeppelin-org-label-needs-review] | Pull requests which need code review, and approval from maintainers or OpenZeppelin core team. | +| `under-review` | [search][search-OpenZeppelin-repo-label-under-review] | [search][search-OpenZeppelin-org-label-under-review] | Pull requests being reviewed by maintainers or OpenZeppelin core team. | +| `requires-changes` | [search][search-OpenZeppelin-repo-label-requires-changes] | [search][search-OpenZeppelin-org-label-requires-changes] | Pull requests which need to be updated based on review comments and then reviewed again. | +| `needs-testing` | [search][search-OpenZeppelin-repo-label-needs-testing] | [search][search-OpenZeppelin-org-label-needs-testing] | Pull requests which need manual testing. | + +[search-OpenZeppelin-repo-label-enhancement]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Aenhancement +[search-OpenZeppelin-org-label-enhancement]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Aenhancement +[search-OpenZeppelin-repo-label-bug]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Abug +[search-OpenZeppelin-org-label-bug]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Abug +[search-OpenZeppelin-repo-label-question]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Aquestion +[search-OpenZeppelin-org-label-question]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Aquestion +[search-OpenZeppelin-repo-label-feedback]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Afeedback +[search-OpenZeppelin-org-label-feedback]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Afeedback +[search-OpenZeppelin-repo-label-help-wanted]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Ahelp-wanted +[search-OpenZeppelin-org-label-help-wanted]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Ahelp-wanted +[search-OpenZeppelin-repo-label-beginner]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Abeginner +[search-OpenZeppelin-org-label-beginner]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Abeginner +[search-OpenZeppelin-repo-label-more-information-needed]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Amore-information-needed +[search-OpenZeppelin-org-label-more-information-needed]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Amore-information-needed +[search-OpenZeppelin-repo-label-needs-reproduction]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Aneeds-reproduction +[search-OpenZeppelin-org-label-needs-reproduction]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Aneeds-reproduction +[search-OpenZeppelin-repo-label-documentation]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Adocumentation +[search-OpenZeppelin-org-label-documentation]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Adocumentation +[search-OpenZeppelin-repo-label-performance]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Aperformance +[search-OpenZeppelin-org-label-performance]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Aperformance +[search-OpenZeppelin-repo-label-security]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Asecurity +[search-OpenZeppelin-org-label-security]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Asecurity + +[search-OpenZeppelin-repo-label-blocked]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Ablocked +[search-OpenZeppelin-org-label-blocked]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Ablocked +[search-OpenZeppelin-repo-label-duplicate]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Aduplicate +[search-OpenZeppelin-org-label-duplicate]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Aduplicate +[search-OpenZeppelin-repo-label-wontfix]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Awontfix +[search-OpenZeppelin-org-label-wontfix]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Awontfix +[search-OpenZeppelin-repo-label-invalid]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Ainvalid +[search-OpenZeppelin-org-label-invalid]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Ainvalid +[search-OpenZeppelin-repo-label-deprecation-help]: https://github.com/search?q=is%3Aopen+is%3Aissue+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Adeprecation-help +[search-OpenZeppelin-org-label-deprecation-help]: https://github.com/search?q=is%3Aopen+is%3Aissue+user%3AOpenZeppelin+label%3Adeprecation-help + +[search-OpenZeppelin-repo-label-work-in-progress]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Awork-in-progress +[search-OpenZeppelin-org-label-work-in-progress]: https://github.com/search?q=is%3Aopen+is%3Apr+user%3AOpenZeppelin+label%3Awork-in-progress +[search-OpenZeppelin-repo-label-needs-review]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Aneeds-review +[search-OpenZeppelin-org-label-needs-review]: https://github.com/search?q=is%3Aopen+is%3Apr+user%3AOpenZeppelin+label%3Aneeds-review +[search-OpenZeppelin-repo-label-under-review]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Aunder-review +[search-OpenZeppelin-org-label-under-review]: https://github.com/search?q=is%3Aopen+is%3Apr+user%3AOpenZeppelin+label%3Aunder-review +[search-OpenZeppelin-repo-label-requires-changes]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Arequires-changes +[search-OpenZeppelin-org-label-requires-changes]: https://github.com/search?q=is%3Aopen+is%3Apr+user%3AOpenZeppelin+label%3Arequires-changes +[search-OpenZeppelin-repo-label-needs-testing]: https://github.com/search?q=is%3Aopen+is%3Apr+repo%3AOpenZeppelin%2Fcompact-contracts+label%3Aneeds-testing +[search-OpenZeppelin-org-label-needs-testing]: https://github.com/search?q=is%3Aopen+is%3Apr+user%3AOpenZeppelin+label%3Aneeds-testing + +[beginner]:https://github.com/search?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3Abeginner+label%3Ahelp-wanted+user%3AOpenZeppelin+sort%3Acomments-desc +[help-wanted]:https://github.com/search?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted+user%3AOpenZeppelin+sort%3Acomments-desc+-label%3Abeginner + diff --git a/GUIDELINES.md b/GUIDELINES.md new file mode 100644 index 00000000..c80fe1ca --- /dev/null +++ b/GUIDELINES.md @@ -0,0 +1,69 @@ +# Engineering Guidelines + +## Testing + +Code must be thoroughly tested with quality unit tests. + +We defer to the [Moloch Testing Guide](https://github.com/MolochVentures/moloch/tree/master/test#readme) for specific recommendations, though not all of it is relevant here. Note the introduction: + +> Tests should be written, not only to verify correctness of the target code, but to be comprehensively reviewed by other programmers. Therefore, for mission critical Compact code, the quality of the tests is just as important (if not more so) than the code itself, and should be written to the highest standards of clarity and elegance. + +Every addition or change to the code must come with relevant and comprehensive tests. + +Refactors should avoid simultaneous changes to tests. + +Flaky tests are not acceptable. + +The test suite should run automatically for every change in the repository, and in pull requests tests must pass before merging. + +In some cases unit tests may be insufficient and complementary techniques should be used: + +1. Property-based tests (aka. fuzzing) for math-heavy code. +2. Formal verification for state machines. + +## Code style + +TypeScript code should be written in a consistent format enforced by the project's chosen formatting tool, [biomejs](https://biomejs.dev/). + +## Documentation + +For contributors, project guidelines and processes must be documented publicly. + +For users, features must be abundantly documented. Documentation should include answers to common questions, solutions to common problems, and recommendations for critical decisions that the user may face. + +Method documentation must list all requirements necessary for the method to execute without error. + +## Peer review + +All changes must be submitted through pull requests and go through peer code review. + +The review must be approached by the reviewer in a similar way as if it was an audit of the code in question (but importantly it is not a substitute for and should not be considered an audit). + +Reviewers should enforce code and project guidelines. + +Small external contributions and documentation changes must be reviewed by a at least a single maintainer. Large PRs and critical code changes must be reviewed by multiple maintainers. + +## Automation + +Automation should be used as much as possible to reduce the possibility of human error and forgetfulness. + +Automations that make use of sensitive credentials must use secure secret management, and must be strengthened against attacks such as [those on GitHub Actions workflows](https://github.com/nikitastupin/pwnhub). + +Some other examples of automation are: + +- Looking for common security vulnerabilities or errors in our code (eg. reentrancy analysis). +- Keeping dependencies up to date and monitoring for vulnerable dependencies. + +## Pull requests + +Pull requests are squash-merged to keep the `main` branch history clean. The title of the pull request becomes the commit message, so it should be written in a consistent format: + +1) Begin with a capital letter. +2) Do not end with a period. +3) Write in the imperative: "Add feature X" and not "Adds feature X" or "Added feature X". + +This repository does not follow conventional commits, so do not prefix the title with "fix:" or "feat:". + +Work in progress pull requests should be submitted as Drafts and should not be prefixed with "WIP:". + +Branch names don't matter, and commit messages within a pull request mostly don't matter either, although they can help the review process. diff --git a/README.md b/README.md index c1351c88..144d5b80 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![Generic badge](https://img.shields.io/badge/Compact%20Compiler-0.23.0-1abc9c.svg)](https://docs.midnight.network/relnotes/compact) +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) + # OpenZeppelin Contracts for Compact **A library for secure smart contract development** written in Compact for [Midnight](https://midnight.network/). diff --git a/SUPPORT.md b/SUPPORT.md new file mode 100644 index 00000000..3c9909a5 --- /dev/null +++ b/SUPPORT.md @@ -0,0 +1,8 @@ +# OpenZeppelin Contracts for Midnight Support + +If you're looking for support for this library, check out: + +* Developer Documentation — [Midnight Contracts API Documentation](https://docs.openzeppelin.com) +* Message Board — [Github Discussions](https://github.com/OpenZeppelin/midnight-contracts/discussions) + +On the Github Discussions board, there are a bunch of helpful community members that should be willing to point you in the right direction. \ No newline at end of file