Skip to content

Commit 7e9d7a1

Browse files
authored
Merge pull request #6 from emizzle/fix/remove-trial-credentials
fix: Remove trial credentials and update MYTHX_ETH_ADDRESS to MYTHX_USERNAME
2 parents fea9805 + 6adf8c6 commit 7e9d7a1

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@ This plugin brings MythX to Status Embark. Simply call `verify` from the Embark
99

1010
## QuickStart
1111

12-
1. Create a `.env` file in the root of your project and provide your MythX login information. If omitted, MythX will run in trial mode.
12+
1. Create a `.env` file in the root of your project and provide your MythX login information. Free MythX accounts can be created at https://dashboard.mythx.io/#/registration.
1313

1414
```json
15-
MYTHX_ETH_ADDRESS="<mythx-address>"
15+
MYTHX_USERNAME="<mythx-username>"
1616
MYTHX_PASSWORD="<password>"
1717
```
1818

19+
> **NOTE:** `MYTHX_ETH_ADDRESS` in favour of `MYTHX_USERNAME` and will be removed in future versions. Please update your .env file or your environment variables accordingly.
20+
21+
`MYTHX_USERNAME` may be either of:
22+
* MythX User ID (assigned by MythX API to any registered user);
23+
* Ethereum address, if user account is associated with an address;
24+
* 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.
25+
26+
For more information, please see the [MythX API Login documentation](https://api.mythx.io/v1/openapi#operation/login).
27+
1928
2. Run `verify [options] [contracts]` in the Embark console. When the call returns, it will look something like this:
2029

2130
```bash

mythx.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,21 @@ async function analyse(contracts, cfg, embark) {
2525
return 1
2626
}
2727

28+
if (process.env.MYTHX_ETH_ADDRESS) {
29+
process.env.MYTHX_USERNAME = process.env.MYTHX_ETH_ADDRESS;
30+
embark.logger.warn("The environment variable MYTHX_ETH_ADDRESS in favour of MYTHX_USERNAME and will be removed in future versions. Please update your .env file or your environment variables accordingly.");
31+
}
32+
2833
// Connect to MythX via armlet
29-
if(!process.env.MYTHX_ETH_ADDRESS || !process.env.MYTHX_PASSWORD) {
30-
embark.logger.error("Environment variables 'MYTHX_ETH_ADDRESS' and 'MYTHX_PASSWORD' not found. Continuing in evaluation mode.")
31-
process.env.MYTHX_ETH_ADDRESS = "0x0000000000000000000000000000000000000000"
32-
process.env.MYTHX_PASSWORD = "trial"
34+
if(!process.env.MYTHX_USERNAME || !process.env.MYTHX_PASSWORD) {
35+
throw new Error("Environment variables 'MYTHX_USERNAME' and 'MYTHX_PASSWORD' not found. Place these in a .env file in the root of your &ETH;App, add them in the CLI command, ie 'MYTHX_USERNAME=xyz MYTHX_PASSWORD=123 embark run', or add them to your system's environment variables.");
3336
}
3437

3538
const armletClient = new armlet.Client(
3639
{
3740
clientToolName: "embark-mythx",
3841
password: process.env.MYTHX_PASSWORD,
39-
ethAddress: process.env.MYTHX_ETH_ADDRESS,
42+
ethAddress: process.env.MYTHX_USERNAME,
4043
})
4144

4245
// Filter contracts based on parameter choice
@@ -85,7 +88,7 @@ async function getStatus(uuid, embark) {
8588
{
8689
clientToolName: "embark-mythx",
8790
password: process.env.MYTHX_PASSWORD,
88-
ethAddress: process.env.MYTHX_ETH_ADDRESS,
91+
ethAddress: process.env.MYTHX_USERNAME,
8992
})
9093

9194
try {

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "embark-mythx",
3-
"version": "1.0.2",
3+
"version": "1.0.4",
44
"description": "MythX plugin for Status Embark",
55
"repository": "github:flex-dapps/embark-mythx",
66
"main": "index.js",

0 commit comments

Comments
 (0)