From 1e6463001030f04f8651437fd664dfd6c8c24ced Mon Sep 17 00:00:00 2001 From: moebius <132487952+0xmoebius@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:19:19 +0200 Subject: [PATCH 1/9] chore: bump natspec smells version and update config file (#78) --- natspec-smells.config.js | 3 ++- package.json | 2 +- yarn.lock | 38 +++++++++++++++++++------------------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/natspec-smells.config.js b/natspec-smells.config.js index 458623a3..d75ae615 100644 --- a/natspec-smells.config.js +++ b/natspec-smells.config.js @@ -4,5 +4,6 @@ /** @type {import('@defi-wonderland/natspec-smells').Config} */ module.exports = { - include: 'src' + include: 'src/**/*.sol', + exclude: '(test|scripts)/**/*.sol', }; diff --git a/package.json b/package.json index 0ae14e9c..587f4d05 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "devDependencies": { "@commitlint/cli": "19.3.0", "@commitlint/config-conventional": "19.2.2", - "@defi-wonderland/natspec-smells": "1.1.1", + "@defi-wonderland/natspec-smells": "1.1.3", "forge-std": "github:foundry-rs/forge-std#1.8.2", "halmos-cheatcodes": "github:a16z/halmos-cheatcodes#c0d8655", "husky": ">=8", diff --git a/yarn.lock b/yarn.lock index 7cdad647..3cc6b874 100644 --- a/yarn.lock +++ b/yarn.lock @@ -181,13 +181,13 @@ "@types/conventional-commits-parser" "^5.0.0" chalk "^5.3.0" -"@defi-wonderland/natspec-smells@1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@defi-wonderland/natspec-smells/-/natspec-smells-1.1.1.tgz#1eed85765ebe4799f8861247308d6365dbf6dbaa" - integrity sha512-vtOKN4j32Rxl8c1txXxs/iDlkPRmrL/UzUYWOzowe1HYH8ioPMRrsKAYVriDBLsvSi2bY06Sl3cN9SQJSbVzsA== +"@defi-wonderland/natspec-smells@1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@defi-wonderland/natspec-smells/-/natspec-smells-1.1.3.tgz#6d4c7e289b24264856170fec33e0cae0c844bd32" + integrity sha512-QfZ7uD2bseU/QwQgY8uFrGSD5+a4y1S+GqCNePfmjgRGnEaV7zSFL5FO+zd1GUMtWQNGLgSuRknJMu6DEp3njw== dependencies: fast-glob "3.3.2" - solc-typed-ast "18.1.2" + solc-typed-ast "18.1.6" yargs "17.7.2" "@noble/curves@1.3.0", "@noble/curves@~1.3.0": @@ -375,10 +375,10 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -axios@^1.6.7: - version "1.7.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.1.tgz#522145622a09dfaf49359837db9649ff245a35b9" - integrity sha512-+LV37nQcd1EpFalkXksWNBiA17NZ5m5/WspmHGmZmdx1qBOg/VNq/c4eRJiA9VQQHBOs+N0ZhhdU10h2TyNK7Q== +axios@^1.6.8: + version "1.7.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.2.tgz#b625db8a7051fbea61c35a3cbb3a1daa7b9c7621" + integrity sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw== dependencies: follow-redirects "^1.15.6" form-data "^4.0.0" @@ -1647,26 +1647,26 @@ slice-ansi@^7.0.0: ansi-styles "^6.2.1" is-fullwidth-code-point "^5.0.0" -solc-typed-ast@18.1.2: - version "18.1.2" - resolved "https://registry.yarnpkg.com/solc-typed-ast/-/solc-typed-ast-18.1.2.tgz#bc958fe3aead765cf6c2e06ce3d53c61fd06e70c" - integrity sha512-57IKzvXHcyjqdjHEdX7NQuWkPALlH8V4eJ6UUehWrzgHDVzKVOCFplwgLDRnOZ8kDMO8+Ms8sQhfrivFK+v5FA== +solc-typed-ast@18.1.6: + version "18.1.6" + resolved "https://registry.yarnpkg.com/solc-typed-ast/-/solc-typed-ast-18.1.6.tgz#997e986583f0fdddb3ddb1960c33d5c63b3f729a" + integrity sha512-nBk24fdju+P2xsy32tG6HLqkXI+Tn+W84Fqm5+XD1Xby2/8YLlsMgI3ADoRPhhO7DeWjq/kflm//dGNkEb3ILA== dependencies: - axios "^1.6.7" + axios "^1.6.8" commander "^12.0.0" decimal.js "^10.4.3" findup-sync "^5.0.0" fs-extra "^11.2.0" jsel "^1.1.6" semver "^7.6.0" - solc "0.8.24" + solc "0.8.25" src-location "^1.1.0" web3-eth-abi "^4.2.0" -solc@0.8.24: - version "0.8.24" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.24.tgz#6e5693d28208d00a20ff2bdabc1dec85a5329bbb" - integrity sha512-G5yUqjTUPc8Np74sCFwfsevhBPlUifUOfhYrgyu6CmYlC6feSw0YS6eZW47XDT23k3JYdKx5nJ+Q7whCEmNcoA== +solc@0.8.25: + version "0.8.25" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.25.tgz#393f3101617388fb4ba2a58c5b03ab02678e375c" + integrity sha512-7P0TF8gPeudl1Ko3RGkyY6XVCxe2SdD/qQhtns1vl3yAbK/PDifKDLHGtx1t7mX3LgR7ojV7Fg/Kc6Q9D2T8UQ== dependencies: command-exists "^1.2.8" commander "^8.1.0" From 7827306a8155bc9f00081a9771709397730be287 Mon Sep 17 00:00:00 2001 From: Gas <86567384+gas1cent@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:34:21 +0400 Subject: [PATCH 2/9] feat: update forge-std to v1.9.2 (#74) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 587f4d05..b92bb27c 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@commitlint/cli": "19.3.0", "@commitlint/config-conventional": "19.2.2", "@defi-wonderland/natspec-smells": "1.1.3", - "forge-std": "github:foundry-rs/forge-std#1.8.2", + "forge-std": "github:foundry-rs/forge-std#1.9.2", "halmos-cheatcodes": "github:a16z/halmos-cheatcodes#c0d8655", "husky": ">=8", "lint-staged": ">=10", diff --git a/yarn.lock b/yarn.lock index 3cc6b874..8fc2ddf7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -801,9 +801,9 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" -"forge-std@github:foundry-rs/forge-std#1.8.2": - version "1.8.2" - resolved "https://codeload.github.com/foundry-rs/forge-std/tar.gz/978ac6fadb62f5f0b723c996f64be52eddba6801" +"forge-std@github:foundry-rs/forge-std#1.9.2": + version "1.9.2" + resolved "https://codeload.github.com/foundry-rs/forge-std/tar.gz/1714bee72e286e73f76e320d110e0eaf5c4e649d" form-data@^4.0.0: version "4.0.0" From 5c31a7034f56ea78589ea64a5d03b2d846c199f5 Mon Sep 17 00:00:00 2001 From: shaito <106555513+0xShaito@users.noreply.github.com> Date: Tue, 20 Aug 2024 05:06:15 -0300 Subject: [PATCH 3/9] feat: update solidity exporter (#79) --- .github/workflows/canary.yml | 29 +++++++++++++++++------------ .github/workflows/release.yml | 29 +++++++++++++++++------------ 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 0c13f9c2..b5631751 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -5,12 +5,18 @@ on: workflow_dispatch jobs: export: name: Generate Interfaces And Contracts - # Remove the following line if you wish to export your Solidity contracts and interfaces and publish them to NPM + + # 1) Remove the following line if you wish to export your Solidity contracts and interfaces and publish them to NPM if: false runs-on: ubuntu-latest strategy: matrix: - export_type: ['interfaces', 'contracts'] + export_type: ['interfaces', 'all'] + + env: + # 2) Fill the project name to be used in NPM + NPM_PACKAGE_NAME: 'my-cool-project' + EXPORT_NAME: ${{ matrix.export_type == 'interfaces' && '-interfaces' || '' }} steps: - name: Checkout Repo @@ -37,18 +43,17 @@ jobs: - name: Update version run: yarn version --new-version "0.0.0-${GITHUB_SHA::8}" --no-git-tag-version - - name: Export Solidity - ${{ matrix.export_type }} - uses: defi-wonderland/solidity-exporter-action@v2.0.0 + - name: Export Solidity - Export Type ${{ matrix.export_type }} + uses: defi-wonderland/solidity-exporter-action@v2.1.0 with: - # Update package_name with your package name - package_name: 'my-cool-project' + package_name: ${{ env.NPM_PACKAGE_NAME }} out: 'out' - interfaces: 'src/interfaces' - contracts: 'src/contracts' + interfaces: 'solidity/interfaces' + contracts: 'solidity/contracts' + libraries: "solidity/libraries" export_type: '${{ matrix.export_type }}' - - name: Publish to NPM - ${{ matrix.export_type }} - # Update `my-cool-project` with your package name - run: cd export/my-cool-project-${{ matrix.export_type }} && npm publish --access public --tag canary + - name: Publish to NPM - Export Type ${{ matrix.export_type }} + run: cd export/${{ env.NPM_PACKAGE_NAME }}${{ env.EXPORT_NAME }} && npm publish --access public --tag canary env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b70ed1fe..c61a69d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,12 +7,18 @@ on: jobs: release: name: Release - # Remove the following line if you wish to export your Solidity contracts and interfaces and publish them to NPM + + # 1) Remove the following line if you wish to export your Solidity contracts and interfaces and publish them to NPM if: false runs-on: ubuntu-latest strategy: matrix: - export_type: ['interfaces', 'contracts'] + export_type: ['interfaces', 'all'] + + env: + # 2) Fill the project name to be used in NPM + NPM_PACKAGE_NAME: 'my-cool-project' + EXPORT_NAME: ${{ matrix.export_type == 'interfaces' && '-interfaces' || '' }} steps: - name: Checkout Repo @@ -36,18 +42,17 @@ jobs: - name: Build project and generate out directory run: yarn build - - name: Export Solidity - ${{ matrix.export_type }} - uses: defi-wonderland/solidity-exporter-action@v2.0.0 + - name: Export Solidity - Export Type ${{ matrix.export_type }} + uses: defi-wonderland/solidity-exporter-action@v2.1.0 with: - # Update package_name with your package name - package_name: 'my-cool-project' + package_name: ${{ env.NPM_PACKAGE_NAME }} out: 'out' - interfaces: 'src/interfaces' - contracts: 'src/contracts' + interfaces: 'solidity/interfaces' + contracts: 'solidity/contracts' + libraries: "solidity/libraries" export_type: '${{ matrix.export_type }}' - - name: Publish to NPM - ${{ matrix.export_type }} - # Update `my-cool-project` with your package name - run: cd export/my-cool-project-${{ matrix.export_type }} && npm publish --access public --tag latest + - name: Publish to NPM - Export Type ${{ matrix.export_type }} + run: cd export/${{ env.NPM_PACKAGE_NAME }}${{ env.EXPORT_NAME }} && npm publish --access public --tag latest env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 953630b5fbea1ded033a99cc1b28a3cbf62d7a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wei=C3=9Fer=20Hase?= Date: Mon, 26 Aug 2024 07:28:45 +0200 Subject: [PATCH 4/9] fix: typo in husky pre-commit (#80) --- .husky/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 509d461f..6b3a9be2 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -3,5 +3,5 @@ # 1. Build the contracts # 2. Stage build output -# 2. Lint and stage style improvements +# 3. Lint and stage style improvements yarn build && npx lint-staged \ No newline at end of file From 5fd9a759e3f0a0d53c925aad09a3717ba21299ca Mon Sep 17 00:00:00 2001 From: 0xJabberwock <0xjabberwock@defi.sucks> Date: Tue, 3 Sep 2024 09:55:23 -0300 Subject: [PATCH 5/9] refactor: set `params_first_multi` for `multiline_func_header` in `forge fmt` (#81) --- foundry.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundry.toml b/foundry.toml index b9d9beb4..f3644c39 100644 --- a/foundry.toml +++ b/foundry.toml @@ -5,7 +5,7 @@ bracket_spacing = false int_types = 'long' quote_style = 'single' number_underscore = 'thousands' -multiline_func_header = 'params_first' +multiline_func_header = 'params_first_multi' sort_imports = true [profile.default] From 05323dbd80820d0062a81218496b30ba5cd8d077 Mon Sep 17 00:00:00 2001 From: 0xJabberwock <0xjabberwock@defi.sucks> Date: Tue, 17 Sep 2024 08:53:00 -0300 Subject: [PATCH 6/9] feat: replace env private keys with keystores (#83) --- .env.example | 4 ++-- README.md | 16 +++++++++++++++- foundry.toml | 4 ++-- package.json | 4 ++-- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.env.example b/.env.example index fe295b73..14d938c8 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ MAINNET_RPC= -MAINNET_DEPLOYER_PK= +MAINNET_DEPLOYER_NAME= SEPOLIA_RPC= -SEPOLIA_DEPLOYER_PK= +SEPOLIA_DEPLOYER_NAME= ETHERSCAN_API_KEY= diff --git a/README.md b/README.md index 7f350720..5a4d6546 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,21 @@ yarn coverage ### Setup -Configure the `.env` variables. +Configure the `.env` variables and source them: + +```bash +source .env +``` + +Import your private keys into Foundry's encrypted keystore: + +```bash +cast wallet import $MAINNET_DEPLOYER_NAME --interactive +``` + +```bash +cast wallet import $SEPOLIA_DEPLOYER_NAME --interactive +``` ### Sepolia diff --git a/foundry.toml b/foundry.toml index f3644c39..fcadc272 100644 --- a/foundry.toml +++ b/foundry.toml @@ -32,5 +32,5 @@ mainnet = "${MAINNET_RPC}" sepolia = "${SEPOLIA_RPC}" [etherscan] -mainnet = { key = "${ETHERSCAN_API_KEY}", chain = "mainnet" } -sepolia = { key = "${ETHERSCAN_API_KEY}", chain = "sepolia" } +mainnet = { key = "${ETHERSCAN_API_KEY}" } +sepolia = { key = "${ETHERSCAN_API_KEY}" } diff --git a/package.json b/package.json index b92bb27c..911a004b 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "build": "forge build", "build:optimized": "FOUNDRY_PROFILE=optimized forge build", "coverage": "forge coverage --report summary --report lcov --match-path 'test/unit/*'", - "deploy:mainnet": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $MAINNET_RPC --broadcast --chain mainnet --private-key $MAINNET_DEPLOYER_PK'", - "deploy:sepolia": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $SEPOLIA_RPC --broadcast --chain sepolia --private-key $SEPOLIA_DEPLOYER_PK'", + "deploy:mainnet": "bash -c 'source .env && forge script Deploy --rpc-url $MAINNET_RPC --account $MAINNET_DEPLOYER_NAME --broadcast --verify --chain mainnet -vvvvv'", + "deploy:sepolia": "bash -c 'source .env && forge script Deploy --rpc-url $SEPOLIA_RPC --account $SEPOLIA_DEPLOYER_NAME --broadcast --verify --chain sepolia -vvvvv'", "lint:check": "yarn lint:sol-tests && yarn lint:sol-logic && forge fmt --check", "lint:fix": "sort-package-json && forge fmt && yarn lint:sol-tests --fix && yarn lint:sol-logic --fix", "lint:natspec": "npx @defi-wonderland/natspec-smells --config natspec-smells.config.js", From 537aac83eb0a5c73447dcea78d99c4b4a0f5e083 Mon Sep 17 00:00:00 2001 From: xorsal Date: Tue, 1 Oct 2024 08:01:48 -0400 Subject: [PATCH 7/9] chore: bump husky version (#84) --- .husky/commit-msg | 3 --- .husky/pre-commit | 7 ++----- package.json | 4 ++-- yarn.lock | 8 ++++---- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.husky/commit-msg b/.husky/commit-msg index 314e8214..d468455f 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - npx --no-install commitlint --edit $1 \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit index 6b3a9be2..c8d494d5 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,7 +1,4 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - # 1. Build the contracts -# 2. Stage build output -# 3. Lint and stage style improvements +# 2. Stage build output +# 3. Lint and stage style improvements yarn build && npx lint-staged \ No newline at end of file diff --git a/package.json b/package.json index 911a004b..738c1d49 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "lint:natspec": "npx @defi-wonderland/natspec-smells --config natspec-smells.config.js", "lint:sol-logic": "solhint -c .solhint.json 'src/**/*.sol' 'script/**/*.sol'", "lint:sol-tests": "solhint -c .solhint.tests.json 'test/**/*.sol'", - "prepare": "husky install", + "prepare": "husky", "test": "forge test -vvv", "test:fuzz": "echidna test/invariants/fuzz/Greeter.t.sol --contract InvariantGreeter --corpus-dir test/invariants/fuzz/echidna_coverage/ --test-mode assertion", "test:integration": "forge test --match-contract Integration -vvv", @@ -40,7 +40,7 @@ "@defi-wonderland/natspec-smells": "1.1.3", "forge-std": "github:foundry-rs/forge-std#1.9.2", "halmos-cheatcodes": "github:a16z/halmos-cheatcodes#c0d8655", - "husky": ">=8", + "husky": ">=9", "lint-staged": ">=10", "solhint-community": "4.0.0", "sort-package-json": "2.10.0" diff --git a/yarn.lock b/yarn.lock index 8fc2ddf7..59ef3222 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1003,10 +1003,10 @@ human-signals@^5.0.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== -husky@>=8: - version "9.0.11" - resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.11.tgz#fc91df4c756050de41b3e478b2158b87c1e79af9" - integrity sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw== +husky@>=9: + version "9.1.6" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.1.6.tgz#e23aa996b6203ab33534bdc82306b0cf2cb07d6c" + integrity sha512-sqbjZKK7kf44hfdE94EoX8MZNk0n7HeW37O4YrVGCF4wzgQjp+akPAkfUK5LZ6KuR/6sqeAVuXHji+RzQgOn5A== ignore@^5.2.4: version "5.3.1" From 20be3858965b42bba75d95f2e5cc8a9564e7f444 Mon Sep 17 00:00:00 2001 From: shaito <106555513+0xShaito@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:20:01 -0300 Subject: [PATCH 8/9] feat: use solhint features (#82) Co-authored-by: Gas One Cent <86567384+gas1cent@users.noreply.github.com> --- .solhint.json | 10 +++------- .solhint.tests.json | 25 ------------------------- package.json | 10 ++++------ script/.solhint.json | 7 +++++++ src/interfaces/.solhint.json | 11 +++++++++++ test/.solhint.json | 16 ++++++++++++++++ 6 files changed, 41 insertions(+), 38 deletions(-) delete mode 100644 .solhint.tests.json create mode 100644 script/.solhint.json create mode 100644 src/interfaces/.solhint.json create mode 100644 test/.solhint.json diff --git a/.solhint.json b/.solhint.json index 94f58b24..23782374 100644 --- a/.solhint.json +++ b/.solhint.json @@ -1,18 +1,14 @@ { "extends": "solhint:recommended", "rules": { - "compiler-version": ["off"], - "constructor-syntax": "warn", - "quotes": ["error", "single"], + "compiler-version": ["warn"], + "quotes": "off", "func-visibility": ["warn", { "ignoreConstructors": true }], - "not-rely-on-time": "off", "no-inline-assembly": "off", "no-empty-blocks": "off", "private-vars-leading-underscore": ["warn", { "strict": false }], "ordering": "warn", - "immutable-name-snakecase": "warn", "avoid-low-level-calls": "off", - "no-console": "off", - "max-line-length": ["warn", 120] + "named-parameters-mapping": "warn" } } diff --git a/.solhint.tests.json b/.solhint.tests.json deleted file mode 100644 index fb26b4ea..00000000 --- a/.solhint.tests.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": "solhint:recommended", - "rules": { - "compiler-version": ["off"], - "constructor-syntax": "warn", - "quotes": ["error", "single"], - "func-visibility": ["warn", { "ignoreConstructors": true }], - "not-rely-on-time": "off", - "style-guide-casing": "off", - "var-name-mixedcase": "off", - "const-name-snakecase": "off", - "no-inline-assembly": "off", - "no-empty-blocks": "error", - "definition-name-capwords": "off", - "named-parameters-function": "off", - "no-global-import": "off", - "max-states-count": "off", - "private-vars-leading-underscore": ["warn", { "strict": false }], - "ordering": "off", - "immutable-name-snakecase": "warn", - "avoid-low-level-calls": "off", - "one-contract-per-file": "off", - "max-line-length": ["warn", 120] - } -} diff --git a/package.json b/package.json index 738c1d49..88242ec3 100644 --- a/package.json +++ b/package.json @@ -15,11 +15,10 @@ "coverage": "forge coverage --report summary --report lcov --match-path 'test/unit/*'", "deploy:mainnet": "bash -c 'source .env && forge script Deploy --rpc-url $MAINNET_RPC --account $MAINNET_DEPLOYER_NAME --broadcast --verify --chain mainnet -vvvvv'", "deploy:sepolia": "bash -c 'source .env && forge script Deploy --rpc-url $SEPOLIA_RPC --account $SEPOLIA_DEPLOYER_NAME --broadcast --verify --chain sepolia -vvvvv'", - "lint:check": "yarn lint:sol-tests && yarn lint:sol-logic && forge fmt --check", - "lint:fix": "sort-package-json && forge fmt && yarn lint:sol-tests --fix && yarn lint:sol-logic --fix", + "lint:check": "yarn lint:sol && forge fmt --check", + "lint:fix": "sort-package-json && forge fmt && yarn lint:sol --fix", "lint:natspec": "npx @defi-wonderland/natspec-smells --config natspec-smells.config.js", - "lint:sol-logic": "solhint -c .solhint.json 'src/**/*.sol' 'script/**/*.sol'", - "lint:sol-tests": "solhint -c .solhint.tests.json 'test/**/*.sol'", + "lint:sol": "solhint 'src/**/*.sol' 'script/**/*.sol' 'test/**/*.sol'", "prepare": "husky", "test": "forge test -vvv", "test:fuzz": "echidna test/invariants/fuzz/Greeter.t.sol --contract InvariantGreeter --corpus-dir test/invariants/fuzz/echidna_coverage/ --test-mode assertion", @@ -30,8 +29,7 @@ }, "lint-staged": { "*.{js,css,md,ts,sol}": "forge fmt", - "(src|script)/**/*.sol": "yarn lint:sol-logic", - "test/**/*.sol": "yarn lint:sol-tests", + "(src|test|script)/**/*.sol": "yarn lint:sol", "package.json": "sort-package-json" }, "devDependencies": { diff --git a/script/.solhint.json b/script/.solhint.json new file mode 100644 index 00000000..740c6a42 --- /dev/null +++ b/script/.solhint.json @@ -0,0 +1,7 @@ +{ + "rules": { + "ordering": "off", + "one-contract-per-file": "off", + "no-console": "off" + } +} diff --git a/src/interfaces/.solhint.json b/src/interfaces/.solhint.json new file mode 100644 index 00000000..8bb790c1 --- /dev/null +++ b/src/interfaces/.solhint.json @@ -0,0 +1,11 @@ +{ + "rules": { + "ordering": "warn", + "style-guide-casing": [ + "warn", + { + "ignoreExternalFunctions": true + } + ] + } +} diff --git a/test/.solhint.json b/test/.solhint.json new file mode 100644 index 00000000..3ec7f113 --- /dev/null +++ b/test/.solhint.json @@ -0,0 +1,16 @@ +{ + "rules": { + "style-guide-casing": [ + "warn", + { + "ignorePublicFunctions":true, + "ignoreExternalFunctions":true, + "ignoreContracts":true + } + ], + "no-global-import": "off", + "max-states-count": "off", + "ordering": "off", + "one-contract-per-file": "off" + } +} From 0db7d7943226095177db0d838e31a8b401b8ed0b Mon Sep 17 00:00:00 2001 From: Hex <165055168+hexshire@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:51:08 -0300 Subject: [PATCH 9/9] chore: update tests workflow (#89) --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 18624462..a9b5fdbb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,7 +31,7 @@ jobs: - name: Install dependencies run: yarn --frozen-lockfile --network-concurrency 1 - - name: Precompile using 0.8.14 and via-ir=false + - name: Precompile run: yarn build - name: Run tests @@ -58,7 +58,7 @@ jobs: - name: Install dependencies run: yarn --frozen-lockfile --network-concurrency 1 - - name: Precompile using 0.8.14 and via-ir=false + - name: Precompile run: yarn build - name: Run tests @@ -120,7 +120,7 @@ jobs: - name: Install dependencies run: yarn --frozen-lockfile --network-concurrency 1 - - name: Precompile with via-ir=false + - name: Precompile run: yarn build - name: Run tests @@ -151,4 +151,4 @@ jobs: - name: Install dependencies run: yarn --frozen-lockfile --network-concurrency 1 - - run: yarn lint:check \ No newline at end of file + - run: yarn lint:check