Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add changeset, add release workflow, make snapshots run in siolation #110

Merged
merged 8 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/ninety-trams-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aave-dao/aave-v3-origin": patch
---

Added changesets, Added release workflow, Updated gas snapshots to run in isolation
103 changes: 103 additions & 0 deletions .github/CONTRIBUTING.ms
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Contributing

Thanks for your interest in contributing to the Aave protocol! Please take a moment to review this document **before submitting a pull request.**

## Rules

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.
2. Contributors must be humans, not bots.
3. First time contributions must not contain only spelling or grammatical fixes.

## Basic guide

This guide is intended to help you get started with contributing. By following these steps, you will understand the development process and workflow.

1. [Forking the repository](#forking-the-repository)
2. [Installing Foundry](#installing-foundry)
4. [Installing dependencies](#installing-dependencies)
5. [Running the test suite](#running-the-test-suite)
7. [Submitting a pull request](#submitting-a-pull-request)
8. [Versioning](#versioning)

---

### Forking the repository

To start contributing to the project, [fork it](https://github.com/aave-dao/aave-v3-origin/fork) to your private github account.

Once that is done, you can clone your forked repository to your local machine.
```bash
# https
git clone https://github.com/<user>/aave-v3-origin.git
# ssh
git clone [email protected]:<user>/aave-v3-origin.git
```

To stay up to date with the main repository, you can add it as a remote.
```bash
# https
git remote add upstream https://github.com/aave-dao/aave-v3-origin.git
# ssh
git remote add upstream [email protected]:aave-dao/aave-v3-origin.git
```

---

### Installing foundry

Aave-v3-origin is a [Foundry](https://github.com/foundry-rs/foundry) project.

Install foundry using the following command:

```bash
curl -L https://foundry.paradigm.xyz | bash
```

---

### Installing dependencies

For generating the changelog, linting and testing, we rely on some additional node pckages. You can install them by running:

```bash
npm install
```

---

### Running the test suite

For running the default test suite you can use the following command:

```bash
forge test
```

In addition the the default test suite, you can run the [enigma fuzzing suite](./tests/invariants/README.md).

---

### Submitting a pull request

When you're ready to submit a pull request, you can follow these naming conventions:

- Pull request titles use the [Imperative Mood](https://en.wikipedia.org/wiki/Imperative_mood) (e.g., `Add something`, `Fix something`).
- [Changesets](#versioning) use past tense verbs (e.g., `Added something`, `Fixed something`).

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.

- 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.
- Pull requests that touch code functionality should always include updated gas snapshots. Running `forge test` will update the snapshots for you.
- Make sure that your updates are fitting within the existing code margin. You can check by running `forge build --sizes`

---

### Versioning

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.

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.

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.

**Note**: As this repository is targeting `Aave V3` no major releases are allowed in this repository.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Bug report
url: https://immunefi.com/bounty/aave/
about: Protocol bugs should be privately disclosed via immunify.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Feature request
description: Suggest a feature
labels: ["feature", "needs-triage"]
body:
- type: markdown
attributes:
value: |
Please ensure that the feature has not already been requested in the issue tracker.

Thanks for helping us improve Aave protocol V3!
- type: dropdown
attributes:
label: Component
description: What component is the feature for?
multiple: true
options:
- Protocol
- Extensions
- Other (please describe)
validations:
required: true
- type: textarea
attributes:
label: Describe the feature you would like
description: Please also describe what the feature is aiming to solve, if relevant.
validations:
required: true
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
if: github.repository == 'aave-dao/aave-v3-origin'
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- uses: bgd-labs/github-workflows/.github/actions/setup-node@main

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ deploy-libs :
make deploy-libs-two chain=${chain}
npx catapulta-verify -b broadcast/LibraryPreCompileTwo.sol/${chainId}/run-latest.json

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


# Invariants
echidna:
Expand Down
31 changes: 2 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,9 @@ Aave v3.3 complete codebase, Foundry-based.
[![codecov](https://codecov.io/gh/aave-dao/aave-v3-origin/graph/badge.svg?token=6HX4NXCNIQ)](https://codecov.io/gh/aave-dao/aave-v3-origin)
<br>

## Dependencies
## Contributing

- Foundry, [how-to install](https://book.getfoundry.sh/getting-started/installation) (we recommend also update to the last version with `foundryup`)
- Lcov
- Optional, only needed for coverage testing
- For Ubuntu, you can install via `apt install lcov`
- For Mac, you can install via `brew install lcov`

<br>

## Setup

```sh
cp .env.example .env

forge install

# required for tests & linting
npm install
```

<br>

## Tests

- To run the full test suite: `make test`
- To re-generate the coverage report: `make coverage`
- To run the enigma fuzzing suite, checkout the dedicated docs [HERE](./tests/invariants/README.md)
If you're interested in contributing, please read the [contributing docs](/.github/CONTRIBUTING.md) **before submitting a pull request**.

<br>

Expand All @@ -53,8 +28,6 @@ npm install

## Security

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.

The following are the security procedures historically applied to Aave v3.X versions.

<br>
Expand Down
Loading