Status Embark plugin for MythX
This plugin brings MythX to Status Embark. Simply call verify from the Embark console and embark-mythx sends your contracts off for analysis. It is inspired by sabre and uses its source mapping and reporting functions.
This project was bootstrapped with TSDX.
- Create a
.envfile in the root of your project and provide your MythX API Key. Free MythX accounts can be created at https://dashboard.mythx.io/#/registration. Once an account is created, generate an API key at https://dashboard.mythx.io/#/console/tools.
MYTHX_ETH_ADDRESShas been deprecated in favour of
MYTHX_USERNAMEand will be removed in future versions. As of version 2.0,
MYTHX_API_KEYis also required. Please update your .env file or your environment variables accordingly.
MYTHX_USERNAME may be either of:
- MythX User ID (assigned by MythX API to any registered user);
- Ethereum address, if user account is associated with an address;
- A verified email address, if the user account is associated with an email address, and that address has been verified by visiting the verification link in the verification email sent by the MythX API each time when user email is set or modified in the MythX settings.
For more information, please see the MythX API Login documentation.
verify [options] [contracts]in the Embark console. When the call returns, it will look something like this:
Embark > verifyAuthenticating MythX user...Running MythX analysis...Analysis job submitted: https://dashboard.mythx.io/#/console/analyses/9a294be9-8656-416a-afbc-06cb299f5319Analyzing Bank in quick mode...Analysis job submitted: https://dashboard.mythx.io/#/console/analyses/0741a098-6b81-43dc-af06-0416eda2a076Analyzing Hack in quick mode...Retrieving Bank analysis results...Retrieving Hack analysis results...Rendering Bank analysis report...Bank.sol18:12 error persistent state read after call https://swcregistry.io/docs/SWC-10714:28 warning A call to a user-supplied address is executed https://swcregistry.io/docs/SWC-1071:0 warning A floating pragma is set https://swcregistry.io/docs/SWC-103✖ 3 problemsRendering Hack analysis report...Hack.sol1:0 warning A floating pragma is set https://swcregistry.io/SWC-registry/docs/SWC-103✖ 1 problemDone!
- Install this plugin from the root of your Embark project:
$ npm i embark-mythx# or$ npm i flex-dapps/embark-mythx
pluginssection of your
embark.jsonfile. To have the plugin permanently ignore one or multiple contracts, add them to the configuration:
The following usage guide can also be obtained by running
verify help in the Embark console.
Available Commandsverify <options> [contracts] Runs MythX verification. If array of contracts are specified, only those contracts will be analysed.verify report [--format] uuid Get the report of a completed analysis.verify status uuid Get the status of an already submitted analysis.verify list Displays a list of the last 20 submitted analyses in a table.verify help Display this usage guide.Examplesverify --mode full SimpleStorage ERC20 Runs a full MythX verification
# Quick analysis on all contracts in project$ verify# 'ERC20' and 'Ownable' full analysis$ verify --mode full ERC20 Ownable# Check status of previous or ongoing analysis$ verify status ef5bb083-c57a-41b0-97c1-c14a54617812# Get list of 20 previous analyses$ verify list
Contributions are very welcome! If you'd like to contribute, the following commands will help you get up and running. The library was built using TSDX, so these commands are specific to TSDX.
npm run start or
Runs the project in development/watch mode.
embark-mythx will be rebuilt upon changes. TSDX has a special logger for you convenience. Error messages are pretty printed and formatted for compatibility VS Code's Problems tab.
Your library will be rebuilt if you make edits.
npm run build or
Bundles the package to the
The package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module).
npm test or
Runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit.