mythx_cli.payload package¶
mythx_cli.payload.bytecode¶
This module contains functions to generate bytecode-only analysis request payloads.
mythx_cli.payload.solidity¶
This module contains functions to generate Solidity-related payloads.
-
mythx_cli.payload.solidity.
generate_solidity_payload
(file, version)[source]¶ Generate a MythX analysis request from a given Solidity file.
This function will open the file, try to detect the used solc version from the pragma definition, and automatically compile it. If the given solc version is not installed on the client’s system, it will be automatically downloaded.
From the solc output, the following data is sent to the MythX API for analysis:
abi
ast
bin
bin-runtime
srcmap
srcmap-runtime
Parameters: file – The path pointing towards the Solidity file Returns: The payload dictionary to be sent to MythX
mythx_cli.payload.truffle¶
This module contains functions to generate payloads for Truffle projects.
-
mythx_cli.payload.truffle.
generate_truffle_payload
(file)[source]¶ Generate a MythX analysis request payload based on a truffle build artifact.
This will send the following artifact entries to MythX for analysis:
contractName
bytecode
deployedBytecode
sourceMap
deployedSourceMap
sourcePath
source
ast
legacyAST
- the compiler version
Parameters: file – The path to the Truffle build artifact Returns: The payload dictionary to be sent to MythX