2019-04-29 10:28:44 +02:00
![Running MythX analyses in Status Embark ](https://cdn-images-1.medium.com/max/960/1*7jwHRc5J152bz704Fg7iug.png )
2019-04-26 18:28:51 +02:00
# Status Embark plugin for MythX.
2019-04-22 21:15:40 +02:00
2019-04-26 17:47:02 +02:00
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 `truffle-security` and uses its source mapping and reporting functions.
2019-04-26 18:26:30 +02:00
## QuickStart
2019-04-22 21:15:40 +02:00
2019-04-26 17:47:02 +02:00
0. Create a `.env` file in the root of your project and provide your MythX login information. If omitted, MythX will run in trial mode.
2019-04-26 17:28:30 +02:00
2019-04-26 18:28:51 +02:00
```json
2019-04-26 17:28:30 +02:00
MYTHX_ETH_ADDRESS="< mythx-address > "
MYTHX_PASSWORD="< password > "
```
1. Run `verify [options] [contracts]` in the Embark console. When the call returns, it will look something like this:
2019-04-22 21:15:40 +02:00
2019-04-26 18:28:51 +02:00
```bash
2019-04-22 21:15:40 +02:00
Embark (development) > verify
embark-mythx: Running MythX analysis in background.
embark-mythx: Submitting 'ERC20' for analysis...
embark-mythx: Submitting 'SafeMath' for analysis...
embark-mythx: Submitting 'Ownable' for analysis...
embark-mythx:
/home/flex/mythx-plugin/testToken/.embark/contracts/ERC20.sol
1:0 warning A floating pragma is set SWC-103
✖ 1 problem (0 errors, 1 warning)
embark-mythx: MythX analysis found vulnerabilities.
```
2019-04-26 18:26:30 +02:00
## Installation
2019-04-22 23:22:15 +02:00
2019-04-29 10:31:21 +02:00
Add `embark-mythx` to the `plugins` section of your `embark.json` file. To have the plugin permanently ignore one or multiple contracts, add them to the configuration:
2019-04-22 23:22:15 +02:00
2019-04-26 18:28:51 +02:00
```json
2019-04-22 23:22:15 +02:00
"plugins": {
"embark-mythx": {
"ignore": ["Ownable", "Migrations"]
}
}
```
2019-04-26 18:26:30 +02:00
## Usage
2019-04-22 23:46:52 +02:00
2019-04-26 18:28:51 +02:00
```bash
2019-04-26 17:47:02 +02:00
verify [--full] [--debug] [--no-cache-lookup] [--limit] [--initial-delay] [< contracts > ]
verify status < uuid >
verify help
Options:
2019-04-29 11:44:42 +02:00
--full, -f Perform full instead of quick analysis.
--debug, -d Additional debug output.
--no-cache-lookup, -c Skip MythX-side cache lookup of report.
--limit, -l Maximum number of concurrent analyses.
--initial-delay, -i Time in seconds before first analysis status check.
2019-04-26 17:47:02 +02:00
[< contracts > ] List of contracts to submit for analysis (default: all).
status < uuid > Retrieve analysis status for given MythX UUID.
help This help.
2019-04-26 18:26:30 +02:00
```
### Example Usage
2019-04-26 18:28:51 +02:00
```bash
2019-04-26 18:26:30 +02:00
# Quick analysis on all contracts in project
> verify
# 'ERC20' and 'Ownable' full analysis
> verify ERC20 Ownable --full
2019-04-29 10:31:21 +02:00
# Check status of previous or ongoing analysis
2019-04-26 18:26:30 +02:00
> verify status ef5bb083-c57a-41b0-97c1-c14a54617812
2019-04-26 17:47:02 +02:00
```