Skip to content

Commit 2437c56

Browse files
chore: Enforce prettier and add CI checks (#810)
* fix: enforce prettier linter check at CI and pre-commit * chore: run prettier write to fix unformatted contracts and js files * chore: Bump version of prettier dependencies * ci: Fix package json typo * ci: Fix format --------- Co-authored-by: miguelmtzinf <[email protected]> Co-authored-by: miguelmtz <[email protected]>
1 parent fa6b741 commit 2437c56

File tree

70 files changed

+1648
-2461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1648
-2461
lines changed

.github/workflows/certora.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@ jobs:
2121
env:
2222
CERTORAKEY: ${{ secrets.CERTORAKEY }}
2323
run: echo "key length" ${#CERTORAKEY}
24-
24+
2525
- name: Install python
2626
uses: actions/setup-python@v2
2727
with: { python-version: 3.9 }
2828

2929
- name: Install java
3030
uses: actions/setup-java@v1
31-
with: { java-version: "11", java-package: jre }
31+
with: { java-version: '11', java-package: jre }
3232

3333
- name: Install certora cli
3434
run: pip install certora-cli
35-
35+
3636
- name: Install solc
3737
run: |
3838
wget https://github.com/ethereum/solidity/releases/download/v0.8.10/solc-static-linux
3939
chmod +x solc-static-linux
4040
sudo mv solc-static-linux /usr/local/bin/solc8.10
41-
41+
4242
- name: Verify rule ${{ matrix.rule }}
4343
run: |
4444
cd certora
@@ -49,7 +49,7 @@ jobs:
4949
sh certora/scripts/${{ matrix.rule }}
5050
env:
5151
CERTORAKEY: ${{ secrets.CERTORAKEY }}
52-
52+
5353
strategy:
5454
fail-fast: false
5555
max-parallel: 16

.github/workflows/node.js.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
scope: '@aave'
2424
- name: Install dependencies
2525
run: npm ci
26+
- name: Lint
27+
run: npm run prettier:check
2628
- name: Test
2729
run: npm run ci:test
2830
- name: Coverage

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
artifacts
22
cache
33
node_modules
4+
types
5+
deployments
6+
temp-artifacts
7+
dist
8+
Certora
9+
*.json
10+
CHANGELOG.md
11+
.prettierignore
12+
.solcover.js

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,35 @@ This repository contains the smart contracts source code and markets configurati
2323
Aave is a decentralized non-custodial liquidity markets protocol where users can participate as suppliers or borrowers. Suppliers provide liquidity to the market to earn a passive income, while borrowers are able to borrow in an overcollateralized (perpetually) or undercollateralized (one-block liquidity) fashion.
2424

2525
## Documentation
26+
2627
See the link to the technical paper or visit the Aave Developer docs
28+
2729
- [Technical Paper](./techpaper/Aave_V3_Technical_Paper.pdf)
2830

2931
- [Developer Documentation](https://docs.aave.com/developers/)
3032

3133
## Audits and Formal Verification
34+
3235
You can find all audit reports under the audits folder
3336

3437
V3.0.1 - December 2022
38+
3539
- [PeckShield](./audits/09-12-2022_PeckShield_AaveV3-0-1.pdf)
3640
- [SigmaPrime](./audits/23-12-2022_SigmaPrime_AaveV3-0-1.pdf)
3741

3842
V3 Round 1 - October 2021
43+
3944
- [ABDK](./audits/27-01-2022_ABDK_AaveV3.pdf)
4045
- [OpenZeppelin](./audits/01-11-2021_OpenZeppelin_AaveV3.pdf)
4146
- [Trail of Bits](./audits/07-01-2022_TrailOfBits_AaveV3.pdf)
4247
- [Peckshield](./audits/14-01-2022_PeckShield_AaveV3.pdf)
4348

4449
V3 Round 2 - December 2021
50+
4551
- [SigmaPrime](./audits/27-01-2022_SigmaPrime_AaveV3.pdf)
4652

4753
Formal Verification - November 2021-January 2022
54+
4855
- [Certora](./certora/Aave_V3_Formal_Verification_Report_Jan2022.pdf)
4956

5057
## Connect with the community

contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ import {IERC20} from '../../openzeppelin/contracts/IERC20.sol';
99
library GPv2SafeERC20 {
1010
/// @dev Wrapper around a call to the ERC20 function `transfer` that reverts
1111
/// also when the token returns `false`.
12-
function safeTransfer(
13-
IERC20 token,
14-
address to,
15-
uint256 value
16-
) internal {
12+
function safeTransfer(IERC20 token, address to, uint256 value) internal {
1713
bytes4 selector_ = token.transfer.selector;
1814

1915
// solhint-disable-next-line no-inline-assembly
@@ -34,12 +30,7 @@ library GPv2SafeERC20 {
3430

3531
/// @dev Wrapper around a call to the ERC20 function `transferFrom` that
3632
/// reverts also when the token returns `false`.
37-
function safeTransferFrom(
38-
IERC20 token,
39-
address from,
40-
address to,
41-
uint256 value
42-
) internal {
33+
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
4334
bytes4 selector_ = token.transferFrom.selector;
4435

4536
// solhint-disable-next-line no-inline-assembly

contracts/dependencies/openzeppelin/contracts/AccessControl.sol

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,10 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
126126
*
127127
* - the caller must have ``role``'s admin role.
128128
*/
129-
function grantRole(bytes32 role, address account)
130-
public
131-
virtual
132-
override
133-
onlyRole(getRoleAdmin(role))
134-
{
129+
function grantRole(
130+
bytes32 role,
131+
address account
132+
) public virtual override onlyRole(getRoleAdmin(role)) {
135133
_grantRole(role, account);
136134
}
137135

@@ -144,12 +142,10 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
144142
*
145143
* - the caller must have ``role``'s admin role.
146144
*/
147-
function revokeRole(bytes32 role, address account)
148-
public
149-
virtual
150-
override
151-
onlyRole(getRoleAdmin(role))
152-
{
145+
function revokeRole(
146+
bytes32 role,
147+
address account
148+
) public virtual override onlyRole(getRoleAdmin(role)) {
153149
_revokeRole(role, account);
154150
}
155151

contracts/dependencies/openzeppelin/contracts/ERC20.sol

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,10 @@ contract ERC20 is Context, IERC20 {
122122
/**
123123
* @dev See {IERC20-allowance}.
124124
*/
125-
function allowance(address owner, address spender)
126-
public
127-
view
128-
virtual
129-
override
130-
returns (uint256)
131-
{
125+
function allowance(
126+
address owner,
127+
address spender
128+
) public view virtual override returns (uint256) {
132129
return _allowances[owner][spender];
133130
}
134131

@@ -201,11 +198,10 @@ contract ERC20 is Context, IERC20 {
201198
* - `spender` must have allowance for the caller of at least
202199
* `subtractedValue`.
203200
*/
204-
function decreaseAllowance(address spender, uint256 subtractedValue)
205-
public
206-
virtual
207-
returns (bool)
208-
{
201+
function decreaseAllowance(
202+
address spender,
203+
uint256 subtractedValue
204+
) public virtual returns (bool) {
209205
_approve(
210206
_msgSender(),
211207
spender,
@@ -231,11 +227,7 @@ contract ERC20 is Context, IERC20 {
231227
* - `recipient` cannot be the zero address.
232228
* - `sender` must have a balance of at least `amount`.
233229
*/
234-
function _transfer(
235-
address sender,
236-
address recipient,
237-
uint256 amount
238-
) internal virtual {
230+
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
239231
require(sender != address(0), 'ERC20: transfer from the zero address');
240232
require(recipient != address(0), 'ERC20: transfer to the zero address');
241233

@@ -299,11 +291,7 @@ contract ERC20 is Context, IERC20 {
299291
* - `owner` cannot be the zero address.
300292
* - `spender` cannot be the zero address.
301293
*/
302-
function _approve(
303-
address owner,
304-
address spender,
305-
uint256 amount
306-
) internal virtual {
294+
function _approve(address owner, address spender, uint256 amount) internal virtual {
307295
require(owner != address(0), 'ERC20: approve from the zero address');
308296
require(spender != address(0), 'ERC20: approve to the zero address');
309297

@@ -336,9 +324,5 @@ contract ERC20 is Context, IERC20 {
336324
*
337325
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
338326
*/
339-
function _beforeTokenTransfer(
340-
address from,
341-
address to,
342-
uint256 amount
343-
) internal virtual {}
327+
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
344328
}

contracts/dependencies/openzeppelin/contracts/IERC20.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,7 @@ interface IERC20 {
5858
*
5959
* Emits a {Transfer} event.
6060
*/
61-
function transferFrom(
62-
address sender,
63-
address recipient,
64-
uint256 amount
65-
) external returns (bool);
61+
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
6662

6763
/**
6864
* @dev Emitted when `value` tokens are moved from one account (`from`) to

0 commit comments

Comments
 (0)