Usage

Truffle Security is being deprecated and will not be maintained after July 15 2020. You should now use the MythX CLI, which also has full support for Truffle projects. Learn more at: https://github.com/dmuhs/mythx-cli.

Analysing an entire project

To run MythX for Truffle, run the following command in the root of your configured Truffle project:

truffle run verify

The project must compile successfully in order for the plugin to run. If the project hasn’t been compiled yet, MythX for Truffle will try to compile it first.

Analysing whole contract files

By default, all contracts in all contract files in the project will be analysed. To analyse only a single contract file, use the following syntax:

truffle run verify contract.sol

This will analyze all the contracts found in the file contract.sol.

Multiple contract files can be specified here as well:

truffle run verify contract1.sol contract2.sol

All contracts inside both contract1.sol and contract2.sol will be analyzed.

Analysing specific contracts

You can also analyse a specific contract:

truffle run verify contract.sol:MyContract

This will analyse the contract named MyContract found in the file contract.sol.

Multiple contracts can be specified here too. For example:

truffle run verify contract1.sol:MyContract1 contract2.sol:MyContract2

This will analyse both MyContract1 and MyContract2, which are found in the contract1.sol and contract2.sol files respectively.

The following syntax has been deprecated and should not be used:

truffle run verify MyContract

Last updated