crytic / crytic/slither

Running slither-check-erc formats temporary downloaded contract with bad syntax

Open
#699 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

The following

`slither-check-erc 0xd82bb924a1707950903e2c0a619824024e254cd1 Vault.sol --erc ERC20`

fails with

```
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/slither-check-erc", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/slither/tools/erc_conformance/__main__.py", line 75, in main
slither = Slither(args.project, **vars(args))
File "/usr/local/lib/python3.8/site-packages/slither/slither.py", line 79, in __init__
raise SlitherError(f"Invalid compilation: \n{str(e)}")
slither.exceptions.SlitherError: Invalid compilation:
Invalid solc compilation Error: Expected pragma, import directive or contract/interface/library/struct/enum definition.
--> crytic-export/etherscan_contracts/0xd82bb924a1707950903e2c0a619824024e254cd1-Vault.sol:1:1:
|
1 | {{
| ^
```

When looking at the downloaded source I see this indeed starts with `{{`:

```
{{
"language": "Solidity",
"sources": {
"contracts/Vault.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma experimental ABIEncoderV2;\npragma solidity ^0.6.8;\n\nimport \"@nomiclabs/buidler/console.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";
```

We run a script that performs the above validation call for ERC20 compliance against a number of tokens, and the above error surfaces in a few other contracts than the address provided above. You can see the full report here https://circleci.com/api/v1.1/project/github/argentlabs/argent-contracts/1787/output/106/0?file=true&allocation-id=5fb866ac404b7b5bf6eac1a6-0-build%2F3F0744F1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.