cleanunicorn / mythos

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

[BUG] Error: Cannot use 'in' operator to search for #36

Closed sjukeshov closed 5 years ago

sjukeshov commented 5 years ago

Describe the bug Error: Cannot use 'in' operator to search for

To Reproduce Steps to reproduce the behavior:

  1. https://github.com/ConsenSys/truffle-webpack-demo/blob/master/contracts/ConvertLib.sol
  2. mythos analyze contracts/ConvertLib.sol ConvertLib
  3. Error generated › Error: Cannot use 'in' operator to search for 'ConvertLib' in undefined

Expected behavior Provide found issues, there should be SWC-103 at least

Console output

mythos analyze contracts/ConvertLib.sol ConvertLib
Reading contract contracts/ConvertLib.sol... done
Compiling with Solidity version: v0.4.0+commit.acd334c9
 ›   Error: Cannot use 'in' operator to search for 'ConvertLib' in undefined
Compiling contract contracts/ConvertLib.sol... failed

Context information

Additional context MYTHX_ETH_ADDRESS and MYTHX_PASSWORD were exported with correct credentials

cleanunicorn commented 5 years ago

I wasn't able to compile this locally with solc. It works if you specify the solidity version, for example it works with:

pragma solidity 0.5.8;
library Lib{}
cleanunicorn commented 5 years ago

It needs to find a contract, not only a library in the source code.