cleanunicorn / mythos

CLI client for the MythX API
https://mythx.io/
20 stars 6 forks source link

Cannot read property 'Root.sol' of undefined #5

Closed shayanb closed 5 years ago

shayanb commented 5 years ago
🍺  mythos analyze Root.sol Root
Reading contract Root.sol... done
Downloading Solidity version latest... done
Analyzing contract Root... !
TypeError: Cannot read property 'Root.sol' of undefined
    at Scanner.run (~/.nvm/versions/node/v11.11.0/lib/node_modules/@cleanunicorn/mythos/lib/scanner.js:17:42)
    at Analyze.run (~/.nvm/versions/node/v11.11.0/lib/node_modules/@cleanunicorn/mythos/lib/commands/analyze.js:41:36)

(╯°□°)╯︵ ┻━┻

cleanunicorn commented 5 years ago

This happens because of an incorrect solidity version (it tried with the latest one). When it doesn't have the right solidity version it crashes with no real error message. Make sure to specify the solc version with --solcVersion=v0.5.3+commit.10d17f24.

Use the version listed in https://ethereum.github.io/solc-bin/bin/list.txt

I need to find an easy way to automatically detect solidity version.

Example

$ mythos analyze Root.sol Root --solcVersion=v0.4.25+commit.59dbf8f1.js
cleanunicorn commented 5 years ago

Fixed by https://github.com/cleanunicorn/mythos/pull/6

It displays errors found on compilation and stops if it finds any errors.

Also it tries to identify the Solidity version automatically and it's easier to specify the Solidity version.