Skip to content

Commit

Permalink
Merge branch 'bgd-labs:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf authored Dec 24, 2024
2 parents 82dfded + d3879cf commit 2ffccd0
Show file tree
Hide file tree
Showing 358 changed files with 25,894 additions and 3,100 deletions.
1 change: 0 additions & 1 deletion .assets/20b02c78bc8b99547929074a8d98940dc76ac4e3.svg

This file was deleted.

1 change: 0 additions & 1 deletion .assets/237c21391c0b67eb1236e3875c882cd6115a3758.svg

This file was deleted.

1 change: 0 additions & 1 deletion .assets/3b30aea0d7ed061d9d9b0eeecb2e4835c7844ba5.svg

This file was deleted.

1 change: 0 additions & 1 deletion .assets/4f7a3ee47355f466dc627787f8cd371573621162.svg

This file was deleted.

1 change: 0 additions & 1 deletion .assets/59f72276d32ba1eeba45953b23c84ea37048e299.svg

This file was deleted.

1 change: 0 additions & 1 deletion .assets/5e92a6663aeee25254a2740f3a545f211faeacbf.svg

This file was deleted.

1 change: 0 additions & 1 deletion .assets/75cdb567a41d55d63ab2bb1326ea702df0bfacf4.svg

This file was deleted.

1 change: 0 additions & 1 deletion .assets/873d4c8affcd41504dffeb1e9750d8e5357e2775.svg

This file was deleted.

1 change: 0 additions & 1 deletion .assets/92cd89f015c573a55ccf57593f88a74f7b8bc050.svg

This file was deleted.

34 changes: 20 additions & 14 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,25 @@ LEDGER_SENDER=
PRIVATE_KEY=

# Test rpc_endpoints
RPC_MAINNET=https://eth.llamarpc.com
RPC_AVALANCHE=https://api.avax.network/ext/bc/C/rpc
RPC_OPTIMISM=https://optimism.llamarpc.com
RPC_POLYGON=https://polygon.llamarpc.com
RPC_ARBITRUM=https://arbitrum.llamarpc.com
RPC_FANTOM=https://rpc.ftm.tools
RPC_HARMONY=https://api.harmony.one
RPC_METIS=https://andromeda.metis.io/?owner=1088
RPC_BASE=https://base.llamarpc.com
RPC_ZKEVM=https://zkevm-rpc.com
RPC_GNOSIS=https://rpc.ankr.com/gnosis
RPC_BNB=https://binance.llamarpc.com
RPC_SCROLL=https://rpc.scroll.io
RPC_ZKSYNC=https://mainnet.era.zksync.io
# To generate RPCs based on you api keys, you can use
# export ALCHEMY_API_KEY=yourAlchemyKey && npx @bgd-labs/rpc-env
RPC_MAINNET=
RPC_AVALANCHE=
RPC_OPTIMISM=
RPC_POLYGON=
RPC_ARBITRUM=
RPC_FANTOM=
RPC_HARMONY=
RPC_METIS=
RPC_BASE=
RPC_ZKEVM=
RPC_GNOSIS=
RPC_BNB=
RPC_SCROLL=
RPC_ZKSYNC=

# Etherscan api keys for verification & download utils
# Dedicated api keys for each chain are required when using foundry verification
ETHERSCAN_API_KEY_MAINNET=
ETHERSCAN_API_KEY_POLYGON=
ETHERSCAN_API_KEY_AVALANCHE=
Expand All @@ -35,6 +38,9 @@ ETHERSCAN_API_KEY_BNB=
ETHERSCAN_API_KEY_SCROLL=
ETHERESCAN_API_KEY_ZKSYNC=

# Catapulta verify uses etherscan v2 api, therefore adding a single api key is good enough
ETHERSCAN_API_KEY=

# Simulation/fork creation
TENDERLY_ACCESS_TOKEN=
TENDERLY_ACCOUNT=
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ on:
jobs:
test:
uses: bgd-labs/github-workflows/.github/workflows/comment.yml@main
secrets: inherit
secrets:
READ_ONLY_PAT: ${{ secrets.READ_ONLY_PAT }}
9 changes: 1 addition & 8 deletions .github/workflows/ipfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,7 @@ jobs:
ref: ${{ inputs.myCommit }}
persist-credentials: true

- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: "yarn"

- name: Install dependencies
run: yarn install --frozen-lockfile
- uses: bgd-labs/github-workflows/.github/actions/setup-node@main

- name: Get all changed *.md file(s)
id: changed-files
Expand Down
66 changes: 43 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,54 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: "yarn"

- name: Install dependencies
run: yarn install --frozen-lockfile
- uses: bgd-labs/github-workflows/.github/actions/setup-node@main

- name: Enforce linting
run: yarn lint --check
run: npm run lint --check

test-sol:
uses: bgd-labs/github-workflows/.github/workflows/foundry-test.yml@main
secrets: inherit
with:
mode: "CHANGED"

test-sol-zksync:
uses: bgd-labs/github-workflows/.github/workflows/foundry-test.yml@main
secrets: inherit
with:
mode: "CHANGED"
zksync: true
ROOT_DIR: "zksync"
name: Foundry build n test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: bgd-labs/action-rpc-env@main
with:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}

# we simply use foundry zk for all jobs in this repo
- name: Run Foundry setup
uses: bgd-labs/github-workflows/.github/actions/foundry-setup@main
with:
ZKSYNC: "true"

- name: Run Forge tests
id: test
uses: bgd-labs/github-workflows/.github/actions/foundry-test@main
with:
MODE: "CHANGED"

- name: Run ZK tests
id: zktest
uses: bgd-labs/github-workflows/.github/actions/foundry-test@main
with:
MODE: "CHANGED"
ZKSYNC: true
ROOT_DIR: "zksync"

- name: Run Forge tests
uses: bgd-labs/github-workflows/.github/actions/comment-artifact@main

# we let failing tests pass so we can log them in the comment, still we want the ci to fail
- name: Post test
if: ${{ steps.test.outputs.testStatus != 0 || steps.zktest.outputs.testStatus != 0 }}
run: |
echo "tests failed"
exit 1
test-js:
uses: bgd-labs/github-workflows/.github/workflows/test-node.yml@main
secrets: inherit
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ zkout/
# editors
.idea

# well, looks strange to ignore package-lock, but we have only pretter and it's temproray
package-lock.json
node_modules
yarn.lock

# ignore foundry deploy artifacts
broadcast/
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,18 @@ The template ships with sensible default so you can use default `foundry` comman
```sh
cp .env.example .env
forge install
yarn
npm i
```

### Create an aip

This repository includes a generator to help you bootstrap the required files for an `AIP`.
To generate a proposal you need to run: `yarn generate`
To generate a proposal you need to run: `npm run generate`

To get a full list of available commands run `yarn generate --help`
To get a full list of available commands run `npm run generate -- --help`

```sh
yarn generate --help
yarn run v1.22.19
npm run generate -- --help
$ tsx generator/cli --help
Usage: proposal-generator [options]

Expand Down Expand Up @@ -108,7 +107,8 @@ If for whatever reason verification fails, there's a good chance the error is on
To retry a specific verification you can follow the following steps:

1. copy verify.example.json to verify.json
2. replace the `chain` with the appropriate chainId
3. replace the `hash` with the transaction hash of the deployment transaction (make sure it's the deployment transaction, not the one registering the payload on the payloadscontroller)
4. run `FOUNDRY_PROFILE=<chainAlias> forge build --force`
5. run `FOUNDRY_PROFILE=<chainAlias> npx catapulta-verify -b verify.json`
2. enter an `ETHERSCAN_API_KEY` in your `.env`
3. replace the `chain` with the appropriate chainId
4. replace the `hash` with the transaction hash of the deployment transaction (make sure it's the deployment transaction, not the one registering the payload on the payloadscontroller)
5. run `FOUNDRY_PROFILE=<chainAlias> forge build --force`
6. run `FOUNDRY_PROFILE=<chainAlias> npx catapulta-verify -b verify.json`
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
## Reserve changes

### Reserve altered

#### DAI ([0x6B175474E89094C44Da98b954EedeAC495271d0F](https://etherscan.io/address/0x6B175474E89094C44Da98b954EedeAC495271d0F))

| description | value before | value after |
| --- | --- | --- |
| interestRateStrategy | [0xA939B1f36E9a14B044B8149933184a18E0dFC17D](https://etherscan.io/address/0xA939B1f36E9a14B044B8149933184a18E0dFC17D) | [0x7011B47A142E2f462AB10F5bDBc8A478310EB0FD](https://etherscan.io/address/0x7011B47A142E2f462AB10F5bDBc8A478310EB0FD) |
| variableRateSlope1 | 5.5 % | 12.5 % |
| interestRate | ![before](https://dash.onaave.com/api/static?variableRateSlope1=55000000000000000000000000&variableRateSlope2=750000000000000000000000000&optimalUsageRatio=800000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) | ![after](https://dash.onaave.com/api/static?variableRateSlope1=125000000000000000000000000&variableRateSlope2=750000000000000000000000000&optimalUsageRatio=800000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) |

#### USDC ([0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48](https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48))

| description | value before | value after |
| --- | --- | --- |
| interestRateStrategy | [0x6a8C8119b2BA9460162B8C999f5A8C84f28a033f](https://etherscan.io/address/0x6a8C8119b2BA9460162B8C999f5A8C84f28a033f) | [0x4e1494475048fa155F1D837B6bD51458bD170f48](https://etherscan.io/address/0x4e1494475048fa155F1D837B6bD51458bD170f48) |
| variableRateSlope1 | 5.5 % | 12.5 % |
| interestRate | ![before](https://dash.onaave.com/api/static?variableRateSlope1=55000000000000000000000000&variableRateSlope2=600000000000000000000000000&optimalUsageRatio=900000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) | ![after](https://dash.onaave.com/api/static?variableRateSlope1=125000000000000000000000000&variableRateSlope2=600000000000000000000000000&optimalUsageRatio=900000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) |

#### USDT ([0xdAC17F958D2ee523a2206206994597C13D831ec7](https://etherscan.io/address/0xdAC17F958D2ee523a2206206994597C13D831ec7))

| description | value before | value after |
| --- | --- | --- |
| interestRateStrategy | [0xa8850b94E4A0B881c3b08aE065D189D87F34F175](https://etherscan.io/address/0xa8850b94E4A0B881c3b08aE065D189D87F34F175) | [0x869eF970878F96c130E14B46B024D2ca18b5b762](https://etherscan.io/address/0x869eF970878F96c130E14B46B024D2ca18b5b762) |
| variableRateSlope1 | 5.5 % | 12.5 % |
| interestRate | ![before](https://dash.onaave.com/api/static?variableRateSlope1=55000000000000000000000000&variableRateSlope2=1000000000000000000000000000&optimalUsageRatio=800000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) | ![after](https://dash.onaave.com/api/static?variableRateSlope1=125000000000000000000000000&variableRateSlope2=1000000000000000000000000000&optimalUsageRatio=800000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) |

## Raw diff

```json
{
"reserves": {
"0x6B175474E89094C44Da98b954EedeAC495271d0F": {
"interestRateStrategy": {
"from": "0xA939B1f36E9a14B044B8149933184a18E0dFC17D",
"to": "0x7011B47A142E2f462AB10F5bDBc8A478310EB0FD"
}
},
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": {
"interestRateStrategy": {
"from": "0x6a8C8119b2BA9460162B8C999f5A8C84f28a033f",
"to": "0x4e1494475048fa155F1D837B6bD51458bD170f48"
}
},
"0xdAC17F958D2ee523a2206206994597C13D831ec7": {
"interestRateStrategy": {
"from": "0xa8850b94E4A0B881c3b08aE065D189D87F34F175",
"to": "0x869eF970878F96c130E14B46B024D2ca18b5b762"
}
}
},
"strategies": {
"0x6B175474E89094C44Da98b954EedeAC495271d0F": {
"address": {
"from": "0xA939B1f36E9a14B044B8149933184a18E0dFC17D",
"to": "0x7011B47A142E2f462AB10F5bDBc8A478310EB0FD"
},
"variableRateSlope1": {
"from": "55000000000000000000000000",
"to": "125000000000000000000000000"
}
},
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": {
"address": {
"from": "0x6a8C8119b2BA9460162B8C999f5A8C84f28a033f",
"to": "0x4e1494475048fa155F1D837B6bD51458bD170f48"
},
"variableRateSlope1": {
"from": "55000000000000000000000000",
"to": "125000000000000000000000000"
}
},
"0xdAC17F958D2ee523a2206206994597C13D831ec7": {
"address": {
"from": "0xa8850b94E4A0B881c3b08aE065D189D87F34F175",
"to": "0x869eF970878F96c130E14B46B024D2ca18b5b762"
},
"variableRateSlope1": {
"from": "55000000000000000000000000",
"to": "125000000000000000000000000"
}
}
}
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,47 @@
| --- | --- | --- |
| interestRateStrategy | [0x79715aB77F637C95a8c28804F56f98946B332851](https://polygonscan.com/address/0x79715aB77F637C95a8c28804F56f98946B332851) | [0xAF5917cFc2F376eCD6c4df91C9AC5965Beaf5AfA](https://polygonscan.com/address/0xAF5917cFc2F376eCD6c4df91C9AC5965Beaf5AfA) |
| variableRateSlope1 | 11.25 % | 12 % |
| interestRate | ![before](/.assets/6915e7063266167ef15bdb78b210c78b61a3ee71.svg) | ![after](/.assets/677bb3d52a3dee35bd995572dcfcda026d303815.svg) |
| interestRate | ![before](https://dash.onaave.com/api/static?variableRateSlope1=112500000000000000000000000&variableRateSlope2=1340000000000000000000000000&optimalUsageRatio=480000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) | ![after](https://dash.onaave.com/api/static?variableRateSlope1=120000000000000000000000000&variableRateSlope2=1340000000000000000000000000&optimalUsageRatio=480000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) |

#### WBTC ([0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6](https://polygonscan.com/address/0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6))

| description | value before | value after |
| --- | --- | --- |
| interestRateStrategy | [0xbbEA829b9E104733Cf69b6e96E7Ff810cBcfae38](https://polygonscan.com/address/0xbbEA829b9E104733Cf69b6e96E7Ff810cBcfae38) | [0x3465528BE493a61629234C259b62b9539817d8e7](https://polygonscan.com/address/0x3465528BE493a61629234C259b62b9539817d8e7) |
| variableRateSlope1 | 9.25 % | 10 % |
| interestRate | ![before](/.assets/6650d384c2b8469b66743178da45ac5b7d37de2c.svg) | ![after](/.assets/6efc2be6d186d0f9ec95cd884ac9775e328507e7.svg) |
| interestRate | ![before](https://dash.onaave.com/api/static?variableRateSlope1=92500000000000000000000000&variableRateSlope2=1340000000000000000000000000&optimalUsageRatio=370000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) | ![after](https://dash.onaave.com/api/static?variableRateSlope1=100000000000000000000000000&variableRateSlope2=1340000000000000000000000000&optimalUsageRatio=370000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) |

#### USDC ([0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174](https://polygonscan.com/address/0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174))

| description | value before | value after |
| --- | --- | --- |
| interestRateStrategy | [0xf98258ea0C095157c2c390E9f6d914847d7fbACf](https://polygonscan.com/address/0xf98258ea0C095157c2c390E9f6d914847d7fbACf) | [0x4309B0d719a0Dfb526EE9C0E58b77635B2971cC4](https://polygonscan.com/address/0x4309B0d719a0Dfb526EE9C0E58b77635B2971cC4) |
| variableRateSlope1 | 14.25 % | 15 % |
| interestRate | ![before](/.assets/dfecd97a09cb209cb661ea90b029bd58db92a066.svg) | ![after](/.assets/b747c0090de2cc213d7d5ef6dc8d35034bd6fabe.svg) |
| interestRate | ![before](https://dash.onaave.com/api/static?variableRateSlope1=142500000000000000000000000&variableRateSlope2=1340000000000000000000000000&optimalUsageRatio=770000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) | ![after](https://dash.onaave.com/api/static?variableRateSlope1=150000000000000000000000000&variableRateSlope2=1340000000000000000000000000&optimalUsageRatio=770000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) |

#### WETH ([0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619](https://polygonscan.com/address/0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619))

| description | value before | value after |
| --- | --- | --- |
| interestRateStrategy | [0x9C9f4C39952848FBA513d44B356c7855F504B1cd](https://polygonscan.com/address/0x9C9f4C39952848FBA513d44B356c7855F504B1cd) | [0xd141820D89840C9A3b0AE46c041D70B98F15928F](https://polygonscan.com/address/0xd141820D89840C9A3b0AE46c041D70B98F15928F) |
| variableRateSlope1 | 9.25 % | 10 % |
| interestRate | ![before](/.assets/6f7a87524bb74b6a49faabc68d32cf5bb1e16899.svg) | ![after](/.assets/6975d921b3c041277e54308467fc64285fc75196.svg) |
| interestRate | ![before](https://dash.onaave.com/api/static?variableRateSlope1=92500000000000000000000000&variableRateSlope2=1340000000000000000000000000&optimalUsageRatio=400000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) | ![after](https://dash.onaave.com/api/static?variableRateSlope1=100000000000000000000000000&variableRateSlope2=1340000000000000000000000000&optimalUsageRatio=400000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) |

#### DAI ([0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063](https://polygonscan.com/address/0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063))

| description | value before | value after |
| --- | --- | --- |
| interestRateStrategy | [0x5c9B09Bb260BCa51f4C5476013eE5949F2C4f397](https://polygonscan.com/address/0x5c9B09Bb260BCa51f4C5476013eE5949F2C4f397) | [0xDa6b70b725404A0c6bb116B1584fb88Eb7d7ED6d](https://polygonscan.com/address/0xDa6b70b725404A0c6bb116B1584fb88Eb7d7ED6d) |
| variableRateSlope1 | 14.25 % | 15 % |
| interestRate | ![before](/.assets/1cc370116b8869617805acb375f6e4ea0388878c.svg) | ![after](/.assets/fe8490c89960dd4c0d4597cb152f4ce0485c673c.svg) |
| interestRate | ![before](https://dash.onaave.com/api/static?variableRateSlope1=142500000000000000000000000&variableRateSlope2=1340000000000000000000000000&optimalUsageRatio=710000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) | ![after](https://dash.onaave.com/api/static?variableRateSlope1=150000000000000000000000000&variableRateSlope2=1340000000000000000000000000&optimalUsageRatio=710000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) |

#### USDT ([0xc2132D05D31c914a87C6611C10748AEb04B58e8F](https://polygonscan.com/address/0xc2132D05D31c914a87C6611C10748AEb04B58e8F))

| description | value before | value after |
| --- | --- | --- |
| interestRateStrategy | [0xDC220F1d8EA6910BDBbb48c4AdFb7cE565500D08](https://polygonscan.com/address/0xDC220F1d8EA6910BDBbb48c4AdFb7cE565500D08) | [0xAb85FD7DCBFdD40e822321DAc4D5fD3cf08b2542](https://polygonscan.com/address/0xAb85FD7DCBFdD40e822321DAc4D5fD3cf08b2542) |
| variableRateSlope1 | 14.25 % | 15 % |
| interestRate | ![before](/.assets/97e2d5a39dbc577e317098062838a03c4c79b1a5.svg) | ![after](/.assets/91fc38e72a46271f6e68f56fa46bf6c3060ae70a.svg) |
| interestRate | ![before](https://dash.onaave.com/api/static?variableRateSlope1=142500000000000000000000000&variableRateSlope2=1340000000000000000000000000&optimalUsageRatio=520000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) | ![after](https://dash.onaave.com/api/static?variableRateSlope1=150000000000000000000000000&variableRateSlope2=1340000000000000000000000000&optimalUsageRatio=520000000000000000000000000&baseVariableBorrowRate=0&maxVariableBorrowRate=undefined) |

## Raw diff

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Raw diff

```json
{}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Raw diff

```json
{}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Raw diff

```json
{}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Raw diff

```json
{}
```
Loading

0 comments on commit 2ffccd0

Please sign in to comment.