[Bug-Candidate]: Error flattering the contract
- Dominant language
- Python
- Stars
- 6.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the issue:
```
Traceback (most recent call last):
File "/usr/local/bin/slither-flat", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.10/dist-packages/slither/tools/flattening/__main__.py", line 116, in main
flat = Flattening(
File "/usr/local/lib/python3.10/dist-packages/slither/tools/flattening/flattening.py", line 76, in __init__
self._get_source_code(contract)
File "/usr/local/lib/python3.10/dist-packages/slither/tools/flattening/flattening.py", line 222, in _get_source_code
content[:index].decode("utf8")
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
```
### Source location
- https://github.com/crytic/slither/blob/dac531400a2574b8acfcf11967375727a08f49ad/slither/tools/flattening/flattening.py#L222
### Code example to reproduce the issue:
> slither-flat path --strategy OneFile --convert-external --dir outPath
### Version:
FROM ghcr.io/trailofbits/eth-security-toolbox/ci@sha256:dddfd40e9f055b6f092b0711d5827ebd0d9beb30aaadbd8c8d51d89bdba37442
Contributor guide
Assessment
This issue has not been assessed yet.