MyCrypto is an open-source, client-side tool for generating ether wallets, handling ERC-20 tokens, and interacting with the blockchain more easily.
Clone or download
Latest commit 094ac81 Oct 15, 2018
Permalink
Failed to load latest commit information.
.github Contributor Guidelines (#1054) Feb 12, 2018
common Revert public ENS fix changes Oct 15, 2018
electron-app MC-01-004: Prevent Navigation on Main Electron Window (#2022) Jul 6, 2018
jenkins Jenkins - use yarn for building (#2067) Jul 14, 2018
jest_config Electron Ledger + Trezor Support (#1836) Jun 15, 2018
scripts Create script to update tokens list from ethereum-lists/tokens (#1247) Apr 13, 2018
shared Add Ether-1 Sep 15, 2018
spec Merge branch 'develop' of https://github.com/MyCryptoHQ/MyCrypto into… Aug 29, 2018
static Sitemap (#2008) Jul 6, 2018
travis-scripts Refactor redux pattern from top-level to ducks (#1936) Jun 18, 2018
webpack_config MC-01-003: Add CSP to Meta Tag (#2019) Jul 6, 2018
.drawbridgerc Add Drawbridge Prod Config (#1801) May 15, 2018
.editorconfig Fix editor config (#1458) Apr 6, 2018
.gitattributes Newline at end of file Aug 30, 2018
.gitignore Mnemonic Redesign (#1501) Apr 13, 2018
.npmrc Update dependencies to enable Greenkeeper 🌴 (#344) Nov 7, 2017
.nvmrc Update Readme, bump nvmrc (#954) Jan 29, 2018
.prettierignore Translation Updates (#1323) Mar 22, 2018
.prettierrc Ensure CI fails on non-prettier compliant PRs (#693) Jan 1, 2018
.travis.yml Refactor redux pattern from top-level to ducks (#1936) Jun 18, 2018
LICENSE MyEtherWallet -> MyCrypto (#977) Feb 7, 2018
README.md Update README.md Sep 25, 2018
package.json Release 1.4.0.1 Oct 10, 2018
tsconfig.json TS Improvements (#1676) May 21, 2018
tslint.json MEW-01-005 Web - Remove all HTTP links (#978) Feb 1, 2018
yarn.lock Revert changes to ETH token config Oct 15, 2018

README.md

MyCrypto Web & Desktop Apps

Coverage Status

Requirements

  • Node 8.9.4*
  • Yarn >= 1.7.0**
  • Python 2.7.X***

*Higher versions should work fine, but may cause inconsistencies. It's suggested you run 8.9.4 using nvm.
**npm is NOT supported for package management. MyCrypto uses yarn.lock to ensure sub-dependency versions are pinned, so yarn is required to install node_modules
***Python 3 is not supported, since our dependencies use node-gyp.
***For users trying to build with WSL, you'll need to have install libpng via sudo apt-get install libpng16-dev.

Running the App

After yarning all dependencies you can run various commands depending on what you want to do:

Development

# run app in dev mode in browser, rebuild on file changes
yarn dev
# run app in dev mode in electron, rebuild on file changes
yarn dev:electron

Build Releases

# builds the production server app
yarn build
# builds the downloadable version of the site
yarn build:downloadable
# builds the electron apps
yarn build:electron

# builds only one OS's electron app
yarn build:electron:(osx|linux|windows)

All of these builds are output to a folder in dist/.

Unit Tests:

# run unit tests with Jest
yarn test

Integration Tests:

# run integration tests with Jest
yarn test:int

Dev (HTTPS):

Some parts of the site, such as the Ledger wallet, require an HTTPS environment to work. To develop on HTTPS, do the following:

  1. Create your own SSL Certificate (Heroku has a nice guide here)
  2. Move the .key and .crt files into webpack_config/server.*
  3. Run the following command:
yarn dev:https

Address Derivation Checker:

EthereumJS-Util previously contained a bug that would incorrectly derive addresses from private keys with a 1/128 probability of occurring. A summary of this issue can be found here.

As a reactionary measure, the address derivation checker was created.

To test for correct address derivation, the address derivation checker uses multiple sources of address derivation (EthereumJS and PyEthereum) to ensure that multiple official implementations derive the same address for any given private key.

The derivation checker utility assumes that you have:
  1. Docker installed/available
  2. dternyak/eth-priv-to-addr pulled from DockerHub
Docker setup instructions:
  1. Install docker (on macOS, Docker for Mac is suggested)
  2. docker pull dternyak/eth-priv-to-addr
Run Derivation Checker

The derivation checker utility runs as part of the integration test suite.

yarn test:int

Folder structure:

β”‚
β”œβ”€β”€ common
β”‚   β”œβ”€β”€ api - Services and XHR utils
β”‚   β”œβ”€β”€ assets - Images, fonts, etc.
β”‚   β”œβ”€β”€ components - Components according to "Redux philosophy"
β”‚   β”œβ”€β”€ config - Various config data and hard-coded json
β”‚   β”œβ”€β”€ containers - Containers according to "Redux philosophy"
|   β”œβ”€β”€ features - State management and async operations, organized per "feature", follows "ducks" philosophy, see: https://github.com/MyCryptoHQ/MyCrypto/issues/1435
β”‚   β”œβ”€β”€ libs - Framework-agnostic libraries and business logic
|       β”œβ”€β”€ contracts - Takes in a contract interface ABI and returns an object with keys equivalent to the ABI function names that each have `.encodeInput`,  `.decodeInput`, `decodeOutput` methods. 
|       β”œβ”€β”€ ens - Basic ENS functions for getting a name hash and mapping returned ENS contract values to human-readable strings
|       β”œβ”€β”€ nodes - Configures Shepherd (https://github.com/MyCryptoHQ/shepherd) and exports a singleton provider
|       β”œβ”€β”€ scheduling - Functionality for enabling Ethereum Alarm Clock usage for scheduled transactions. See https://github.com/MyCryptoHQ/MyCrypto/pull/1343
|       β”œβ”€β”€ transaction - Utilities for signing / parsing / validating transactions
|       β”œβ”€β”€ wallet - Wallet implementations for deterministic (hw wallets, mnemonic wallets, etc), and non-deterministic (web3, parity signer, etc.) wallets.
|       β”œβ”€β”€ web-workers - Web-worker implementation of generateKeystore + fromV3 for non-blocking encrypt/decryption
|       β”œβ”€β”€ erc20 - `libs/contracts` instance of erc20 abi
|       β”œβ”€β”€ formatters - Hex string formatters
|       β”œβ”€β”€ signing - Message signing and signature verification
|       β”œβ”€β”€ units - Helper functions for working with Ethereum / Token units in both base and unit form. Use these instead of using bn.js directly
|       β”œβ”€β”€ validators - Validation functions for addresses, hex strings, keys, numbers, derivation paths, EAC values, Ethereum values, etc.
|       β”œβ”€β”€ values - Functions for building EIP681 requests, numberical sanitization, string padding, bn.js conversion
β”‚   β”œβ”€β”€ sass - SCSS styles, variables, mixins
β”‚   β”œβ”€β”€ translations - Language JSON dictionaries
β”‚   β”œβ”€β”€ typescript - Typescript definition files
β”‚   β”œβ”€β”€ utils - Common use utility functions
β”‚   β”œβ”€β”€ index.tsx - Entry point for app
β”‚   β”œβ”€β”€ index.html - Html template file for html-webpack-plugin
β”‚   β”œβ”€β”€ Root.tsx - Root component for React
β”œβ”€β”€ electron-app - Code for the native electron app
β”œβ”€β”€ jest_config - Jest testing configuration
β”œβ”€β”€ spec - Jest unit tests, mirror's common's structure
β”œβ”€β”€ static - Files that don't get compiled, just moved to build
└── webpack_config - Webpack configuration

Typescript Resources:

More information is available on the Wiki Pages

Thanks & Support

Cross browser testing and debugging provided by the very lovely team at BrowserStack.