mythx_cli package

mythx_cli.cli

The main runtime of the MythX CLI.

mythx_cli.cli.find_solidity_files(project_dir)[source]

Return all Solidity files in the given directory.

This will match all files with the .sol extension.

Parameters:project_dir – The directory to search in
Returns:Solidity files in project_dir or None
mythx_cli.cli.find_truffle_artifacts(project_dir)[source]

Look for a Truffle build folder and return all relevant JSON artifacts.

This function will skip the Migrations.json file and return all other files under <project-dir>/build/contracts/. If no files were found, None is returned.

Parameters:project_dir – The base directory of the Truffle project
Returns:Files under <project-dir>/build/contracts/ or None

mythx_cli.util

Utility functions for handling API requests and responses.

mythx_cli.util.get_source_location_by_offset(source, offset)[source]

Retrieve the Solidity source code location based on the source map offset.

Parameters:
  • source – The Solidity source to analyze
  • offset – The source map’s offset
Returns:

The line number