-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
KeyError: 'function' when running Slither 0.9.3 for static analysis
Description
I'm encountering a persistent KeyError: 'function' when running Slither 0.9.3 for static analysis on Solidity smart contracts as part of the ScType tool. Notably, this error doesn't occur within the Docker environment where Slither runs successfully. The error persists across various contracts, unrelated to specific code patterns. I'm also able to reproduce the issue with the Benchmarks folder from the ScType_data repository, with all projects analysed successfully, issues only begin to arise when I attempt to analyse my own contracts after building from source.
Environment
- OS: Ubuntu 22.04
- Slither Version: 0.9.3 (As required by
setup.py, downgraded from 0.10.1 current build) - Solidity Compiler (solc): 0.8.21
- Python Version: 3.10
- Execution Context: Git clone and building from source, then attempting to run my own code/data against the tool, contrasting with Docker where the issue doesn't reproduce.
Key Observations
- Docker Success: The analysis runs without errors in a Docker environment, including benchmarks and scripts (e.g.,
.shfiles) from the Sc-Type project. - Local Failure: The same operations outside Docker, directly on the system, result in a
KeyError: 'function'during the analysis phase. - Version Downgrade for SCType: Slither was downgraded to 0.9.3 specifically for Sc-Type compatibility as noted in the setup.py, suggesting potential version-related compatibility issues.
Reproduction Steps
- Downgrade Slither to 0.9.3.
- Set
solcto 0.8.21. (0.8.21 itself, is purely coincidental. My contracts use this version for compilation) - Run slither --detect tcheck command on a contract, triggering the
KeyError: 'function'.
Attempted Solutions
- Confirmed environment versions align with Sc-Type's requirements.
- Forge & Bun both build/compile the contracts successfully, hinting the issue isn't within the contracts themselves but somewhere along the analysis level.
- Isolated issue occurrence to system installations outside of Docker.
- Reviewed Slither and ScType documentation for compatibility insights without clear resolutions.
Request for Insight
- Any known compatibility issues between Slither 0.9.3, Solidity 0.8.21, and the Sc-Type integration that could lead to this
KeyError? - Differences in Slither's behavior outside Docker that might contribute to this issue?
- Suggestions for bridging this gap between Docker success and local failure in the analysis process?
Appreciate any guidance or solution for addressing this issue, I enjoyed your paper and found it well written with a lot of potential usefulness. Thank you.
Terminal Output with Slither 0.10.1
Terminal Output with Slither 0.9.3
Metadata
Metadata
Assignees
Labels
No labels


