Skip to content

Commit bb6ea42

Browse files
authored
feat: add changeset, add release workflow, make snapshots run in siolation (#110)
1 parent e8f6699 commit bb6ea42

18 files changed

+1360
-63
lines changed

.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/ninety-trams-marry.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@aave-dao/aave-v3-origin": patch
3+
---
4+
5+
Added changesets, Added release workflow, Updated gas snapshots to run in isolation

.github/CONTRIBUTING.ms

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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.

.github/ISSUE_TEMPLATE/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Bug report
4+
url: https://immunefi.com/bounty/aave/
5+
about: Protocol bugs should be privately disclosed via immunify.
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Feature request
2+
description: Suggest a feature
3+
labels: ["feature", "needs-triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Please ensure that the feature has not already been requested in the issue tracker.
9+
10+
Thanks for helping us improve Aave protocol V3!
11+
- type: dropdown
12+
attributes:
13+
label: Component
14+
description: What component is the feature for?
15+
multiple: true
16+
options:
17+
- Protocol
18+
- Extensions
19+
- Other (please describe)
20+
validations:
21+
required: true
22+
- type: textarea
23+
attributes:
24+
label: Describe the feature you would like
25+
description: Please also describe what the feature is aiming to solve, if relevant.
26+
validations:
27+
required: true

.github/workflows/release.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
if: github.repository == 'aave-dao/aave-v3-origin'
15+
steps:
16+
- name: Checkout Repo
17+
uses: actions/checkout@v4
18+
19+
- uses: bgd-labs/github-workflows/.github/actions/setup-node@main
20+
21+
- name: Create Release Pull Request or Publish to npm
22+
id: changesets
23+
uses: changesets/action@v1
24+
with:
25+
publish: npm run release
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

Makefile

-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ deploy-libs :
5353
make deploy-libs-two chain=${chain}
5454
npx catapulta-verify -b broadcast/LibraryPreCompileTwo.sol/${chainId}/run-latest.json
5555

56-
# Gas reports
57-
gas-report :; forge test --mp 'tests/gas/*.t.sol' --isolate
58-
5956

6057
# Invariants
6158
echidna:

README.md

+2-29
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,9 @@ Aave v3.3 complete codebase, Foundry-based.
77
[![codecov](https://codecov.io/gh/aave-dao/aave-v3-origin/graph/badge.svg?token=6HX4NXCNIQ)](https://codecov.io/gh/aave-dao/aave-v3-origin)
88
<br>
99

10-
## Dependencies
10+
## Contributing
1111

12-
- Foundry, [how-to install](https://book.getfoundry.sh/getting-started/installation) (we recommend also update to the last version with `foundryup`)
13-
- Lcov
14-
- Optional, only needed for coverage testing
15-
- For Ubuntu, you can install via `apt install lcov`
16-
- For Mac, you can install via `brew install lcov`
17-
18-
<br>
19-
20-
## Setup
21-
22-
```sh
23-
cp .env.example .env
24-
25-
forge install
26-
27-
# required for tests & linting
28-
npm install
29-
```
30-
31-
<br>
32-
33-
## Tests
34-
35-
- To run the full test suite: `make test`
36-
- To re-generate the coverage report: `make coverage`
37-
- To run the enigma fuzzing suite, checkout the dedicated docs [HERE](./tests/invariants/README.md)
12+
If you're interested in contributing, please read the [contributing docs](/.github/CONTRIBUTING.md) **before submitting a pull request**.
3813

3914
<br>
4015

@@ -53,8 +28,6 @@ npm install
5328

5429
## Security
5530

56-
Aave v3.1 is an upgraded version of Aave v3, more precisely on top of the initial Aave v3 release and a follow-up 3.0.2 later update.
57-
5831
The following are the security procedures historically applied to Aave v3.X versions.
5932

6033
<br>

0 commit comments

Comments
 (0)