Skip to content

Commit

Permalink
fix: migrate npm deps to git modules foundry dependencies (#382)
Browse files Browse the repository at this point in the history
* forge install: aave-v3-core

v1.17.2

* add foundry dependency

* update config files

* update deps from npm to forge - deployment working

* update package.json

* add openzeppelin deps

* add aave-v3-core deps

* update deps

* fix: Remove unnecesary npm dependencies

* fix: Remove duplicated founry remappings

* fix: Fix imports for gho_gsm_inverse certora rule

* fix: Fix certora config

* fix: Fix certora config

* fix: Fix certora config

* fix: Fix certora conifig

* fix: Fix test and config files

* ci: Fix certora ci config files

* ci: Fix certora ci config files

* fix: Use hardhat-founry instead of preprocessor

* fix: Add combined coverage script

* fix: Fix package scripts and remove combined-coverage

* fix: Fix node CI build

* fix: Fix build ci

* fix: Fix prettierignore

* fix: Add env for fork tests

* fix: Fix ci:clean script

---------

Co-authored-by: miguelmtzinf <[email protected]>
Co-authored-by: miguelmtz <[email protected]>
  • Loading branch information
3 people authored Feb 20, 2024
1 parent b7279d9 commit 3b6810c
Show file tree
Hide file tree
Showing 54 changed files with 5,451 additions and 8,396 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/certora-gho-505.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ jobs:
chmod +x solc-static-linux
sudo mv solc-static-linux /usr/local/bin/solc8.10
- name: Install node dependencies
run: |
npm i
- name: Verify rule ${{ matrix.rule }}
run: |
cd certora/gho
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/certora-gho.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
jobs:
verify:
runs-on: ubuntu-latest
# group: larger

steps:
- uses: actions/checkout@v2
Expand All @@ -37,10 +36,6 @@ jobs:
chmod +x solc-static-linux
sudo mv solc-static-linux /usr/local/bin/solc8.10
- name: Install node dependencies
run: |
npm i
- name: Verify rule ${{ matrix.rule }}
run: |
cd certora/gho
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/certora-gsm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Check key
env:
Expand All @@ -39,10 +42,6 @@ jobs:
chmod +x solc-static-linux
sudo mv solc-static-linux /usr/local/bin/solc8.10
- name: Install node dependencies
run: |
npm i
- name: Verify rule ${{ matrix.rule }}
run: |
echo "key length" ${#CERTORAKEY}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
group: larger
env:
ALCHEMY_KEY: '${{secrets.ALCHEMY_KEY}}'
ETH_RPC_URL: 'https://eth-mainnet.g.alchemy.com/v2/${{secrets.ALCHEMY_KEY}}'
strategy:
matrix:
node-version:
Expand All @@ -18,7 +19,11 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16.x.x
node-version: 18.x.x
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install Dependencies
run: npm ci
- name: Compilation
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/cache
/cache_forge
/out
/artifacts
/.env
Expand All @@ -14,9 +15,9 @@
/src/contracts/hardhat-dependency-compiler

.DS_Store
forge-cache

/report
lcov.info
combined-lcov.info

broadcast/
/broadcast
15 changes: 15 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,18 @@
[submodule "lib/solidity-utils"]
path = lib/solidity-utils
url = https://github.com/bgd-labs/solidity-utils
[submodule "lib/aave-v3-core"]
path = lib/aave-v3-core
url = https://github.com/aave/aave-v3-core
[submodule "lib/aave-token"]
path = lib/aave-token
url = https://github.com/aave/aave-token
[submodule "lib/aave-v3-periphery"]
path = lib/aave-v3-periphery
url = https://github.com/aave/aave-v3-periphery
[submodule "lib/safety-module"]
path = lib/safety-module
url = https://github.com/aave/safety-module
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ node_modules
types
out
deployments
temp-artifacts
lib
coverage
forge-cache
cache_forge
2 changes: 1 addition & 1 deletion .solcover.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
skipFiles: [],
skipFiles: ['./script', './test'],
mocha: {
enableTimeouts: false,
},
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Clone the repository and run the following command to install dependencies:

```sh
npm i
forge i
```

If you need to interact with GHO in the Goerli testnet, provide your Alchemy API key and mnemonic in the `.env` file:
Expand Down
13 changes: 9 additions & 4 deletions certora/GSM/conf/non-4626/Alex-gho-gsm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
"certora/GSM/harness/FixedPriceStrategyHarness.sol",
"certora/GSM/harness/FixedFeeStrategyHarness.sol",
"src/contracts/gho/GhoToken.sol",
"node_modules/@openzeppelin/contracts/utils/math/Math.sol",
],
"link": [
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
],
"parametric_contracts": [ "GsmHarness"],
"assert_autofinder_success": true,
Expand Down
13 changes: 9 additions & 4 deletions certora/GSM/conf/non-4626/Alex-gho-gsm_inverse.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
"certora/GSM/harness/FixedFeeStrategyHarness.sol",
"certora/GSM/harness/ERC20Helper.sol",
"src/contracts/gho/GhoToken.sol",
"node_modules/@openzeppelin/contracts/utils/math/Math.sol",
],
"link": [
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
],
"assert_autofinder_success": true,
"optimistic_loop":true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
"certora/GSM/harness/FixedPriceStrategyHarness.sol",
"certora/GSM/harness/FixedFeeStrategyHarness.sol",
"src/contracts/gho/GhoToken.sol",
"node_modules/@openzeppelin/contracts/utils/math/Math.sol"
],
"link": [
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness"
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness"
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
],
"assert_autofinder_success": true,
"optimistic_loop":true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"files": [
"certora/GSM/harness/FixedPriceStrategyHarness.sol",
"node_modules/@openzeppelin/contracts/utils/math/Math.sol"
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
],
"assert_autofinder_success": true,
"optimistic_loop":true,
Expand Down
14 changes: 10 additions & 4 deletions certora/GSM/conf/non-4626/Martin-gho-gsm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@
"src/contracts/gho/GhoToken.sol",
],
"link": [
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
"GsmHarness:UNDERLYING_ASSET=DummyERC20B"
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
"GsmHarness:UNDERLYING_ASSET=DummyERC20B"
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
],
"parametric_contracts": [ "GsmHarness"],
"assert_autofinder_success": true,
Expand Down
7 changes: 6 additions & 1 deletion certora/GSM/conf/non-4626/antti-optimality.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
"certora/GSM/harness/FixedPriceStrategyHarness.sol",
"certora/GSM/harness/FixedFeeStrategyHarness.sol",
"src/contracts/gho/GhoToken.sol",
"node_modules/@openzeppelin/contracts/utils/math/Math.sol",
],
"link": [
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
],
"assert_autofinder_success": true,
"optimistic_loop":true,
"rule_sanity" : "basic",
Expand Down
15 changes: 10 additions & 5 deletions certora/GSM/conf/non-4626/balances-buy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
"certora/GSM/harness/DummyERC20B.sol",
"certora/GSM/harness/FixedPriceStrategyHarness.sol",
"certora/GSM/harness/FixedFeeStrategyHarness.sol",
"src/contracts/gho/GhoToken.sol",
"certora/GSM/harness/DiffHelper.sol",
"node_modules/@openzeppelin/contracts/utils/math/Math.sol",
"src/contracts/gho/GhoToken.sol",
],
"link": [
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
],
"assert_autofinder_success": true,
"optimistic_loop":true,
Expand Down
15 changes: 10 additions & 5 deletions certora/GSM/conf/non-4626/balances-sell.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
"certora/GSM/harness/DummyERC20B.sol",
"certora/GSM/harness/FixedPriceStrategyHarness.sol",
"certora/GSM/harness/FixedFeeStrategyHarness.sol",
"src/contracts/gho/GhoToken.sol",
"certora/GSM/harness/DiffHelper.sol",
"node_modules/@openzeppelin/contracts/utils/math/Math.sol",
"src/contracts/gho/GhoToken.sol",
],
"link": [
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
],
"assert_autofinder_success": true,
"optimistic_loop":true,
Expand Down
15 changes: 10 additions & 5 deletions certora/GSM/conf/non-4626/fees-buy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
"certora/GSM/harness/DummyERC20B.sol",
"certora/GSM/harness/FixedPriceStrategyHarness.sol",
"certora/GSM/harness/FixedFeeStrategyHarness.sol",
"src/contracts/gho/GhoToken.sol",
"certora/GSM/harness/DiffHelper.sol",
"node_modules/@openzeppelin/contracts/utils/math/Math.sol",
"src/contracts/gho/GhoToken.sol",
],
"link": [
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
],
"assert_autofinder_success": true,
"optimistic_loop":true,
Expand Down
15 changes: 10 additions & 5 deletions certora/GSM/conf/non-4626/fees-sell.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
"certora/GSM/harness/DummyERC20B.sol",
"certora/GSM/harness/FixedPriceStrategyHarness.sol",
"certora/GSM/harness/FixedFeeStrategyHarness.sol",
"src/contracts/gho/GhoToken.sol",
"certora/GSM/harness/DiffHelper.sol",
"node_modules/@openzeppelin/contracts/utils/math/Math.sol",
"src/contracts/gho/GhoToken.sol",
],
"link": [
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
"GsmHarness:GHO_TOKEN=GhoToken",
"GsmHarness:PRICE_STRATEGY=FixedPriceStrategyHarness",
"GsmHarness:_feeStrategy=FixedFeeStrategyHarness",
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
],
"assert_autofinder_success": true,
"optimistic_loop":true,
Expand Down
7 changes: 6 additions & 1 deletion certora/GSM/conf/non-4626/otakar-FixedFeeStrategy.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"files": [
"certora/GSM/harness/FixedFeeStrategyHarness.sol",
"node_modules/@openzeppelin/contracts/utils/math/Math.sol",
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
],
"assert_autofinder_success": true,
"optimistic_loop":true,
Expand Down
7 changes: 6 additions & 1 deletion certora/GSM/conf/non-4626/otakar-OracleSwapFreezer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
"files": [
"certora/GSM/harness/OracleSwapFreezerHarness.sol",
"src/contracts/facilitators/gsm/swapFreezer/OracleSwapFreezer.sol",
"node_modules/@openzeppelin/contracts/utils/math/Math.sol",
],
"packages": [
"@aave/core-v3/=lib/aave-v3-core",
"@aave/periphery-v3/=lib/aave-v3-periphery",
"@aave/=lib/aave-token",
"@openzeppelin/=lib/openzeppelin-contracts",
],
"assert_autofinder_success": true,
"optimistic_loop":true,
Expand Down
Loading

0 comments on commit 3b6810c

Please sign in to comment.