Merge pull request #1799 from crytic/detector-compilation-artifacts

testing strategy + coverage workflow
revert-1799-detector-compilation-artifacts
Feist Josselin 2 years ago committed by GitHub
commit 2af8b0c5ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      .github/actions/upload-coverage/action.yml
  2. 13
      .github/scripts/integration_test_runner.sh
  3. 13
      .github/scripts/tool_test_runner.sh
  4. 13
      .github/scripts/unit_test_runner.sh
  5. 51
      .github/workflows/IR.yml
  6. 4
      .github/workflows/ci.yml
  7. 45
      .github/workflows/detectors.yml
  8. 8
      .github/workflows/docs.yml
  9. 56
      .github/workflows/features.yml
  10. 49
      .github/workflows/parser.yml
  11. 53
      .github/workflows/read_storage.yml
  12. 107
      .github/workflows/test.yml
  13. 6
      scripts/ci_test_cli.sh
  14. 2
      scripts/ci_test_erc.sh
  15. 2
      scripts/ci_test_path_filtering.sh
  16. 2
      scripts/ci_test_printers.sh
  17. 12
      setup.py
  18. 32
      tests/detectors/rtlo/0.4.25/right_to_left_override.sol.0.4.25.RightToLeftOverride.json
  19. 32
      tests/detectors/rtlo/0.5.16/right_to_left_override.sol.0.5.16.RightToLeftOverride.json
  20. 32
      tests/detectors/rtlo/0.6.11/right_to_left_override.sol.0.6.11.RightToLeftOverride.json
  21. 88
      tests/detectors/rtlo/0.8.0/unicode_direction_override.sol.0.8.0.RightToLeftOverride.json
  22. 0
      tests/e2e/__init__.py
  23. 0
      tests/e2e/compilation/__init__.py
  24. 0
      tests/e2e/compilation/test_data/test_contract_name_collisions/a.sol
  25. 0
      tests/e2e/compilation/test_data/test_contract_name_collisions/b.sol
  26. 0
      tests/e2e/compilation/test_data/test_cyclic_import/a.sol
  27. 0
      tests/e2e/compilation/test_data/test_cyclic_import/b.sol
  28. 3
      tests/e2e/compilation/test_data/test_node_modules/.gitignore
  29. 0
      tests/e2e/compilation/test_data/test_node_modules/contracts/MyCoin.sol
  30. 2
      tests/e2e/compilation/test_data/test_node_modules/hardhat.config.js
  31. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/access/AccessControl.sol
  32. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/access/AccessControlEnumerable.sol
  33. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/access/IAccessControl.sol
  34. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/access/IAccessControlEnumerable.sol
  35. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/access/Ownable.sol
  36. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/finance/PaymentSplitter.sol
  37. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/finance/VestingWallet.sol
  38. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/Governor.sol
  39. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/IGovernor.sol
  40. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/TimelockController.sol
  41. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/compatibility/GovernorCompatibilityBravo.sol
  42. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/compatibility/IGovernorCompatibilityBravo.sol
  43. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol
  44. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/extensions/GovernorProposalThreshold.sol
  45. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/extensions/GovernorSettings.sol
  46. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/extensions/GovernorTimelockCompound.sol
  47. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/extensions/GovernorTimelockControl.sol
  48. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/extensions/GovernorVotes.sol
  49. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/extensions/GovernorVotesComp.sol
  50. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol
  51. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/governance/extensions/IGovernorTimelock.sol
  52. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC1155.sol
  53. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC1155MetadataURI.sol
  54. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC1155Receiver.sol
  55. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC1271.sol
  56. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC1363.sol
  57. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC1363Receiver.sol
  58. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC1363Spender.sol
  59. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC165.sol
  60. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC1820Implementer.sol
  61. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC1820Registry.sol
  62. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC20.sol
  63. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC20Metadata.sol
  64. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC2981.sol
  65. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC3156.sol
  66. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC3156FlashBorrower.sol
  67. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC3156FlashLender.sol
  68. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC721.sol
  69. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC721Enumerable.sol
  70. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC721Metadata.sol
  71. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC721Receiver.sol
  72. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC777.sol
  73. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC777Recipient.sol
  74. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/IERC777Sender.sol
  75. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/interfaces/draft-IERC2612.sol
  76. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/metatx/ERC2771Context.sol
  77. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/metatx/MinimalForwarder.sol
  78. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/package.json
  79. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/proxy/Clones.sol
  80. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol
  81. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol
  82. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/proxy/Proxy.sol
  83. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol
  84. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/proxy/beacon/IBeacon.sol
  85. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol
  86. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol
  87. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol
  88. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/proxy/utils/Initializable.sol
  89. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol
  90. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/security/Pausable.sol
  91. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/security/PullPayment.sol
  92. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol
  93. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol
  94. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/token/ERC1155/IERC1155.sol
  95. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol
  96. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol
  97. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol
  98. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol
  99. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol
  100. 0
      tests/e2e/compilation/test_data/test_node_modules/node_modules/@openzeppelin/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,30 @@
# Derived from <https://github.com/pyca/cryptography/blob/SOME_REF/.github/actions/upload-coverage/action.yml>
# Originally authored by the PyCA Cryptography maintainers, and licensed under
# the terms of the BSD license:
# <https://github.com/pyca/cryptography/blob/main/LICENSE.BSD>
name: Upload Coverage
description: Upload coverage files
runs:
using: "composite"
steps:
# FIXME(jl): codecov has the option of including machine information in filename that would solve this unique naming
# issue more completely.
# This method has the limitation of 1 coverage file per run, limiting some coverage between online/offline tests.
- run: |
COVERAGE_UUID=$(python3 -c "import uuid; print(uuid.uuid4())")
echo "COVERAGE_UUID=${COVERAGE_UUID}" >> $GITHUB_OUTPUT
if [ -f .coverage ]; then
mv .coverage .coverage.${COVERAGE_UUID}
fi
id: coverage-uuid
shell: bash
- uses: actions/upload-artifact@v3.1.0
with:
name: coverage-data
path: |
.coverage.*
*.lcov
if-no-files-found: ignore

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# used to pass --cov=$path and --cov-append to pytest
if [ "$1" != "" ]; then
pytest "$1" tests/e2e/ -n auto
status_code=$?
python -m coverage report
else
pytest tests/e2e/ -n auto
status_code=$?
fi
exit "$status_code"

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# used to pass --cov=$path and --cov-append to pytest
if [ "$1" != "" ]; then
pytest "$1" tests/tools/read-storage/test_read_storage.py
status_code=$?
python -m coverage report
else
pytest tests/tools/read-storage/test_read_storage.py
status_code=$?
fi
exit "$status_code"

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# used to pass --cov=$path and --cov-append to pytest
if [ "$1" != "" ]; then
pytest "$1" tests/unit/
status_code=$?
python -m coverage report
else
pytest tests/unit/
status_code=$?
fi
exit "$status_code"

@ -1,51 +0,0 @@
---
name: IR tests
defaults:
run:
# To load bashrc
shell: bash -ieo pipefail {0}
on:
pull_request:
branches: [master, dev]
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: IR tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install ".[dev]"
solc-select install 0.5.0
solc-select use 0.8.11 --always-install
- name: Install old solc
if: matrix.os == 'ubuntu-latest'
run: solc-select install 0.4.0
- name: Test with pytest
run: |
pytest tests/test_ssa_generation.py

@ -58,12 +58,10 @@ jobs:
python-version: 3.8 python-version: 3.8
- name: Install dependencies - name: Install dependencies
run: | run: |
pip install ".[dev]" pip install ".[test]"
solc-select use 0.4.25 --always-install solc-select use 0.4.25 --always-install
solc-select use 0.8.0 --always-install solc-select use 0.8.0 --always-install
solc-select use 0.5.1 --always-install solc-select use 0.5.1 --always-install
pip install typing_extensions==4.1.1
pip install importlib_metadata==4.8.3
- name: Set up nix - name: Set up nix
if: matrix.type == 'dapp' if: matrix.type == 'dapp'

@ -1,45 +0,0 @@
---
name: Detectors tests
defaults:
run:
# To load bashrc
shell: bash -ieo pipefail {0}
on:
pull_request:
branches: [master, dev]
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Detectors tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install ".[dev]"
solc-select use 0.7.3 --always-install
- name: Test with pytest
run: |
pytest tests/test_detectors.py

@ -23,7 +23,7 @@ jobs:
# Single deploy job since we're just deploying # Single deploy job since we're just deploying
build: build:
environment: environment:
name: github-pages name: Slither Documentation
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -34,13 +34,13 @@ jobs:
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4
with: with:
python-version: '3.8' python-version: '3.8'
- run: pip install -e ".[dev]" - run: pip install -e ".[doc]"
- run: pdoc -o docs/ slither '!slither.tools' #TODO fix import errors on pdoc run - run: pdoc -o html/ slither '!slither.tools' #TODO fix import errors on pdoc run
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v1 uses: actions/upload-pages-artifact@v1
with: with:
# Upload the doc # Upload the doc
path: 'docs/' path: './html/'
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
id: deployment id: deployment
uses: actions/deploy-pages@v1 uses: actions/deploy-pages@v1

@ -1,56 +0,0 @@
---
name: Features tests
defaults:
run:
# To load bashrc
shell: bash -ieo pipefail {0}
on:
pull_request:
branches: [master, dev]
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Features tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install ".[dev]"
solc-select use 0.8.0 --always-install
cd tests/test_node_modules/
npm install hardhat
cd ../..
- name: Test with pytest
run: |
pytest tests/test_features.py
pytest tests/test_constant_folding.py
pytest tests/slithir/test_ternary_expressions.py
pytest tests/slithir/test_operation_reads.py
pytest tests/test_functions_ids.py
pytest tests/test_function.py
pytest tests/test_source_mapping.py

@ -1,49 +0,0 @@
---
name: Parser tests
defaults:
run:
# To load bashrc
shell: bash -ieo pipefail {0}
on:
pull_request:
branches: [master, dev]
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Parser tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install ".[dev]"
- name: Install solc
run: |
solc-select install all
solc-select use 0.8.0
- name: Test with pytest
run: |
pytest tests/test_ast_parsing.py -n auto

@ -1,53 +0,0 @@
---
name: Test slither-read-storage
defaults:
run:
# To load bashrc
shell: bash -ieo pipefail {0}
on:
pull_request:
branches: [master, dev]
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Test slither-read-storage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install ganache
run: npm install --global ganache
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install python dependencies
run: |
pip install ".[dev]"
solc-select install 0.8.1
solc-select install 0.8.10
solc-select use 0.8.1
- name: Run slither-read-storage
run: |
pytest tests/test_read_storage.py
- name: Run storage layout tests
run: |
pytest tests/test_storage_layout.py

@ -0,0 +1,107 @@
---
name: Pytest
defaults:
run:
shell: bash
on:
push:
branches: [master, dev]
pull_request:
schedule:
# run CI every day even if no PRs/merges occur
- cron: '0 12 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-2022"]
type: ["unit", "integration", "tool"]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: "pip"
cache-dependency-path: setup.py
- name: Install dependencies
run: |
pip install ".[test]"
solc-select install 0.8.0
solc-select use 0.8.0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Install test dependencies
run: |
if [ ${{ matrix.type }} = "tool" ]; then
# Setup Ganache for slither-read-storage tests.
npm install --global ganache
elif [ ${{ matrix.type }} = "integration" ]; then
# Setup Hardhat for compilation tests.
pushd tests/e2e/compilation/test_data/test_node_modules/ || exit
npm install hardhat
popd || exit
fi
- name: Run ${{ matrix.type }} tests
env:
TEST_TYPE: ${{ matrix.type }}
# Only run coverage on ubuntu-latest.
run: |
if [ ${{ matrix.os }} = "ubuntu-latest" ]; then
TEST_ARGS="--cov=slither --cov-append"
elif [ ${{ matrix.os }} = "windows-2022" ]; then
TEST_ARGS=""
fi
bash "./.github/scripts/${TEST_TYPE}_test_runner.sh" $TEST_ARGS
- name: Upload coverage
uses: ./.github/actions/upload-coverage
# only aggregate test coverage over linux-based tests to avoid any OS-specific filesystem information stored in
# coverage metadata.
if: ${{ matrix.os == 'ubuntu-latest' }}
coverage:
needs:
- tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- run: pip install coverage[toml]
- name: download coverage data
uses: actions/download-artifact@v3.0.2
with:
name: coverage-data
- name: combine coverage data
id: combinecoverage
run: |
set +e
python -m coverage combine
echo "## python coverage" >> $GITHUB_STEP_SUMMARY
python -m coverage report -m --format=markdown >> $GITHUB_STEP_SUMMARY

@ -4,17 +4,17 @@
solc-select use 0.7.0 solc-select use 0.7.0
if ! slither "tests/config/test.sol" --solc-ast --no-fail-pedantic; then if ! slither "tests/e2e/config/test_json_config/test.sol" --solc-ast --no-fail-pedantic; then
echo "--solc-ast failed" echo "--solc-ast failed"
exit 1 exit 1
fi fi
if ! slither "tests/config/test.sol" --solc-disable-warnings --no-fail-pedantic; then if ! slither "tests/e2e/config/test_json_config/test.sol" --solc-disable-warnings --no-fail-pedantic; then
echo "--solc-disable-warnings failed" echo "--solc-disable-warnings failed"
exit 1 exit 1
fi fi
if ! slither "tests/config/test.sol" --disable-color --no-fail-pedantic; then if ! slither "tests/e2e/config/test_json_config/test.sol" --disable-color --no-fail-pedantic; then
echo "--disable-color failed" echo "--disable-color failed"
exit 1 exit 1
fi fi

@ -2,7 +2,7 @@
### Test slither-check-erc ### Test slither-check-erc
DIR_TESTS="tests/check-erc" DIR_TESTS="tests/tools/check-erc"
solc-select use 0.5.0 solc-select use 0.5.0
slither-check-erc "$DIR_TESTS/erc20.sol" ERC20 > test_1.txt 2>&1 slither-check-erc "$DIR_TESTS/erc20.sol" ERC20 > test_1.txt 2>&1

@ -3,7 +3,7 @@
### Test path filtering across POSIX and Windows ### Test path filtering across POSIX and Windows
solc-select use 0.8.0 solc-select use 0.8.0
slither "tests/test_path_filtering/test_path_filtering.sol" --config "tests/test_path_filtering/slither.config.json" > "output.txt" 2>&1 slither "tests/e2e/config/test_path_filtering/test_path_filtering.sol" --config "tests/e2e/config/test_path_filtering/slither.config.json" > "output.txt" 2>&1
if ! grep -q "0 result(s) found" "output.txt" if ! grep -q "0 result(s) found" "output.txt"
then then

@ -2,7 +2,7 @@
### Test printer ### Test printer
cd tests/ast-parsing/compile || exit cd tests/e2e/solc_parsing/test_data/compile/ || exit
# Do not test the evm printer,as it needs a refactoring # Do not test the evm printer,as it needs a refactoring
ALL_PRINTERS="cfg,constructor-calls,contract-summary,data-dependency,echidna,function-id,function-summary,modifiers,call-graph,human-summary,inheritance,inheritance-graph,slithir,slithir-ssa,vars-and-auth,require,variable-order,declaration" ALL_PRINTERS="cfg,constructor-calls,contract-summary,data-dependency,echidna,function-id,function-summary,modifiers,call-graph,human-summary,inheritance,inheritance-graph,slithir,slithir-ssa,vars-and-auth,require,variable-order,declaration"

@ -20,17 +20,25 @@ setup(
"web3>=6.0.0", "web3>=6.0.0",
], ],
extras_require={ extras_require={
"dev": [ "lint": [
"black==22.3.0", "black==22.3.0",
"pylint==2.13.4", "pylint==2.13.4",
],
"test": [
"pytest", "pytest",
"pytest-cov", "pytest-cov",
"pytest-xdist", "pytest-xdist",
"deepdiff", "deepdiff",
"numpy", "numpy",
"openai", "coverage[toml]",
],
"doc": [
"pdoc", "pdoc",
], ],
"dev": [
"slither-analyzer[lint,test,doc]",
"openai",
],
}, },
license="AGPL-3.0", license="AGPL-3.0",
long_description=long_description, long_description=long_description,

@ -1,32 +0,0 @@
[
[
{
"elements": [
{
"type": "other",
"name": "rtlo-character",
"source_mapping": {
"start": 96,
"length": 3,
"filename_relative": "tests/detectors/rtlo/0.4.25/right_to_left_override.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/rtlo/0.4.25/right_to_left_override.sol",
"is_dependency": false,
"lines": [
7
],
"starting_column": 18,
"ending_column": 21
}
}
],
"description": "tests/detectors/rtlo/0.4.25/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n",
"markdown": "tests/detectors/rtlo/0.4.25/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n",
"first_markdown_element": "",
"id": "02545af9e98ed496f7c9e2b2de0f66bcf8e8e31c25a2a2626b5bad92619b1f85",
"check": "rtlo",
"impact": "High",
"confidence": "High"
}
]
]

@ -1,32 +0,0 @@
[
[
{
"elements": [
{
"type": "other",
"name": "rtlo-character",
"source_mapping": {
"start": 96,
"length": 3,
"filename_relative": "tests/detectors/rtlo/0.5.16/right_to_left_override.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/rtlo/0.5.16/right_to_left_override.sol",
"is_dependency": false,
"lines": [
7
],
"starting_column": 18,
"ending_column": 21
}
}
],
"description": "tests/detectors/rtlo/0.5.16/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n",
"markdown": "tests/detectors/rtlo/0.5.16/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n",
"first_markdown_element": "",
"id": "d347f1cb6d791b00f8a6ad65c201eeaa527636f2bf2c5529102441c56e994b33",
"check": "rtlo",
"impact": "High",
"confidence": "High"
}
]
]

@ -1,32 +0,0 @@
[
[
{
"elements": [
{
"type": "other",
"name": "rtlo-character",
"source_mapping": {
"start": 96,
"length": 3,
"filename_relative": "tests/detectors/rtlo/0.6.11/right_to_left_override.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/rtlo/0.6.11/right_to_left_override.sol",
"is_dependency": false,
"lines": [
7
],
"starting_column": 18,
"ending_column": 21
}
}
],
"description": "tests/detectors/rtlo/0.6.11/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n",
"markdown": "tests/detectors/rtlo/0.6.11/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n",
"first_markdown_element": "",
"id": "2cc2fa8e55fae035ed2ebc4798c488d64e92c7c9875fe6699e39103c0b95c264",
"check": "rtlo",
"impact": "High",
"confidence": "High"
}
]
]

@ -1,88 +0,0 @@
[
[
{
"elements": [
{
"type": "other",
"name": "rtlo-character",
"source_mapping": {
"start": 336,
"length": 3,
"filename_relative": "tests/detectors/rtlo/0.8.0/unicode_direction_override.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/rtlo/0.8.0/unicode_direction_override.sol",
"is_dependency": false,
"lines": [
8
],
"starting_column": 14,
"ending_column": 17
}
}
],
"description": "tests/detectors/rtlo/0.8.0/unicode_direction_override.sol contains a unicode right-to-left-override character at byte offset 336:\n\t- b' /*ok \\xe2\\x80\\xaeaaa\\xe2\\x80\\xaebbb\\xe2\\x80\\xaeccc\\xe2\\x80\\xacddd\\xe2\\x80\\xaceee\\xe2\\x80\\xac*/'\n",
"markdown": "tests/detectors/rtlo/0.8.0/unicode_direction_override.sol contains a unicode right-to-left-override character at byte offset 336:\n\t- b' /*ok \\xe2\\x80\\xaeaaa\\xe2\\x80\\xaebbb\\xe2\\x80\\xaeccc\\xe2\\x80\\xacddd\\xe2\\x80\\xaceee\\xe2\\x80\\xac*/'\n",
"first_markdown_element": "",
"id": "2407672dea557be27d0c488ba9c714e6a7f21dd3f7759058e718c1984e142f95",
"check": "rtlo",
"impact": "High",
"confidence": "High"
},
{
"elements": [
{
"type": "other",
"name": "rtlo-character",
"source_mapping": {
"start": 348,
"length": 3,
"filename_relative": "tests/detectors/rtlo/0.8.0/unicode_direction_override.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/rtlo/0.8.0/unicode_direction_override.sol",
"is_dependency": false,
"lines": [
8
],
"starting_column": 26,
"ending_column": 29
}
}
],
"description": "tests/detectors/rtlo/0.8.0/unicode_direction_override.sol contains a unicode right-to-left-override character at byte offset 348:\n\t- b'\\x80\\xaebbb\\xe2\\x80\\xaeccc\\xe2\\x80\\xacddd\\xe2\\x80\\xaceee\\xe2\\x80\\xac*/'\n",
"markdown": "tests/detectors/rtlo/0.8.0/unicode_direction_override.sol contains a unicode right-to-left-override character at byte offset 348:\n\t- b'\\x80\\xaebbb\\xe2\\x80\\xaeccc\\xe2\\x80\\xacddd\\xe2\\x80\\xaceee\\xe2\\x80\\xac*/'\n",
"first_markdown_element": "",
"id": "477e54031d4d30d485b9cdc2d7ef3e9ae3de52640364505df8eb9619c2bcde6b",
"check": "rtlo",
"impact": "High",
"confidence": "High"
},
{
"elements": [
{
"type": "other",
"name": "rtlo-character",
"source_mapping": {
"start": 342,
"length": 3,
"filename_relative": "tests/detectors/rtlo/0.8.0/unicode_direction_override.sol",
"filename_absolute": "/GENERIC_PATH",
"filename_short": "tests/detectors/rtlo/0.8.0/unicode_direction_override.sol",
"is_dependency": false,
"lines": [
8
],
"starting_column": 20,
"ending_column": 23
}
}
],
"description": "tests/detectors/rtlo/0.8.0/unicode_direction_override.sol contains a unicode right-to-left-override character at byte offset 342:\n\t- b'\\x80\\xaeaaa\\xe2\\x80\\xaebbb\\xe2\\x80\\xaeccc\\xe2\\x80\\xacddd\\xe2\\x80\\xaceee\\xe2\\x80\\xac*/'\n",
"markdown": "tests/detectors/rtlo/0.8.0/unicode_direction_override.sol contains a unicode right-to-left-override character at byte offset 342:\n\t- b'\\x80\\xaeaaa\\xe2\\x80\\xaebbb\\xe2\\x80\\xaeccc\\xe2\\x80\\xacddd\\xe2\\x80\\xaceee\\xe2\\x80\\xac*/'\n",
"first_markdown_element": "",
"id": "9dd23585bb0ff1f244f749281b27f62978e0bb5b0ae58c8c9cb6d3f9c7e82253",
"check": "rtlo",
"impact": "High",
"confidence": "High"
}
]
]

@ -0,0 +1,3 @@
artifacts/
cache/
node_modules/

@ -1,6 +1,6 @@
module.exports = { module.exports = {
solidity: { solidity: {
version: "0.8.0" version: "0.8.1"
}, },
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save