|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Thanks for your interest in contributing to the Aave protocol! Please take a moment to review this document **before submitting a pull request.** |
| 4 | + |
| 5 | +## Rules |
| 6 | + |
| 7 | +1. Significant changes to the Protocol must be reviewed before a Pull Request is created. Create a [Feature Request](https://github.com/aave-dao/aave-v3-origin/issues) first to discuss your ideas. |
| 8 | +2. Contributors must be humans, not bots. |
| 9 | +3. First time contributions must not contain only spelling or grammatical fixes. |
| 10 | + |
| 11 | +## Basic guide |
| 12 | + |
| 13 | +This guide is intended to help you get started with contributing. By following these steps, you will understand the development process and workflow. |
| 14 | + |
| 15 | +1. [Forking the repository](#forking-the-repository) |
| 16 | +2. [Installing Foundry](#installing-foundry) |
| 17 | +4. [Installing dependencies](#installing-dependencies) |
| 18 | +5. [Running the test suite](#running-the-test-suite) |
| 19 | +7. [Submitting a pull request](#submitting-a-pull-request) |
| 20 | +8. [Versioning](#versioning) |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +### Forking the repository |
| 25 | + |
| 26 | +To start contributing to the project, [fork it](https://github.com/aave-dao/aave-v3-origin/fork) to your private github account. |
| 27 | + |
| 28 | +Once that is done, you can clone your forked repository to your local machine. |
| 29 | +```bash |
| 30 | +# https |
| 31 | +git clone https://github.com/<user>/aave-v3-origin.git |
| 32 | +# ssh |
| 33 | +git clone git@github.com:<user>/aave-v3-origin.git |
| 34 | +``` |
| 35 | + |
| 36 | +To stay up to date with the main repository, you can add it as a remote. |
| 37 | +```bash |
| 38 | +# https |
| 39 | +git remote add upstream https://github.com/aave-dao/aave-v3-origin.git |
| 40 | +# ssh |
| 41 | +git remote add upstream git@github.com:aave-dao/aave-v3-origin.git |
| 42 | +``` |
| 43 | + |
| 44 | +--- |
| 45 | + |
| 46 | +### Installing foundry |
| 47 | + |
| 48 | +Aave-v3-origin is a [Foundry](https://github.com/foundry-rs/foundry) project. |
| 49 | + |
| 50 | +Install foundry using the following command: |
| 51 | + |
| 52 | +```bash |
| 53 | +curl -L https://foundry.paradigm.xyz | bash |
| 54 | +``` |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +### Installing dependencies |
| 59 | + |
| 60 | +For generating the changelog, linting and testing, we rely on some additional node pckages. You can install them by running: |
| 61 | + |
| 62 | +```bash |
| 63 | +npm install |
| 64 | +``` |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +### Running the test suite |
| 69 | + |
| 70 | +For running the default test suite you can use the following command: |
| 71 | + |
| 72 | +```bash |
| 73 | +forge test |
| 74 | +``` |
| 75 | + |
| 76 | +In addition the the default test suite, you can run the [enigma fuzzing suite](./tests/invariants/README.md). |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +### Submitting a pull request |
| 81 | + |
| 82 | +When you're ready to submit a pull request, you can follow these naming conventions: |
| 83 | +
|
| 84 | +- Pull request titles use the [Imperative Mood](https://en.wikipedia.org/wiki/Imperative_mood) (e.g., `Add something`, `Fix something`). |
| 85 | +- [Changesets](#versioning) use past tense verbs (e.g., `Added something`, `Fixed something`). |
| 86 | +
|
| 87 | +When you submit a pull request, GitHub will automatically lint, build, and test your changes. If you see an ❌, it's most likely a bug in your code. Please, inspect the logs through the GitHub UI to find the cause. |
| 88 | + |
| 89 | +- Pull requests must always cover all the changes made with tests. If you're adding a new feature, you must also add a test for it. If you're fixing a bug, you must add a test that reproduces the bug. Pull requests that cause a regression in test coverage will not be accepted. |
| 90 | +- Pull requests that touch code functionality should always include updated gas snapshots. Running `forge test` will update the snapshots for you. |
| 91 | +- Make sure that your updates are fitting within the existing code margin. You can check by running `forge build --sizes` |
| 92 | + |
| 93 | +--- |
| 94 | + |
| 95 | +### Versioning |
| 96 | + |
| 97 | +When adding new features or fixing bugs, we'll need to bump the package version. We use [Changesets](https://github.com/changesets/changesets) to do this. |
| 98 | +
|
| 99 | +Each changeset defines which package should be published and whether the change should be a minor/patch release, as well as providing release notes that will be added to the changelog upon release. |
| 100 | +
|
| 101 | +To create a new changeset, run `npm run changeset`. This will run the Changesets CLI, prompting you for details about the change. You’ll be able to edit the file after it’s created — don’t worry about getting everything perfect up front. |
| 102 | +
|
| 103 | +**Note**: As this repository is targeting `Aave V3` no major releases are allowed in this repository. |
0 commit comments