8000 Release v2.6.0 by baroooo · Pull Request #564 · mento-protocol/mento-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Release v2.6.0 #564

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

Merged
merged 39 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7323a61
chore: reduce CI foundry test verbosity (#475)
m-chrzan Jul 4, 2024
3a53cd2
fix: add nativeUSDT to collateral assets (#434)
nvtaveras Jul 9, 2024
db79057
feat: implement Chainlink relayer contract (#456)
m-chrzan Jul 15, 2024
0f12c99
feat: implement Chainlink relayer factory (#476)
m-chrzan Aug 7, 2024
bf70520
feat: proxy ChainlinkRelayerFactory (#481)
m-chrzan Aug 8, 2024
31e5f01
feat: add PUSO + remove cPHP proxy contract (#497)
denviljclarke Aug 15, 2024
38dae01
Feat: Make ChainlinkRelayer support implicit pairs (#487)
bowd Aug 16, 2024
7f9f7b9
feat/cosmetic: Move Proxy Contracts around (#498)
bowd Aug 21, 2024
6feadf3
feat: Add relayerDeployer ACL role to the factory (#499)
bowd Aug 22, 2024
f0d5316
Revert "feat: remove maxTimestampSpread and only rely on expiry" (#504)
bowd Aug 26, 2024
45a551d
THE BIG ONE 🐘 💣 🚝 (#501)
bowd Aug 26, 2024
d916e50
Remove the need for `--via-ir` in our contracts (#502)
bowd Aug 27, 2024
24a2e68
Improve 🍴 Fork Tests (#503)
bowd Aug 27, 2024
e37f1e5
chore: remove contracts that we no longer manage from storage-layout …
bowd Aug 27, 2024
2d34024
fix: gas tests (#507)
baroooo Aug 28, 2024
ec87e4e
test: add fork test for new PUSO exchange (#509)
philbow61 Sep 3, 2024
6f8b5b7
chore: add mainnet php/usd fork tests (#516)
nvtaveras Sep 9, 2024
9349b38
Feat add stable tokenc ghs proxy (#536)
baroooo Oct 24, 2024
8722c6d
feat: GoodDollar (#522)
philbow61 Oct 24, 2024
d198a38
feat: add cCOP fork tests (#537)
nvtaveras Nov 5, 2024
c9e2d5e
chore: add missing getter function from Reserve to interface (#541)
philbow61 Nov 12, 2024
84d9d42
feat: fix add missing min check (#547) 8000
baroooo Nov 22, 2024
9f7ee3c
feat: ensure exitContribution is less than 100% (#549)
philbow61 Nov 22, 2024
f321915
chore: remove Pausable (#552)
philbow61 Nov 22, 2024
d51019c
fix: Removed redundant require (#546)
RyRy79261 Nov 22, 2024
b14b3e6
fix: $GD resolved large reward issue (#544)
RyRy79261 Nov 25, 2024
6295656
fix: Typo redundant casting (#545)
RyRy79261 Nov 25, 2024
ea5d779
feat: fix expansion rounding issue (#548)
philbow61 Nov 25, 2024
161ec08
fix: ensure 0 deltaFlow doesn't update state (#550)
philbow61 Nov 25, 2024
e840fa3
fix: ensure scaling for different reserveAsset token decimals (#551)
philbow61 Nov 26, 2024
86053df
fix: setting of last expansion timestamp (#553)
philbow61 Nov 26, 2024
9653183
Feat: slippage protection for reserve ratio (#554)
baroooo Nov 26, 2024
8236d65
Fix/use correct min for int48 (#556)
baroooo Nov 27, 2024
1e78e2c
fix: Exchange created with zero reserve (#558)
RyRy79261 Nov 28, 2024
98290ba
Test/new exit contribution (#557)
philbow61 Nov 29, 2024
f4e3b95
fix: update currentPrice to return correct decimals (#560)
baroooo Dec 2, 2024
06b02cc
Fix/scaling issues for tokens with less than 18 decimals (#561)
baroooo Dec 4, 2024
20fc515
feat: ensure amountOut's are rounded down and amountIn's are roundedU…
philbow61 Dec 4, 2024
fb659b7
Merge branch 'main' into release/2.6.0
baroooo Dec 6, 2024
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
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CELOSCAN_API_KEY=
CELO_MAINNET_RPC_URL=https://forno.celo.org
BAKLAVA_RPC_URL=https://baklava-forno.celo-testnet.org
ALFAJORES_RPC_URL=https://alfajores-forno.celo-testnet.org
ALFAJORES_RPC_URL=https://alfajores-forno.celo-testnet.org
21 changes: 19 additions & 2 deletions .github/workflows/echidna.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,32 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
cache: "yarn"
node-version: "20"

- name: "In A92E stall the Node.js dependencies"
run: "yarn install --immutable"

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: "Build for echidna"
run: forge build --build-info --skip */test/**/*.t.sol */script/**
run: |
forge build --build-info --skip \
"test/fork/**/*" \
"test/integration/**/*" \
"test/unit/**/*" \
"test/utils/**/*" \
"contracts/**/*"

- name: "Run Echidna"
uses: crytic/echidna-action@v2
with:
files: .
solc-version: 0.5.17
contract: ${{ matrix.contract }}
config: echidna.yaml
test-mode: assertion
43 changes: 43 additions & 0 deletions .github/workflows/fork-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "ForkTests"

env:
FOUNDRY_PROFILE: "fork-tests"
ALFAJORES_RPC_URL: ${{secrets.ALFAJORES_RPC_URL}}
CELO_MAINNET_RPC_URL: ${{secrets.CELO_MAINNET_RPC_URL}}

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # everyday at midnight

jobs:
test:
name: Run fork tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
ref: develop

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
cache: "yarn"
node-version: "20"

- name: "Install the Node.js dependencies"
run: "yarn install --immutable"

- name: "Show the Foundry config"
run: "forge config"

- name: "Run the tests"
run: "forge test"

- name: "Add test summary"
run: |
echo "## Tests" >> $GITHUB_STEP_SUMMARY
52 changes: 27 additions & 25 deletions .github/workflows/lint_test.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,59 @@
name: "CI"
name: CI

env:
FOUNDRY_PROFILE: "ci"
FOUNDRY_PROFILE: ci
ALFAJORES_RPC_URL: ${{secrets.ALFAJORES_RPC_URL}}
CELO_MAINNET_RPC_URL: ${{secrets.CELO_MAINNET_RPC_URL}}

on:
workflow_dispatch:
pull_request:
push:
branches:
- "main"
- "develop"
- main
- develop

permissions: read-all

jobs:
lint_and_test:
name: Lint & Test
runs-on: "ubuntu-latest"
runs-on: ubuntu-latest
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
- name: Check out the repo
uses: actions/checkout@v3
with:
submodules: "recursive"
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: "Install Node.js"
uses: "actions/setup-node@v3"
- name: Install Node.js
uses: actions/setup-node@v3
with:
cache: "yarn"
cache: yarn
node-version: "20"

- name: "Install the Node.js dependencies"
run: "yarn install --immutable"
- name: Install the Node.js dependencies
run: yarn install --immutable

- name: "Lint the contracts"
run: "yarn lint:check"
- name: Lint the contracts
run: yarn lint

- name: "Add lint summary"
- name: Add lint summary
run: |
echo "## Lint" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY

- name: "Show the Foundry config"
run: "forge config"
- name: Show the Foundry config
run: forge config

- name: "Run the tests"
run: "forge test"
- name: Run the tests
run: forge test

- name: "Build the contracts"
run: |
forge --version
forge build --sizes
- name: Check contract sizes
run: yarn run check-contract-sizes

- name: "Add test summary"
- name: Add test summary
run: |
echo "## Tests" >> $GITHUB_STEP_SUMMARY
24 changes: 12 additions & 12 deletions .github/workflows/slither.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ jobs:
uses: "actions/checkout@v3"
with:
submodules: "recursive"
- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
cache: "yarn"
node-version: "20"

- name: "Install the Node.js dependencies"
run: "yarn install --immutable"
- name: Run Slither
uses: crytic/slither-action@v0.3.1
uses: crytic/slither-action@v0.4.0
id: slither
with:
sarif: results.sarif
# continue-on-error: true
# -----------------------
# Ideally, we'd like to continue on error to allow uploading the SARIF file here.
# But we're often running into GitHub's API Rate Limit when uploading the SARIF file
# which would lead to lots of failed pipelines even if slither works fine:
# https://github.com/mento-protocol/mento-core/actions/runs/7167865576/job/19514794782
#
# So for now it's better to just let the slither task fail directly so we at least
# know it failed.
# -----------------------
fail-on: "low"
continue-on-error: true
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.slither.outputs.sarif }}
17 changes: 12 additions & 5 deletions .github/workflows/storage-layout.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
name: "Storage Layout"

env:
FOUNDRY_PROFILE: "ci"

on:
workflow_dispatch:
push:
Expand All @@ -14,15 +18,10 @@ jobs:
fail-fast: false
matrix:
contract:
- contracts/legacy/ReserveSpenderMultiSig.sol:ReserveSpenderMultiSig
- contracts/legacy/StableToken.sol:StableToken
- contracts/legacy/Exchange.sol:Exchange
- contracts/legacy/GrandaMento.sol:GrandaMento
- contracts/swap/Broker.sol:Broker
- contracts/swap/BiPoolManager.sol:BiPoolManager
- contracts/swap/Reserve.sol:Reserve
- contracts/oracles/BreakerBox.sol:BreakerBox
- contracts/common/SortedOracles.sol:SortedOracles
- contracts/tokens/StableTokenV2.sol:StableTokenV2
steps:
- uses: actions/checkout@v3
Expand All @@ -32,6 +31,14 @@ jobs:
uses: onbjerg/foundry-toolchain@v1
with:
version: "nightly"
- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
cache: "yarn"
node-version: "20"

- name: "Install the Node.js dependencies"
run: "yarn install --immutable"
- name: Check storage layout
uses: Rubilmax/foundry-storage-check@v3.2.1
with:
Expand Down
12 changes: 6 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/celo-foundry"]
path = lib/celo-foundry
url = https://github.com/bowd/celo-foundry
[submodule "lib/openzeppelin-contracts-next"]
path = lib/openzeppelin-contracts-next
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "lib/forge-std-next"]
path = lib/forge-std-next
url = https://github.com/foundry-rs/forge-std
[submodule "lib/safe-contracts"]
path = lib/safe-contracts
url = https://github.com/safe-global/safe-contracts
Expand All @@ -23,3 +17,9 @@
branch = "release-v4"
path = lib/prb-math
url = https://github.com/PaulRBerg/prb-math
[submodule "lib/mento-std"]
path = lib/mento-std
url = https://github.com/mento-protocol/mento-std
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
3 changes: 2 additions & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint:check
yarn lint
yarn todo
36 changes: 24 additions & 12 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,36 @@ singleQuote: false
tabWidth: 2
trailingComma: all

plugins: [prettier-plugin-solidity]

overrides:
# General Config
- files: ["*.sol"]
options:
compiler: 0.5.17
tabWidth: 2
printWidth: 120
- files: [contracts/tokens/patched/*.sol]
options:
compiler: 0.8.18
- files: [contracts/tokens/StableTokenV2.sol]
options:
compiler: 0.8.18
- files: [contracts/governance/**/*.sol]
options:
compiler: 0.8.18
- files: [test/**/*.sol]
options:
compiler: ""
- files: [contracts/oracles/Chainlink*.sol]

# File-specific Config
- files:
[
contracts/common/IERC20MintableBurnable.sol,
contracts/common/SafeERC20MintableBurnable.sol,
contracts/goodDollar/**/*.sol,
contracts/governance/**/*.sol,
contracts/interfaces/*.sol,
contracts/libraries/TradingLimits.sol,
contracts/oracles/Chainlink*.sol,
contracts/swap/Broker.sol,
contracts/tokens/patched/*.sol,
contracts/tokens/StableTokenV2.sol,
]
options:
compiler: 0.8.18
- files:
- contracts/interfaces/IBrokerAdmin.sol
- contracts/interfaces/ICeloToken.sol
- contracts/interfaces/IExchange.sol
options:
compiler: 0.5.17
14 changes: 6 additions & 8 deletions .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
"code-complexity": ["error", 8],
"compiler-version": ["error", ">=0.5.13"],
"func-visibility": ["error", { "ignoreConstructors": true }],
"max-line-length": ["error", 120],
"not-rely-on-time": "off",
"function-max-lines": ["error", 120],
"gas-custom-errors": "off",
"max-line-length": ["error", 121],
"no-console": "off",
"no-empty-blocks": "off",
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
"no-global-import": "off",
"not-rely-on-time": "off",
"prettier/prettier": ["error", { "endOfLine": "auto" }],
"reason-string": ["warn", { "maxLength": 64 }]
}
}
Loading
Loading
0