diff --git a/README.md b/README.md
index 6ac5afd071..ba3d57c3c3 100644
--- a/README.md
+++ b/README.md
@@ -57,11 +57,11 @@ To build for standalone use in the browser, install `browserify` and check [run-
## VM
-For documentation on `VM` instantiation, exposed API and emitted `events` see generated [API docs](./docs/index.md).
+For documentation on `VM` instantiation, exposed API and emitted `events` see generated [API docs](./docs/README.md).
## StateManger
-The API for the `StateManager` is currently in `Beta`, separate documentation can be found [here](./docs/stateManager.md), see also [release notes](https://github.com/ethereumjs/ethereumjs-vm/releases/tag/v2.5.0) from the `v2.5.0` VM release for details on the `StateManager` rewrite.
+The API for the `StateManager` is currently in `Beta`, separate documentation can be found [here](./docs/classes/statemanager.md), see also [release notes](https://github.com/ethereumjs/ethereumjs-vm/releases/tag/v2.5.0) from the `v2.5.0` VM release for details on the `StateManager` rewrite.
# Internal Structure
@@ -98,7 +98,7 @@ The opFns for `CREATE`, `CALL`, and `CALLCODE` call back up to `runCall`.
# DEVELOPMENT
-Developer documentation - currently mainly with information on testing and debugging - can be found [here](./docs/developer.md).
+Developer documentation - currently mainly with information on testing and debugging - can be found [here](./developer.md).
# EthereumJS
diff --git a/docs/developer.md b/developer.md
similarity index 59%
rename from docs/developer.md
rename to developer.md
index b59ec9f9a1..fb07f073bd 100644
--- a/docs/developer.md
+++ b/developer.md
@@ -4,7 +4,7 @@
### Running Tests
-Tests can be found in the ``tests`` directory, with ``FORK_CONFIG`` set in ``tests/tester.js``. There are test runners for [State tests](http://www.ethdocs.org/en/latest/contracts-and-transactions/ethereum-tests/state_tests/index.html) and [Blockchain tests](http://www.ethdocs.org/en/latest/contracts-and-transactions/ethereum-tests/blockchain_tests/index.html). VM tests are disabled since Frontier gas costs are not supported any more. Tests are then executed by the [ethereumjs-testing](https://github.com/ethereumjs/ethereumjs-testing) utility library using the official client-independent [Ethereum tests](https://github.com/ethereum/tests).
+Tests can be found in the `tests` directory, with `FORK_CONFIG` set in `tests/tester.js`. There are test runners for [State tests](http://www.ethdocs.org/en/latest/contracts-and-transactions/ethereum-tests/state_tests/index.html) and [Blockchain tests](http://www.ethdocs.org/en/latest/contracts-and-transactions/ethereum-tests/blockchain_tests/index.html). VM tests are disabled since Frontier gas costs are not supported any more. Tests are then executed by the [ethereumjs-testing](https://github.com/ethereumjs/ethereumjs-testing) utility library using the official client-independent [Ethereum tests](https://github.com/ethereum/tests).
For a wider picture about how to use tests to implement EIPs you can have a look at this [reddit post](https://www.reddit.com/r/ethereum/comments/6kc5g3/ethereumjs_team_is_seeking_contributors/)
or the associated YouTube video introduction to [core development with Ethereumjs-vm](https://www.youtube.com/watch?v=L0BVDl6HZzk&feature=youtu.be).
@@ -19,8 +19,8 @@ Running the Blockchain tests:
`node ./tests/tester -b`
-State tests and Blockchain tests can also be run against the ``dist`` folder (default: ``lib``):
-
+State tests and Blockchain tests can also be run against the `dist` folder (default: `lib`):
+
`node ./tests/tester -b --dist`
State tests run significantly faster than Blockchain tests, so it is often a good choice to start fixing State tests.
@@ -39,13 +39,13 @@ Running a specific state test case:
`node ./tests/tester -s --test='stackOverflow'`
-Only run test cases with selected ``data``, ``gas`` and/or ``value`` values (see
-[attribute description](http://ethereum-tests.readthedocs.io/en/latest/test_types/state_tests.html) in
-test docs), provided by the index of the array element in the test ``transaction`` section:
+Only run test cases with selected `data`, `gas` and/or `value` values (see
+[attribute description](http://ethereum-tests.readthedocs.io/en/latest/test_types/state_tests.html) in
+test docs), provided by the index of the array element in the test `transaction` section:
`node tests/tester -s --test='CreateCollisionToEmpty' --data=0 --gas=1 --value=0`
-Run a state test from a specified source file not under the ``tests`` directory:
+Run a state test from a specified source file not under the `tests` directory:
`node ./tests/tester -s --customStateTest='{path_to_file}'`
#### Running tests with a reporter/formatter
@@ -67,15 +67,15 @@ The `-with` flag allows the specification of a formatter of your choosing:
#### Skipping Tests
-There are three types of skip lists (``BROKEN``, ``PERMANENT`` and ``SLOW``) which
-can be found in ``tests/tester.js``. By default tests from all skip lists are omitted.
+There are three types of skip lists (`BROKEN`, `PERMANENT` and `SLOW`) which
+can be found in `tests/tester.js`. By default tests from all skip lists are omitted.
You can change this behaviour with:
`node tests/tester -s --skip=BROKEN,PERMANENT`
-to skip only the ``BROKEN`` and ``PERMANENT`` tests and include the ``SLOW`` tests.
-There are also the keywords ``NONE`` or ``ALL`` for convenience.
+to skip only the `BROKEN` and `PERMANENT` tests and include the `SLOW` tests.
+There are also the keywords `NONE` or `ALL` for convenience.
It is also possible to only run the tests from the skip lists:
@@ -83,35 +83,35 @@ It is also possible to only run the tests from the skip lists:
### CI Test Integration
-Tests are run on ``CircleCI`` on every PR, configuration can be found in ``.circleci/config.yml``.
+Tests are run on `CircleCI` on every PR, configuration can be found in `.circleci/config.yml`.
### Debugging
#### Local Debugging
-For state tests you can use the ``--jsontrace`` flag to output opcode trace information.
+For state tests you can use the `--jsontrace` flag to output opcode trace information.
Blockchain tests support `--debug` to verify the postState:
-`node ./tests/tester -b --debug --test='ZeroValue_SELFDESTRUCT_ToOneStorageKey_OOGRevert_d0g0v0_EIP158'`
+`node ./tests/tester -b --debug --test='ZeroValue_SELFDESTRUCT_ToOneStorageKey_OOGRevert_d0g0v0_EIP158'`
-All/most State tests are replicated as Blockchain tests in a ``GeneralStateTests`` [sub directory](https://github.com/ethereum/tests/tree/develop/BlockchainTests/GeneralStateTests) in the Ethereum tests repo, so for debugging single test cases the Blockchain test version of the State test can be used.
+All/most State tests are replicated as Blockchain tests in a `GeneralStateTests` [sub directory](https://github.com/ethereum/tests/tree/develop/BlockchainTests/GeneralStateTests) in the Ethereum tests repo, so for debugging single test cases the Blockchain test version of the State test can be used.
#### Comparing Stack Traces
Other client implementations often also provide functionality for output trace information.
-A convenient way is to use a local ``geth`` installation (can be the binary installation and doesn't has to be build from source or something) and then use the included ``evm`` tool like:
+A convenient way is to use a local `geth` installation (can be the binary installation and doesn't has to be build from source or something) and then use the included `evm` tool like:
```shell
evm --json --nomemory statetest node_modules/ethereumjs-testing/tests/GeneralStateTests/stCreate2/create2collisionCode2.json
```
-If you want to have only the output for a specific fork you can go into the referenced json test file and temporarily delete the ``post`` section for the non-desired fork outputs (or, more safe and also more convenient on triggering later: copy the test files you are interested in to your working directory and then modify without further worrying).
+If you want to have only the output for a specific fork you can go into the referenced json test file and temporarily delete the `post` section for the non-desired fork outputs (or, more safe and also more convenient on triggering later: copy the test files you are interested in to your working directory and then modify without further worrying).
#### Debugging Tools
-For comparing ``EVM`` traces [here](https://gist.github.com/cdetrio/41172f374ae32047a6c9e97fa9d09ad0) are some instructions for setting up ``pyethereum`` to generate corresponding traces for state tests.
+For comparing `EVM` traces [here](https://gist.github.com/cdetrio/41172f374ae32047a6c9e97fa9d09ad0) are some instructions for setting up `pyethereum` to generate corresponding traces for state tests.
Compare TAP output from blockchain/state tests and produces concise diff of the differences between them (example):
@@ -121,7 +121,7 @@ curl https://gist.githubusercontent.com/jwasinger/e7004e82426ff0a7137a88d273f118
python utils/diffTestOutput.py output-wip-byzantium.txt output-master.txt
```
-An extremely rich and powerful toolbox is the [evmlab](https://github.com/holiman/evmlab) from ``holiman``, both for debugging and creating new test cases or example data.
+An extremely rich and powerful toolbox is the [evmlab](https://github.com/holiman/evmlab) from `holiman`, both for debugging and creating new test cases or example data.
## Profiling
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 0000000000..93d7b52f70
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,35 @@
+
+# ethereumjs-vm
+
+## Index
+
+### Enumerations
+
+* [ERROR](enums/error.md)
+
+### Classes
+
+* [StateManager](classes/statemanager.md)
+* [VM](classes/vm.md)
+* [VmError](classes/vmerror.md)
+
+### Interfaces
+
+* [ExecResult](interfaces/execresult.md)
+* [InterpreterResult](interfaces/interpreterresult.md)
+* [RunBlockCb](interfaces/runblockcb.md)
+* [RunBlockOpts](interfaces/runblockopts.md)
+* [RunBlockResult](interfaces/runblockresult.md)
+* [RunCallCb](interfaces/runcallcb.md)
+* [RunCallOpts](interfaces/runcallopts.md)
+* [RunCodeCb](interfaces/runcodecb.md)
+* [RunCodeOpts](interfaces/runcodeopts.md)
+* [RunTxCb](interfaces/runtxcb.md)
+* [RunTxOpts](interfaces/runtxopts.md)
+* [RunTxResult](interfaces/runtxresult.md)
+* [StorageDump](interfaces/storagedump.md)
+* [TxReceipt](interfaces/txreceipt.md)
+* [VMOpts](interfaces/vmopts.md)
+
+---
+
diff --git a/docs/classes/statemanager.md b/docs/classes/statemanager.md
new file mode 100644
index 0000000000..a102edbec8
--- /dev/null
+++ b/docs/classes/statemanager.md
@@ -0,0 +1,664 @@
+[ethereumjs-vm](../README.md) > [StateManager](../classes/statemanager.md)
+
+# Class: StateManager
+
+Interface for getting and setting data from an underlying state trie.
+
+## Hierarchy
+
+**StateManager**
+
+## Index
+
+### Constructors
+
+* [constructor](statemanager.md#constructor)
+
+### Properties
+
+* [_cache](statemanager.md#_cache)
+* [_checkpointCount](statemanager.md#_checkpointcount)
+* [_common](statemanager.md#_common)
+* [_storageTries](statemanager.md#_storagetries)
+* [_touched](statemanager.md#_touched)
+* [_touchedStack](statemanager.md#_touchedstack)
+* [_trie](statemanager.md#_trie)
+
+### Methods
+
+* [_getStorageTrie](statemanager.md#_getstoragetrie)
+* [_lookupStorageTrie](statemanager.md#_lookupstoragetrie)
+* [_modifyContractStorage](statemanager.md#_modifycontractstorage)
+* [accountIsEmpty](statemanager.md#accountisempty)
+* [checkpoint](statemanager.md#checkpoint)
+* [cleanupTouchedAccounts](statemanager.md#cleanuptouchedaccounts)
+* [clearContractStorage](statemanager.md#clearcontractstorage)
+* [commit](statemanager.md#commit)
+* [copy](statemanager.md#copy)
+* [dumpStorage](statemanager.md#dumpstorage)
+* [generateCanonicalGenesis](statemanager.md#generatecanonicalgenesis)
+* [generateGenesis](statemanager.md#generategenesis)
+* [getAccount](statemanager.md#getaccount)
+* [getContractCode](statemanager.md#getcontractcode)
+* [getContractStorage](statemanager.md#getcontractstorage)
+* [getStateRoot](statemanager.md#getstateroot)
+* [hasGenesisState](statemanager.md#hasgenesisstate)
+* [putAccount](statemanager.md#putaccount)
+* [putContractCode](statemanager.md#putcontractcode)
+* [putContractStorage](statemanager.md#putcontractstorage)
+* [revert](statemanager.md#revert)
+* [setStateRoot](statemanager.md#setstateroot)
+
+---
+
+## Constructors
+
+
+
+### constructor
+
+⊕ **new StateManager**(opts?: *`any`*): [StateManager](statemanager.md)
+
+*Defined in [state/stateManager.ts:30](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L30)*
+
+Instantiate the StateManager interface.
+
+**Parameters:**
+
+| Name | Type | Default value |
+| ------ | ------ | ------ |
+| `Default value` opts | `any` | {} |
+
+**Returns:** [StateManager](statemanager.md)
+
+___
+
+## Properties
+
+
+
+### _cache
+
+**● _cache**: *`Cache`*
+
+*Defined in [state/stateManager.ts:27](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L27)*
+
+___
+
+
+### _checkpointCount
+
+**● _checkpointCount**: *`number`*
+
+*Defined in [state/stateManager.ts:30](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L30)*
+
+___
+
+
+### _common
+
+**● _common**: *`Common`*
+
+*Defined in [state/stateManager.ts:24](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L24)*
+
+___
+
+
+### _storageTries
+
+**● _storageTries**: *`any`*
+
+*Defined in [state/stateManager.ts:26](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L26)*
+
+___
+
+
+### _touched
+
+**● _touched**: *`Set`<`string`>*
+
+*Defined in [state/stateManager.ts:28](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L28)*
+
+___
+
+
+### _touchedStack
+
+**● _touchedStack**: *`Set`<`string`>[]*
+
+*Defined in [state/stateManager.ts:29](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L29)*
+
+___
+
+
+### _trie
+
+**● _trie**: *`any`*
+
+*Defined in [state/stateManager.ts:25](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L25)*
+
+___
+
+## Methods
+
+
+
+### `` _getStorageTrie
+
+▸ **_getStorageTrie**(address: *`Buffer`*, cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:182](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L182)*
+
+Gets the storage trie for an account from the storage cache or does a lookup
+
+*__memberof__*: DefaultStateManager
+
+*__method__*: \_getStorageTrie
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| address | `Buffer` | \- |
+| cb | `any` | Callback function |
+
+**Returns:** `void`
+
+___
+
+
+### `` _lookupStorageTrie
+
+▸ **_lookupStorageTrie**(address: *`Buffer`*, cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:160](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L160)*
+
+Creates a storage trie from the primary storage trie for an account and saves this in the storage cache.
+
+*__memberof__*: DefaultStateManager
+
+*__method__*: \_lookupStorageTrie
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| address | `Buffer` | \- |
+| cb | `any` | Callback function |
+
+**Returns:** `void`
+
+___
+
+
+### `` _modifyContractStorage
+
+▸ **_modifyContractStorage**(address: *`Buffer`*, modifyTrie: *`any`*, cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:232](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L232)*
+
+Modifies the storage trie of an account
+
+*__memberof__*: DefaultStateManager
+
+*__method__*: \_modifyContractStorage
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| address | `Buffer` | Address of the account whose storage is to be modified |
+| modifyTrie | `any` | function to modify the storage trie of the account |
+| cb | `any` |
+
+**Returns:** `void`
+
+___
+
+
+### accountIsEmpty
+
+▸ **accountIsEmpty**(address: *`Buffer`*, cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:538](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L538)*
+
+Checks if the `account` corresponding to `address` is empty as defined in EIP-161 ([https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md))
+
+*__memberof__*: StateManager
+
+*__method__*: accountIsEmpty
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| address | `Buffer` | Address to check |
+| cb | `any` | |
+
+**Returns:** `void`
+
+___
+
+
+### checkpoint
+
+▸ **checkpoint**(cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:304](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L304)*
+
+Checkpoints the current state of the StateManager instance. State changes that follow can then be committed by calling `commit` or `reverted` by calling rollback.
+
+*__memberof__*: StateManager
+
+*__method__*: checkpoint
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| cb | `any` | Callback function |
+
+**Returns:** `void`
+
+___
+
+
+### cleanupTouchedAccounts
+
+▸ **cleanupTouchedAccounts**(cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:561](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L561)*
+
+Removes accounts form the state trie that have been touched, as defined in EIP-161 ([https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md)](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md)).
+
+*__memberof__*: StateManager
+
+*__method__*: cleanupTouchedAccounts
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| cb | `any` | Callback function |
+
+**Returns:** `void`
+
+___
+
+
+### clearContractStorage
+
+▸ **clearContractStorage**(address: *`Buffer`*, cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:285](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L285)*
+
+Clears all storage entries for the account corresponding to `address`
+
+*__memberof__*: StateManager
+
+*__method__*: clearContractStorage
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| address | `Buffer` | Address to clear the storage of |
+| cb | `any` | Callback function |
+
+**Returns:** `void`
+
+___
+
+
+### commit
+
+▸ **commit**(cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:319](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L319)*
+
+Commits the current change-set to the instance since the last call to checkpoint.
+
+*__memberof__*: StateManager
+
+*__method__*: commit
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| cb | `any` | Callback function |
+
+**Returns:** `void`
+
+___
+
+
+### copy
+
+▸ **copy**(): [StateManager](statemanager.md)
+
+*Defined in [state/stateManager.ts:60](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L60)*
+
+Copies the current instance of the `DefaultStateManager` at the last fully committed point, i.e. as if all current checkpoints were reverted
+
+*__memberof__*: DefaultStateManager
+
+*__method__*: copy
+
+**Returns:** [StateManager](statemanager.md)
+
+___
+
+
+### dumpStorage
+
+▸ **dumpStorage**(address: *`Buffer`*, cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:440](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L440)*
+
+Dumps the the storage values for an `account` specified by `address`
+
+*__memberof__*: DefaultStateManager
+
+*__method__*: dumpStorage
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| address | `Buffer` | The address of the \`account\` to return storage for |
+| cb | `any` | |
+
+**Returns:** `void`
+
+___
+
+
+### generateCanonicalGenesis
+
+▸ **generateCanonicalGenesis**(cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:484](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L484)*
+
+Generates a canonical genesis state on the instance based on the configured chain parameters. Will error if there are uncommitted checkpoints on the instance.
+
+*__memberof__*: StateManager
+
+*__method__*: generateCanonicalGenesis
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| cb | `any` | Callback function |
+
+**Returns:** `void`
+
+___
+
+
+### generateGenesis
+
+▸ **generateGenesis**(initState: *`any`*, cb: *`any`*): `any`
+
+*Defined in [state/stateManager.ts:505](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L505)*
+
+Initializes the provided genesis state into the state trie
+
+*__memberof__*: DefaultStateManager
+
+*__method__*: generateGenesis
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| initState | `any` | \- |
+| cb | `any` | Callback function |
+
+**Returns:** `any`
+
+___
+
+
+### getAccount
+
+▸ **getAccount**(address: *`Buffer`*, cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:80](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L80)*
+
+Gets the [`ethereumjs-account`](https://github.com/ethereumjs/ethereumjs-account) associated with `address`. Returns an empty account if the account does not exist.
+
+*__memberof__*: StateManager
+
+*__method__*: getAccount
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| address | `Buffer` | Address of the \`account\` to get |
+| cb | `any` | |
+
+**Returns:** `void`
+
+___
+
+
+### getContractCode
+
+▸ **getContractCode**(address: *`Buffer`*, cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:142](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L142)*
+
+Gets the code corresponding to the provided `address`
+
+*__memberof__*: StateManager
+
+*__method__*: getContractCode
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| address | `Buffer` | Address to get the \`code\` for |
+| cb | `any` | |
+
+**Returns:** `void`
+
+___
+
+
+### getContractStorage
+
+▸ **getContractStorage**(address: *`Buffer`*, key: *`Buffer`*, cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:209](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L209)*
+
+Gets the storage value associated with the provided `address` and `key`
+
+*__memberof__*: StateManager
+
+*__method__*: getContractStorage
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| address | `Buffer` | Address of the account to get the storage for |
+| key | `Buffer` | Key in the account's storage to get the value for |
+| cb | `any` | |
+
+**Returns:** `void`
+
+___
+
+
+### getStateRoot
+
+▸ **getStateRoot**(cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:372](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L372)*
+
+Gets the state-root of the Merkle-Patricia trie representation of the state of this StateManager. Will error if there are uncommitted checkpoints on the instance.
+
+*__memberof__*: StateManager
+
+*__method__*: getStateRoot
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| cb | `any` | |
+
+**Returns:** `void`
+
+___
+
+
+### hasGenesisState
+
+▸ **hasGenesisState**(cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:471](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L471)*
+
+Checks whether the current instance has the canonical genesis state for the configured chain parameters.
+
+*__memberof__*: DefaultStateManager
+
+*__method__*: hasGenesisState
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| cb | `any` | |
+
+**Returns:** `void`
+
+___
+
+
+### putAccount
+
+▸ **putAccount**(address: *`Buffer`*, account: *`Account`*, cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:93](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L93)*
+
+Saves an [`ethereumjs-account`](https://github.com/ethereumjs/ethereumjs-account) into state under the provided `address`
+
+*__memberof__*: StateManager
+
+*__method__*: putAccount
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| address | `Buffer` | Address under which to store \`account\` |
+| account | `Account` | The [\`ethereumjs-account\`](https://github.com/ethereumjs/ethereumjs-account) to store |
+| cb | `any` | Callback function |
+
+**Returns:** `void`
+
+___
+
+
+### putContractCode
+
+▸ **putContractCode**(address: *`Buffer`*, value: *`Buffer`*, cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:112](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L112)*
+
+Adds `value` to the state trie as code, and sets `codeHash` on the account corresponding to `address` to reference this.
+
+*__memberof__*: StateManager
+
+*__method__*: putContractCode
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| address | `Buffer` | Address of the \`account\` to add the \`code\` for |
+| value | `Buffer` | The value of the \`code\` |
+| cb | `any` | Callback function |
+
+**Returns:** `void`
+
+___
+
+
+### putContractStorage
+
+▸ **putContractStorage**(address: *`Buffer`*, key: *`Buffer`*, value: *`Buffer`*, cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:261](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L261)*
+
+Adds value to the state trie for the `account` corresponding to `address` at the provided `key`
+
+*__memberof__*: StateManager
+
+*__method__*: putContractStorage
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| address | `Buffer` | Address to set a storage value for |
+| key | `Buffer` | Key to set the value at |
+| value | `Buffer` | Value to set at \`key\` for account corresponding to \`address\` |
+| cb | `any` | Callback function |
+
+**Returns:** `void`
+
+___
+
+
+### revert
+
+▸ **revert**(cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:339](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L339)*
+
+Reverts the current change-set to the instance since the last call to checkpoint.
+
+*__memberof__*: StateManager
+
+*__method__*: revert
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| cb | `any` | Callback function |
+
+**Returns:** `void`
+
+___
+
+
+### setStateRoot
+
+▸ **setStateRoot**(stateRoot: *`Buffer`*, cb: *`any`*): `void`
+
+*Defined in [state/stateManager.ts:396](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/state/stateManager.ts#L396)*
+
+Sets the state of the instance to that represented by the provided `stateRoot`. Will error if there are uncommitted checkpoints on the instance or if the state root does not exist in the state trie.
+
+*__memberof__*: StateManager
+
+*__method__*: setStateRoot
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| stateRoot | `Buffer` | The state-root to reset the instance to |
+| cb | `any` | Callback function |
+
+**Returns:** `void`
+
+___
+
diff --git a/docs/classes/vm.md b/docs/classes/vm.md
new file mode 100644
index 0000000000..32e9864a88
--- /dev/null
+++ b/docs/classes/vm.md
@@ -0,0 +1,242 @@
+[ethereumjs-vm](../README.md) > [VM](../classes/vm.md)
+
+# Class: VM
+
+Execution engine which can be used to run a blockchain, individual blocks, individual transactions, or snippets of EVM bytecode.
+
+## Hierarchy
+
+ `any`
+
+**↳ VM**
+
+## Index
+
+### Constructors
+
+* [constructor](vm.md#constructor)
+
+### Properties
+
+* [_common](vm.md#_common)
+* [allowUnlimitedContractSize](vm.md#allowunlimitedcontractsize)
+* [blockchain](vm.md#blockchain)
+* [opts](vm.md#opts)
+* [stateManager](vm.md#statemanager)
+
+### Methods
+
+* [_emit](vm.md#_emit)
+* [copy](vm.md#copy)
+* [runBlock](vm.md#runblock)
+* [runBlockchain](vm.md#runblockchain)
+* [runCall](vm.md#runcall)
+* [runCode](vm.md#runcode)
+* [runTx](vm.md#runtx)
+
+---
+
+## Constructors
+
+
+
+### constructor
+
+⊕ **new VM**(opts?: *[VMOpts](../interfaces/vmopts.md)*): [VM](vm.md)
+
+*Defined in [index.ts:59](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L59)*
+
+Instantiates a new [VM](vm.md) Object.
+
+**Parameters:**
+
+| Name | Type | Default value | Description |
+| ------ | ------ | ------ | ------ |
+| `Default value` opts | [VMOpts](../interfaces/vmopts.md) | {} | Default values for the options are:* \`chain\`: 'mainnet'* \`hardfork\`: 'petersburg' \[supported: 'byzantium', 'constantinople', 'petersburg' (will throw on unsupported)\]* \`activatePrecompiles\`: false* \`allowUnlimitedContractSize\`: false \[ONLY set to \`true\` during debugging\] |
+
+**Returns:** [VM](vm.md)
+
+___
+
+## Properties
+
+
+
+### _common
+
+**● _common**: *`Common`*
+
+*Defined in [index.ts:56](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L56)*
+
+___
+
+
+### allowUnlimitedContractSize
+
+**● allowUnlimitedContractSize**: *`boolean`*
+
+*Defined in [index.ts:59](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L59)*
+
+___
+
+
+### blockchain
+
+**● blockchain**: *`any`*
+
+*Defined in [index.ts:58](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L58)*
+
+___
+
+
+### opts
+
+**● opts**: *[VMOpts](../interfaces/vmopts.md)*
+
+*Defined in [index.ts:55](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L55)*
+
+___
+
+
+### stateManager
+
+**● stateManager**: *[StateManager](statemanager.md)*
+
+*Defined in [index.ts:57](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L57)*
+
+___
+
+## Methods
+
+
+
+### _emit
+
+▸ **_emit**(topic: *`string`*, data: *`any`*): `Promise`<`any`>
+
+*Defined in [index.ts:147](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L147)*
+
+**Parameters:**
+
+| Name | Type |
+| ------ | ------ |
+| topic | `string` |
+| data | `any` |
+
+**Returns:** `Promise`<`any`>
+
+___
+
+
+### copy
+
+▸ **copy**(): [VM](vm.md)
+
+*Defined in [index.ts:140](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L140)*
+
+Returns a copy of the [VM](vm.md) instance.
+
+**Returns:** [VM](vm.md)
+
+___
+
+
+### runBlock
+
+▸ **runBlock**(opts: *[RunBlockOpts](../interfaces/runblockopts.md)*, cb: *[RunBlockCb](../interfaces/runblockcb.md)*): `void`
+
+*Defined in [index.ts:112](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L112)*
+
+Processes the `block` running all of the transactions it contains and updating the miner's account
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| opts | [RunBlockOpts](../interfaces/runblockopts.md) | Default values for options:* \`generate\`: false @param cb - Callback function |
+| cb | [RunBlockCb](../interfaces/runblockcb.md) |
+
+**Returns:** `void`
+
+___
+
+
+### runBlockchain
+
+▸ **runBlockchain**(blockchain: *`any`*, cb: *`any`*): `void`
+
+*Defined in [index.ts:102](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L102)*
+
+Processes blocks and adds them to the blockchain.
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| blockchain | `any` | A [blockchain](https://github.com/ethereum/ethereumjs-blockchain) object to process |
+| cb | `any` | the callback function |
+
+**Returns:** `void`
+
+___
+
+
+### runCall
+
+▸ **runCall**(opts: *[RunCallOpts](../interfaces/runcallopts.md)*, cb: *[RunCallCb](../interfaces/runcallcb.md)*): `void`
+
+*Defined in [index.ts:126](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L126)*
+
+runs a call (or create) operation.
+
+**Parameters:**
+
+| Name | Type |
+| ------ | ------ |
+| opts | [RunCallOpts](../interfaces/runcallopts.md) |
+| cb | [RunCallCb](../interfaces/runcallcb.md) |
+
+**Returns:** `void`
+
+___
+
+
+### runCode
+
+▸ **runCode**(opts: *[RunCodeOpts](../interfaces/runcodeopts.md)*, cb: *[RunCodeCb](../interfaces/runcodecb.md)*): `void`
+
+*Defined in [index.ts:133](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L133)*
+
+Runs EVM code.
+
+**Parameters:**
+
+| Name | Type |
+| ------ | ------ |
+| opts | [RunCodeOpts](../interfaces/runcodeopts.md) |
+| cb | [RunCodeCb](../interfaces/runcodecb.md) |
+
+**Returns:** `void`
+
+___
+
+
+### runTx
+
+▸ **runTx**(opts: *[RunTxOpts](../interfaces/runtxopts.md)*, cb: *[RunTxCb](../interfaces/runtxcb.md)*): `void`
+
+*Defined in [index.ts:119](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L119)*
+
+Process a transaction. Run the vm. Transfers eth. Checks balances.
+
+**Parameters:**
+
+| Name | Type |
+| ------ | ------ |
+| opts | [RunTxOpts](../interfaces/runtxopts.md) |
+| cb | [RunTxCb](../interfaces/runtxcb.md) |
+
+**Returns:** `void`
+
+___
+
diff --git a/docs/classes/vmerror.md b/docs/classes/vmerror.md
new file mode 100644
index 0000000000..15ef66b8a8
--- /dev/null
+++ b/docs/classes/vmerror.md
@@ -0,0 +1,62 @@
+[ethereumjs-vm](../README.md) > [VmError](../classes/vmerror.md)
+
+# Class: VmError
+
+## Hierarchy
+
+**VmError**
+
+## Index
+
+### Constructors
+
+* [constructor](vmerror.md#constructor)
+
+### Properties
+
+* [error](vmerror.md#error)
+* [errorType](vmerror.md#errortype)
+
+---
+
+## Constructors
+
+
+
+### constructor
+
+⊕ **new VmError**(error: *[ERROR](../enums/error.md)*): [VmError](vmerror.md)
+
+*Defined in [exceptions.ts:17](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L17)*
+
+**Parameters:**
+
+| Name | Type |
+| ------ | ------ |
+| error | [ERROR](../enums/error.md) |
+
+**Returns:** [VmError](vmerror.md)
+
+___
+
+## Properties
+
+
+
+### error
+
+**● error**: *[ERROR](../enums/error.md)*
+
+*Defined in [exceptions.ts:16](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L16)*
+
+___
+
+
+### errorType
+
+**● errorType**: *`string`*
+
+*Defined in [exceptions.ts:17](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L17)*
+
+___
+
diff --git a/docs/enums/error.md b/docs/enums/error.md
new file mode 100644
index 0000000000..6be2a6e910
--- /dev/null
+++ b/docs/enums/error.md
@@ -0,0 +1,124 @@
+[ethereumjs-vm](../README.md) > [ERROR](../enums/error.md)
+
+# Enumeration: ERROR
+
+## Index
+
+### Enumeration members
+
+* [CREATE_COLLISION](error.md#create_collision)
+* [INTERNAL_ERROR](error.md#internal_error)
+* [INVALID_JUMP](error.md#invalid_jump)
+* [INVALID_OPCODE](error.md#invalid_opcode)
+* [OUT_OF_GAS](error.md#out_of_gas)
+* [OUT_OF_RANGE](error.md#out_of_range)
+* [REVERT](error.md#revert)
+* [STACK_OVERFLOW](error.md#stack_overflow)
+* [STACK_UNDERFLOW](error.md#stack_underflow)
+* [STATIC_STATE_CHANGE](error.md#static_state_change)
+* [STOP](error.md#stop)
+
+---
+
+## Enumeration members
+
+
+
+### CREATE_COLLISION
+
+**CREATE_COLLISION**: = "create collision"
+
+*Defined in [exceptions.ts:11](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L11)*
+
+___
+
+
+### INTERNAL_ERROR
+
+**INTERNAL_ERROR**: = "internal error"
+
+*Defined in [exceptions.ts:10](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L10)*
+
+___
+
+
+### INVALID_JUMP
+
+**INVALID_JUMP**: = "invalid JUMP"
+
+*Defined in [exceptions.ts:5](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L5)*
+
+___
+
+
+### INVALID_OPCODE
+
+**INVALID_OPCODE**: = "invalid opcode"
+
+*Defined in [exceptions.ts:6](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L6)*
+
+___
+
+
+### OUT_OF_GAS
+
+**OUT_OF_GAS**: = "out of gas"
+
+*Defined in [exceptions.ts:2](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L2)*
+
+___
+
+
+### OUT_OF_RANGE
+
+**OUT_OF_RANGE**: = "value out of range"
+
+*Defined in [exceptions.ts:7](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L7)*
+
+___
+
+
+### REVERT
+
+**REVERT**: = "revert"
+
+*Defined in [exceptions.ts:8](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L8)*
+
+___
+
+
+### STACK_OVERFLOW
+
+**STACK_OVERFLOW**: = "stack overflow"
+
+*Defined in [exceptions.ts:4](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L4)*
+
+___
+
+
+### STACK_UNDERFLOW
+
+**STACK_UNDERFLOW**: = "stack underflow"
+
+*Defined in [exceptions.ts:3](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L3)*
+
+___
+
+
+### STATIC_STATE_CHANGE
+
+**STATIC_STATE_CHANGE**: = "static state change"
+
+*Defined in [exceptions.ts:9](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L9)*
+
+___
+
+
+### STOP
+
+**STOP**: = "stop"
+
+*Defined in [exceptions.ts:12](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/exceptions.ts#L12)*
+
+___
+
diff --git a/docs/index.md b/docs/index.md
deleted file mode 100644
index 40b6fd541f..0000000000
--- a/docs/index.md
+++ /dev/null
@@ -1,294 +0,0 @@
-
-
-### Table of Contents
-
-- [vm.runBlockchain][1]
- - [Parameters][2]
-- [vm.runBlock][3]
- - [Parameters][4]
-- [runBlock~callback][5]
- - [Parameters][6]
-- [runTx~callback][7]
- - [Parameters][8]
-- [vm.runTx][9]
- - [Parameters][10]
-- [VM][11]
- - [Parameters][12]
-- [vm.runCode][13]
- - [Parameters][14]
-- [runCode~callback][15]
- - [Parameters][16]
-- [Event: beforeBlock][17]
- - [Properties][18]
-- [Event: afterBlock][19]
- - [Properties][20]
-- [Event: beforeTx][21]
- - [Properties][22]
-- [Event: afterTx][23]
- - [Properties][24]
-- [Event: step][25]
- - [Properties][26]
-
-## vm.runBlockchain
-
-Processes blocks and adds them to the blockchain
-
-### Parameters
-
-- `blockchain` **Blockchain** A [blockchain][27] that to process
-- `cb` **[Function][28]** the callback function
-
-## vm.runBlock
-
-Processes the `block` running all of the transactions it contains and updating the miner's account
-
-### Parameters
-
-- `opts`
- - `opts.block` **Block** the [`Block`][29] to process
- - `opts.generate` **[Boolean][30]** [gen=false] whether to generate the stateRoot, if false `runBlock` will check the stateRoot of the block against the Trie
-- `cb` **[runBlock~callback][31]** callback
-
-## runBlock~callback
-
-Callback for `runBlock` method
-
-Type: [Function][28]
-
-### Parameters
-
-- `error` **[Error][32]** an error that may have happened or `null`
-- `results` **[Object][33]**
- - `results.receipts` **[Array][34]** the receipts from the transactions in the block
- - `results.results` **[Array][34]**
-
-## runTx~callback
-
-Callback for `runTx` method
-
-Type: [Function][28]
-
-### Parameters
-
-- `error` **[Error][32]** an error that may have happened or `null`
-- `results` **[Object][33]**
- - `results.amountSpent` **BN** the amount of ether used by this transaction as a `bignum`
- - `results.gasUsed` **BN** the amount of gas as a `bignum` used by the transaction
- - `results.gasRefund` **BN** the amount of gas as a `bignum` that was refunded during the transaction (i.e. `gasUsed = totalGasConsumed - gasRefund`)
-- `vm` **[VM][35]** contains the results from running the code, if any, as described in `vm.runCode(params, cb)`
-
-## vm.runTx
-
-Process a transaction. Run the vm. Transfers eth. Checks balances.
-
-### Parameters
-
-- `opts`
- - `opts.tx` **Transaction** a [`Transaction`][36] to run
- - `opts.skipNonce` **[Boolean][30]** skips the nonce check
- - `opts.skipBalance` **[Boolean][30]** skips the balance check
- - `opts.block` **Block** the block to which the `tx` belongs, if no block is given a default one is created
-- `cb` **[runTx~callback][37]** the callback
-
-## VM
-
-VM Class, `new VM(opts)` creates a new VM object
-
-### Parameters
-
-- `opts` **[Object][33]**
- - `opts.stateManager` **StateManager** a [`StateManager`][38] instance to use as the state store (Beta API)
- - `opts.state` **Trie** a merkle-patricia-tree instance for the state tree (ignored if stateManager is passed)
- - `opts.blockchain` **Blockchain** a blockchain object for storing/retrieving blocks (ignored if stateManager is passed)
- - `opts.chain` **([String][39] \| [Number][40])** the chain the VM operates on [default: 'mainnet']
- - `opts.hardfork` **[String][39]** hardfork rules to be used [default: 'petersburg', supported: 'byzantium', 'constantinople', 'petersburg' (will throw on unsupported)]
- - `opts.activatePrecompiles` **[Boolean][30]** create entries in the state tree for the precompiled contracts
- - `opts.allowUnlimitedContractSize` **[Boolean][30]** allows unlimited contract sizes while debugging. By setting this to `true`, the check for contract size limit of 24KB (see [EIP-170][41]) is bypassed. (default: `false`; ONLY set to `true` during debugging)
- - `opts.emitFreeLogs` **[Boolean][30]** Changes the behavior of the LOG opcode, the gas cost of the opcode becomes zero and calling it using STATICCALL won't throw. (default: `false`; ONLY set to `true` during debugging)
-
-## vm.runCode
-
-Runs EVM code
-
-### Parameters
-
-- `opts` **[Object][33]**
- - `opts.account` **Account** the [`Account`][42] that the executing code belongs to. If omitted an empty account will be used
- - `opts.address` **[Buffer][43]** the address of the account that is executing this code. The address should be a `Buffer` of bytes. Defaults to `0`
- - `opts.block` **Block** the [`Block`][29] the `tx` belongs to. If omitted a blank block will be used
- - `opts.caller` **[Buffer][43]** the address that ran this code. The address should be a `Buffer` of 20bits. Defaults to `0`
- - `opts.code` **[Buffer][43]** the EVM code to run given as a `Buffer`
- - `opts.data` **[Buffer][43]** the input data
- - `opts.gasLimit` **[Buffer][43]** the gas limit for the code
- - `opts.origin` **[Buffer][43]** the address where the call originated from. The address should be a `Buffer` of 20bits. Defaults to `0`
- - `opts.value` **[Buffer][43]** the value in ether that is being sent to `opt.address`. Defaults to `0`
- - `opts.pc` **[Number][40]** the initial program counter. Defaults to `0`
-- `cb` **[runCode~callback][44]** callback
-
-## runCode~callback
-
-Callback for `runCode` method
-
-Type: [Function][28]
-
-### Parameters
-
-- `error` **[Error][32]** an error that may have happened or `null`
-- `results` **[Object][33]**
- - `results.gas` **BN** the amount of gas left
- - `results.gasUsed` **BN** the amount of gas as a `bignum` the code used to run
- - `results.gasRefund` **BN** a `bignum` containing the amount of gas to refund from deleting storage values
- - `results.selfdestruct` **[Object][33]** an `Object` with keys for accounts that have selfdestructed and values for balance transfer recipient accounts
- - `results.logs` **[Array][34]** an `Array` of logs that the contract emitted
- - `results.exception` **[Number][40]** `0` if the contract encountered an exception, `1` otherwise
- - `results.exceptionError` **[String][39]** a `String` describing the exception if there was one
- - `results.return` **[Buffer][43]** a `Buffer` containing the value that was returned by the contract
-
-## Event: beforeBlock
-
-The `beforeBlock` event
-
-Type: [Object][33]
-
-### Properties
-
-- `block` **Block** emits the block that is about to be processed
-
-## Event: afterBlock
-
-The `afterBlock` event
-
-Type: [Object][33]
-
-### Properties
-
-- `result` **[Object][33]** emits the results of processing a block
-
-## Event: beforeTx
-
-The `beforeTx` event
-
-Type: [Object][33]
-
-### Properties
-
-- `tx` **Transaction** emits the Transaction that is about to be processed
-
-## Event: afterTx
-
-The `afterTx` event
-
-Type: [Object][33]
-
-### Properties
-
-- `result` **[Object][33]** result of the transaction
-
-## Event: step
-
-The `step` event for trace output
-
-Type: [Object][33]
-
-### Properties
-
-- `pc` **[Number][40]** representing the program counter
-- `opcode` **[String][39]** the next opcode to be ran
-- `gasLeft` **BN** amount of gasLeft
-- `stack` **[Array][34]** an `Array` of `Buffers` containing the stack
-- `account` **Account** the [`Account`][45] which owns the code running
-- `address` **[Buffer][43]** the address of the `account`
-- `depth` **[Number][40]** the current number of calls deep the contract is
-- `memory` **[Buffer][43]** the memory of the VM as a `buffer`
-- `memoryWordCount` **BN** current size of memory in words
-- `stateManager` **StateManager** a [`StateManager`][38] instance (Beta API)
-
-[1]: #vmrunblockchain
-
-[2]: #parameters
-
-[3]: #vmrunblock
-
-[4]: #parameters-1
-
-[5]: #runblockcallback
-
-[6]: #parameters-2
-
-[7]: #runtxcallback
-
-[8]: #parameters-3
-
-[9]: #vmruntx
-
-[10]: #parameters-4
-
-[11]: #vm
-
-[12]: #parameters-5
-
-[13]: #vmruncode
-
-[14]: #parameters-6
-
-[15]: #runcodecallback
-
-[16]: #parameters-7
-
-[17]: #event-beforeblock
-
-[18]: #properties
-
-[19]: #event-afterblock
-
-[20]: #properties-1
-
-[21]: #event-beforetx
-
-[22]: #properties-2
-
-[23]: #event-aftertx
-
-[24]: #properties-3
-
-[25]: #event-step
-
-[26]: #properties-4
-
-[27]: https://github.com/ethereum/ethereumjs-blockchain
-
-[28]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
-
-[29]: https://github.com/ethereumjs/ethereumjs-block
-
-[30]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
-
-[31]: #runblockcallback
-
-[32]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error
-
-[33]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
-
-[34]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
-
-[35]: #vm
-
-[36]: https://github.com/ethereum/ethereumjs-tx
-
-[37]: #runtxcallback
-
-[38]: stateManager.md
-
-[39]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
-
-[40]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
-
-[41]: https://git.io/vxZkK
-
-[42]: https://github.com/ethereumjs/ethereumjs-account
-
-[43]: https://nodejs.org/api/buffer.html
-
-[44]: #runcodecallback
-
-[45]: https://github.com/ethereum/ethereumjs-account
diff --git a/docs/interfaces/execresult.md b/docs/interfaces/execresult.md
new file mode 100644
index 0000000000..d1d14588dc
--- /dev/null
+++ b/docs/interfaces/execresult.md
@@ -0,0 +1,138 @@
+[ethereumjs-vm](../README.md) > [ExecResult](../interfaces/execresult.md)
+
+# Interface: ExecResult
+
+Result of executing a call via the \[\[Interpreter\]\].
+
+## Hierarchy
+
+**ExecResult**
+
+## Index
+
+### Properties
+
+* [exception](execresult.md#exception)
+* [exceptionError](execresult.md#exceptionerror)
+* [gas](execresult.md#gas)
+* [gasRefund](execresult.md#gasrefund)
+* [gasUsed](execresult.md#gasused)
+* [logs](execresult.md#logs)
+* [return](execresult.md#return)
+* [returnValue](execresult.md#returnvalue)
+* [runState](execresult.md#runstate)
+* [selfdestruct](execresult.md#selfdestruct)
+
+---
+
+## Properties
+
+
+
+### exception
+
+**● exception**: *`IsException`*
+
+*Defined in [evm/interpreter.ts:48](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L48)*
+
+`0` if the contract encountered an exception, `1` otherwise
+
+___
+
+
+### `` exceptionError
+
+**● exceptionError**: *[VmError](../classes/vmerror.md) \| [ERROR](../enums/error.md)*
+
+*Defined in [evm/interpreter.ts:52](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L52)*
+
+Description of the exception, if any occured
+
+___
+
+
+### `` gas
+
+**● gas**: *`BN`*
+
+*Defined in [evm/interpreter.ts:56](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L56)*
+
+Amount of gas left
+
+___
+
+
+### `` gasRefund
+
+**● gasRefund**: *`BN`*
+
+*Defined in [evm/interpreter.ts:76](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L76)*
+
+Amount of gas to refund from deleting storage values
+
+___
+
+
+### gasUsed
+
+**● gasUsed**: *`BN`*
+
+*Defined in [evm/interpreter.ts:60](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L60)*
+
+Amount of gas the code used to run
+
+___
+
+
+### `` logs
+
+**● logs**: *`any`[]*
+
+*Defined in [evm/interpreter.ts:68](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L68)*
+
+Array of logs that the contract emitted
+
+___
+
+
+### return
+
+**● return**: *`Buffer`*
+
+*Defined in [evm/interpreter.ts:64](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L64)*
+
+Return value from the contract
+
+___
+
+
+### `` returnValue
+
+**● returnValue**: *`Buffer`*
+
+*Defined in [evm/interpreter.ts:72](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L72)*
+
+Value returned by the contract
+
+___
+
+
+### `` runState
+
+**● runState**: *`RunState`*
+
+*Defined in [evm/interpreter.ts:44](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L44)*
+
+___
+
+
+### `` selfdestruct
+
+**● selfdestruct**: *`undefined` \| `object`*
+
+*Defined in [evm/interpreter.ts:80](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L80)*
+
+A set of accounts that have self-destructed
+
+___
+
diff --git a/docs/interfaces/interpreterresult.md b/docs/interfaces/interpreterresult.md
new file mode 100644
index 0000000000..a6003188b3
--- /dev/null
+++ b/docs/interfaces/interpreterresult.md
@@ -0,0 +1,58 @@
+[ethereumjs-vm](../README.md) > [InterpreterResult](../interfaces/interpreterresult.md)
+
+# Interface: InterpreterResult
+
+Result of executing a message via the \[\[Interpreter\]\].
+
+## Hierarchy
+
+**InterpreterResult**
+
+↳ [RunTxResult](runtxresult.md)
+
+## Index
+
+### Properties
+
+* [createdAddress](interpreterresult.md#createdaddress)
+* [gasUsed](interpreterresult.md#gasused)
+* [vm](interpreterresult.md#vm)
+
+---
+
+## Properties
+
+
+
+### `` createdAddress
+
+**● createdAddress**: *`Buffer`*
+
+*Defined in [evm/interpreter.ts:33](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L33)*
+
+Address of created account durint transaction, if any
+
+___
+
+
+### gasUsed
+
+**● gasUsed**: *`BN`*
+
+*Defined in [evm/interpreter.ts:29](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L29)*
+
+Amount of gas used by the transaction
+
+___
+
+
+### vm
+
+**● vm**: *[ExecResult](execresult.md)*
+
+*Defined in [evm/interpreter.ts:37](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L37)*
+
+Contains the results from running the code, if any, as described in [runCode](../classes/vm.md#runcode)
+
+___
+
diff --git a/docs/interfaces/runblockcb.md b/docs/interfaces/runblockcb.md
new file mode 100644
index 0000000000..3c86949422
--- /dev/null
+++ b/docs/interfaces/runblockcb.md
@@ -0,0 +1,30 @@
+[ethereumjs-vm](../README.md) > [RunBlockCb](../interfaces/runblockcb.md)
+
+# Interface: RunBlockCb
+
+Callback function for [runBlock](../classes/vm.md#runblock)
+
+## Hierarchy
+
+**RunBlockCb**
+
+## Callable
+▸ **__call**(err: *`Error` \| `null`*, result: *[RunBlockResult](runblockresult.md) \| `null`*): `void`
+
+*Defined in [runBlock.ts:37](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runBlock.ts#L37)*
+
+Callback function for [runBlock](../classes/vm.md#runblock)
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| err | `Error` \| `null` | Any error that happened during execution, or \`null\` |
+| result | [RunBlockResult](runblockresult.md) \| `null` | Result of execution, \`null\` in case of error |
+
+**Returns:** `void`
+
+## Index
+
+---
+
diff --git a/docs/interfaces/runblockopts.md b/docs/interfaces/runblockopts.md
new file mode 100644
index 0000000000..6a249d1004
--- /dev/null
+++ b/docs/interfaces/runblockopts.md
@@ -0,0 +1,68 @@
+[ethereumjs-vm](../README.md) > [RunBlockOpts](../interfaces/runblockopts.md)
+
+# Interface: RunBlockOpts
+
+Options for running a block.
+
+## Hierarchy
+
+**RunBlockOpts**
+
+## Index
+
+### Properties
+
+* [block](runblockopts.md#block)
+* [generate](runblockopts.md#generate)
+* [root](runblockopts.md#root)
+* [skipBlockValidation](runblockopts.md#skipblockvalidation)
+
+---
+
+## Properties
+
+
+
+### block
+
+**● block**: *`any`*
+
+*Defined in [runBlock.ts:18](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runBlock.ts#L18)*
+
+The [`Block`](https://github.com/ethereumjs/ethereumjs-block) to process
+
+___
+
+
+### `` generate
+
+**● generate**: *`undefined` \| `false` \| `true`*
+
+*Defined in [runBlock.ts:27](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runBlock.ts#L27)*
+
+Whether to generate the stateRoot. If false `runBlock` will check the stateRoot of the block against the Trie
+
+___
+
+
+### `` root
+
+**● root**: *`Buffer`*
+
+*Defined in [runBlock.ts:22](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runBlock.ts#L22)*
+
+Root of the state trie
+
+___
+
+
+### `` skipBlockValidation
+
+**● skipBlockValidation**: *`undefined` \| `false` \| `true`*
+
+*Defined in [runBlock.ts:31](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runBlock.ts#L31)*
+
+If true, will skip block validation
+
+___
+
diff --git a/docs/interfaces/runblockresult.md b/docs/interfaces/runblockresult.md
new file mode 100644
index 0000000000..f69b3f161c
--- /dev/null
+++ b/docs/interfaces/runblockresult.md
@@ -0,0 +1,44 @@
+[ethereumjs-vm](../README.md) > [RunBlockResult](../interfaces/runblockresult.md)
+
+# Interface: RunBlockResult
+
+Result of [runBlock](../classes/vm.md#runblock)
+
+## Hierarchy
+
+**RunBlockResult**
+
+## Index
+
+### Properties
+
+* [receipts](runblockresult.md#receipts)
+* [results](runblockresult.md#results)
+
+---
+
+## Properties
+
+
+
+### receipts
+
+**● receipts**: *[TxReceipt](txreceipt.md)[]*
+
+*Defined in [runBlock.ts:52](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runBlock.ts#L52)*
+
+Receipts generated for transactions in the block
+
+___
+
+
+### results
+
+**● results**: *[RunTxResult](runtxresult.md)[]*
+
+*Defined in [runBlock.ts:56](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runBlock.ts#L56)*
+
+Results of executing the transactions in the block
+
+___
+
diff --git a/docs/interfaces/runcallcb.md b/docs/interfaces/runcallcb.md
new file mode 100644
index 0000000000..ee59b98193
--- /dev/null
+++ b/docs/interfaces/runcallcb.md
@@ -0,0 +1,30 @@
+[ethereumjs-vm](../README.md) > [RunCallCb](../interfaces/runcallcb.md)
+
+# Interface: RunCallCb
+
+Callback for the [runCall](../classes/vm.md#runcall) method.
+
+## Hierarchy
+
+**RunCallCb**
+
+## Callable
+▸ **__call**(err: *`Error` \| `null`*, results: *[InterpreterResult](interpreterresult.md) \| `null`*): `void`
+
+*Defined in [runCall.ts:38](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L38)*
+
+Callback for the [runCall](../classes/vm.md#runcall) method.
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| err | `Error` \| `null` |
+| results | [InterpreterResult](interpreterresult.md) \| `null` | Results of call, or \`null\` if an error occured |
+
+**Returns:** `void`
+
+## Index
+
+---
+
diff --git a/docs/interfaces/runcallopts.md b/docs/interfaces/runcallopts.md
new file mode 100644
index 0000000000..af00f0c501
--- /dev/null
+++ b/docs/interfaces/runcallopts.md
@@ -0,0 +1,182 @@
+[ethereumjs-vm](../README.md) > [RunCallOpts](../interfaces/runcallopts.md)
+
+# Interface: RunCallOpts
+
+Options for running a call (or create) operation
+
+## Hierarchy
+
+**RunCallOpts**
+
+## Index
+
+### Properties
+
+* [block](runcallopts.md#block)
+* [caller](runcallopts.md#caller)
+* [code](runcallopts.md#code)
+* [compiled](runcallopts.md#compiled)
+* [data](runcallopts.md#data)
+* [delegatecall](runcallopts.md#delegatecall)
+* [depth](runcallopts.md#depth)
+* [gasLimit](runcallopts.md#gaslimit)
+* [gasPrice](runcallopts.md#gasprice)
+* [origin](runcallopts.md#origin)
+* [salt](runcallopts.md#salt)
+* [selfdestruct](runcallopts.md#selfdestruct)
+* [static](runcallopts.md#static)
+* [storageReader](runcallopts.md#storagereader)
+* [to](runcallopts.md#to)
+* [value](runcallopts.md#value)
+
+---
+
+## Properties
+
+
+
+### `` block
+
+**● block**: *`any`*
+
+*Defined in [runCall.ts:14](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L14)*
+
+___
+
+
+### `` caller
+
+**● caller**: *`Buffer`*
+
+*Defined in [runCall.ts:18](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L18)*
+
+___
+
+
+### `` code
+
+**● code**: *`Buffer`*
+
+*Defined in [runCall.ts:26](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L26)*
+
+This is for CALLCODE where the code to load is different than the code from the to account
+
+___
+
+
+### `` compiled
+
+**● compiled**: *`undefined` \| `false` \| `true`*
+
+*Defined in [runCall.ts:28](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L28)*
+
+___
+
+
+### `` data
+
+**● data**: *`Buffer`*
+
+*Defined in [runCall.ts:22](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L22)*
+
+___
+
+
+### `` delegatecall
+
+**● delegatecall**: *`undefined` \| `false` \| `true`*
+
+*Defined in [runCall.ts:32](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L32)*
+
+___
+
+
+### `` depth
+
+**● depth**: *`undefined` \| `number`*
+
+*Defined in [runCall.ts:27](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L27)*
+
+___
+
+
+### `` gasLimit
+
+**● gasLimit**: *`Buffer`*
+
+*Defined in [runCall.ts:19](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L19)*
+
+___
+
+
+### `` gasPrice
+
+**● gasPrice**: *`Buffer`*
+
+*Defined in [runCall.ts:16](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L16)*
+
+___
+
+
+### `` origin
+
+**● origin**: *`Buffer`*
+
+*Defined in [runCall.ts:17](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L17)*
+
+___
+
+
+### `` salt
+
+**● salt**: *`Buffer`*
+
+*Defined in [runCall.ts:30](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L30)*
+
+___
+
+
+### `` selfdestruct
+
+**● selfdestruct**: *`undefined` \| `object`*
+
+*Defined in [runCall.ts:31](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L31)*
+
+___
+
+
+### `` static
+
+**● static**: *`undefined` \| `false` \| `true`*
+
+*Defined in [runCall.ts:29](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L29)*
+
+___
+
+
+### `` storageReader
+
+**● storageReader**: *`StorageReader`*
+
+*Defined in [runCall.ts:15](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L15)*
+
+___
+
+
+### `` to
+
+**● to**: *`Buffer`*
+
+*Defined in [runCall.ts:20](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L20)*
+
+___
+
+
+### `` value
+
+**● value**: *`Buffer`*
+
+*Defined in [runCall.ts:21](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCall.ts#L21)*
+
+___
+
diff --git a/docs/interfaces/runcodecb.md b/docs/interfaces/runcodecb.md
new file mode 100644
index 0000000000..45a181e61b
--- /dev/null
+++ b/docs/interfaces/runcodecb.md
@@ -0,0 +1,30 @@
+[ethereumjs-vm](../README.md) > [RunCodeCb](../interfaces/runcodecb.md)
+
+# Interface: RunCodeCb
+
+Callback for `runCode` method
+
+## Hierarchy
+
+**RunCodeCb**
+
+## Callable
+▸ **__call**(err: *`Error` \| `null`*, res: *[ExecResult](execresult.md) \| `null`*): `void`
+
+*Defined in [runCode.ts:75](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L75)*
+
+Callback for `runCode` method
+
+**Parameters:**
+
+| Name | Type |
+| ------ | ------ |
+| err | `Error` \| `null` |
+| res | [ExecResult](execresult.md) \| `null` |
+
+**Returns:** `void`
+
+## Index
+
+---
+
diff --git a/docs/interfaces/runcodeopts.md b/docs/interfaces/runcodeopts.md
new file mode 100644
index 0000000000..90322cd7b4
--- /dev/null
+++ b/docs/interfaces/runcodeopts.md
@@ -0,0 +1,208 @@
+[ethereumjs-vm](../README.md) > [RunCodeOpts](../interfaces/runcodeopts.md)
+
+# Interface: RunCodeOpts
+
+Options for the [runCode](../classes/vm.md#runcode) method.
+
+## Hierarchy
+
+**RunCodeOpts**
+
+## Index
+
+### Properties
+
+* [address](runcodeopts.md#address)
+* [block](runcodeopts.md#block)
+* [caller](runcodeopts.md#caller)
+* [code](runcodeopts.md#code)
+* [data](runcodeopts.md#data)
+* [depth](runcodeopts.md#depth)
+* [gasLimit](runcodeopts.md#gaslimit)
+* [gasPrice](runcodeopts.md#gasprice)
+* [interpreter](runcodeopts.md#interpreter)
+* [isStatic](runcodeopts.md#isstatic)
+* [message](runcodeopts.md#message)
+* [origin](runcodeopts.md#origin)
+* [pc](runcodeopts.md#pc)
+* [selfdestruct](runcodeopts.md#selfdestruct)
+* [storageReader](runcodeopts.md#storagereader)
+* [txContext](runcodeopts.md#txcontext)
+* [value](runcodeopts.md#value)
+
+---
+
+## Properties
+
+
+
+### `` address
+
+**● address**: *`Buffer`*
+
+*Defined in [runCode.ts:65](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L65)*
+
+The address of the account that is executing this code. The address should be a `Buffer` of bytes. Defaults to `0`
+
+___
+
+
+### `` block
+
+**● block**: *`any`*
+
+*Defined in [runCode.ts:29](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L29)*
+
+The [`Block`](https://github.com/ethereumjs/ethereumjs-block) the `tx` belongs to. If omitted a blank block will be used
+
+___
+
+
+### `` caller
+
+**● caller**: *`Buffer`*
+
+*Defined in [runCode.ts:42](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L42)*
+
+The address that ran this code. The address should be a `Buffer` of 20bits. Defaults to `0`
+
+___
+
+
+### `` code
+
+**● code**: *`Buffer`*
+
+*Defined in [runCode.ts:46](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L46)*
+
+The EVM code to run
+
+___
+
+
+### `` data
+
+**● data**: *`Buffer`*
+
+*Defined in [runCode.ts:50](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L50)*
+
+The input data
+
+___
+
+
+### `` depth
+
+**● depth**: *`undefined` \| `number`*
+
+*Defined in [runCode.ts:59](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L59)*
+
+___
+
+
+### `` gasLimit
+
+**● gasLimit**: *`Buffer`*
+
+*Defined in [runCode.ts:54](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L54)*
+
+Gas limit
+
+___
+
+
+### `` gasPrice
+
+**● gasPrice**: *`Buffer`*
+
+*Defined in [runCode.ts:33](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L33)*
+
+___
+
+
+### `` interpreter
+
+**● interpreter**: *`Interpreter`*
+
+*Defined in [runCode.ts:31](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L31)*
+
+___
+
+
+### `` isStatic
+
+**● isStatic**: *`undefined` \| `false` \| `true`*
+
+*Defined in [runCode.ts:60](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L60)*
+
+___
+
+
+### `` message
+
+**● message**: *`Message`*
+
+*Defined in [runCode.ts:38](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L38)*
+
+___
+
+
+### `` origin
+
+**● origin**: *`Buffer`*
+
+*Defined in [runCode.ts:37](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L37)*
+
+The address where the call originated from. The address should be a `Buffer` of 20bits. Defaults to `0`
+
+___
+
+
+### `` pc
+
+**● pc**: *`undefined` \| `number`*
+
+*Defined in [runCode.ts:69](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L69)*
+
+The initial program counter. Defaults to `0`
+
+___
+
+
+### `` selfdestruct
+
+**● selfdestruct**: *`undefined` \| `object`*
+
+*Defined in [runCode.ts:61](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L61)*
+
+___
+
+
+### `` storageReader
+
+**● storageReader**: *`StorageReader`*
+
+*Defined in [runCode.ts:30](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L30)*
+
+___
+
+
+### `` txContext
+
+**● txContext**: *`TxContext`*
+
+*Defined in [runCode.ts:32](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L32)*
+
+___
+
+
+### `` value
+
+**● value**: *`Buffer`*
+
+*Defined in [runCode.ts:58](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runCode.ts#L58)*
+
+The value in ether that is being sent to `opt.address`. Defaults to `0`
+
+___
+
diff --git a/docs/interfaces/runtxcb.md b/docs/interfaces/runtxcb.md
new file mode 100644
index 0000000000..fa63807e5d
--- /dev/null
+++ b/docs/interfaces/runtxcb.md
@@ -0,0 +1,30 @@
+[ethereumjs-vm](../README.md) > [RunTxCb](../interfaces/runtxcb.md)
+
+# Interface: RunTxCb
+
+Callback for `runTx` method
+
+## Hierarchy
+
+**RunTxCb**
+
+## Callable
+▸ **__call**(err: *`Error` \| `null`*, results: *[RunTxResult](runtxresult.md) \| `null`*): `void`
+
+*Defined in [runTx.ts:38](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runTx.ts#L38)*
+
+Callback for `runTx` method
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------ | ------ | ------ |
+| err | `Error` \| `null` |
+| results | [RunTxResult](runtxresult.md) \| `null` | Results of the execution |
+
+**Returns:** `void`
+
+## Index
+
+---
+
diff --git a/docs/interfaces/runtxopts.md b/docs/interfaces/runtxopts.md
new file mode 100644
index 0000000000..d5471faca3
--- /dev/null
+++ b/docs/interfaces/runtxopts.md
@@ -0,0 +1,68 @@
+[ethereumjs-vm](../README.md) > [RunTxOpts](../interfaces/runtxopts.md)
+
+# Interface: RunTxOpts
+
+Options for the `runTx` method.
+
+## Hierarchy
+
+**RunTxOpts**
+
+## Index
+
+### Properties
+
+* [block](runtxopts.md#block)
+* [skipBalance](runtxopts.md#skipbalance)
+* [skipNonce](runtxopts.md#skipnonce)
+* [tx](runtxopts.md#tx)
+
+---
+
+## Properties
+
+
+
+### `` block
+
+**● block**: *`any`*
+
+*Defined in [runTx.ts:20](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runTx.ts#L20)*
+
+The block to which the `tx` belongs
+
+___
+
+
+### `` skipBalance
+
+**● skipBalance**: *`undefined` \| `false` \| `true`*
+
+*Defined in [runTx.ts:32](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runTx.ts#L32)*
+
+If true, skips the balance check
+
+___
+
+
+### `` skipNonce
+
+**● skipNonce**: *`undefined` \| `false` \| `true`*
+
+*Defined in [runTx.ts:28](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runTx.ts#L28)*
+
+If true, skips the nonce check
+
+___
+
+
+### tx
+
+**● tx**: *`any`*
+
+*Defined in [runTx.ts:24](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runTx.ts#L24)*
+
+A [`Transaction`](https://github.com/ethereum/ethereumjs-tx) to run
+
+___
+
diff --git a/docs/interfaces/runtxresult.md b/docs/interfaces/runtxresult.md
new file mode 100644
index 0000000000..d1fb7e1fbf
--- /dev/null
+++ b/docs/interfaces/runtxresult.md
@@ -0,0 +1,100 @@
+[ethereumjs-vm](../README.md) > [RunTxResult](../interfaces/runtxresult.md)
+
+# Interface: RunTxResult
+
+Execution result of a transaction
+
+## Hierarchy
+
+ [InterpreterResult](interpreterresult.md)
+
+**↳ RunTxResult**
+
+## Index
+
+### Properties
+
+* [amountSpent](runtxresult.md#amountspent)
+* [bloom](runtxresult.md#bloom)
+* [createdAddress](runtxresult.md#createdaddress)
+* [gasRefund](runtxresult.md#gasrefund)
+* [gasUsed](runtxresult.md#gasused)
+* [vm](runtxresult.md#vm)
+
+---
+
+## Properties
+
+
+
+### amountSpent
+
+**● amountSpent**: *`BN`*
+
+*Defined in [runTx.ts:57](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runTx.ts#L57)*
+
+The amount of ether used by this transaction
+
+___
+
+
+### bloom
+
+**● bloom**: *`Bloom`*
+
+*Defined in [runTx.ts:53](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runTx.ts#L53)*
+
+Bloom filter resulted from transaction
+
+___
+
+
+### `` createdAddress
+
+**● createdAddress**: *`Buffer`*
+
+*Inherited from [InterpreterResult](interpreterresult.md).[createdAddress](interpreterresult.md#createdaddress)*
+
+*Defined in [evm/interpreter.ts:33](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L33)*
+
+Address of created account durint transaction, if any
+
+___
+
+
+### `` gasRefund
+
+**● gasRefund**: *`BN`*
+
+*Defined in [runTx.ts:61](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runTx.ts#L61)*
+
+The amount of gas as that was refunded during the transaction (i.e. `gasUsed = totalGasConsumed - gasRefund`)
+
+___
+
+
+### gasUsed
+
+**● gasUsed**: *`BN`*
+
+*Inherited from [InterpreterResult](interpreterresult.md).[gasUsed](interpreterresult.md#gasused)*
+
+*Defined in [evm/interpreter.ts:29](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L29)*
+
+Amount of gas used by the transaction
+
+___
+
+
+### vm
+
+**● vm**: *[ExecResult](execresult.md)*
+
+*Inherited from [InterpreterResult](interpreterresult.md).[vm](interpreterresult.md#vm)*
+
+*Defined in [evm/interpreter.ts:37](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/evm/interpreter.ts#L37)*
+
+Contains the results from running the code, if any, as described in [runCode](../classes/vm.md#runcode)
+
+___
+
diff --git a/docs/interfaces/storagedump.md b/docs/interfaces/storagedump.md
new file mode 100644
index 0000000000..6daad2c42c
--- /dev/null
+++ b/docs/interfaces/storagedump.md
@@ -0,0 +1,19 @@
+[ethereumjs-vm](../README.md) > [StorageDump](../interfaces/storagedump.md)
+
+# Interface: StorageDump
+
+Storage values of an account
+
+## Hierarchy
+
+**StorageDump**
+
+## Indexable
+
+\[key: `string`\]: `string`
+Storage values of an account
+
+## Index
+
+---
+
diff --git a/docs/interfaces/txreceipt.md b/docs/interfaces/txreceipt.md
new file mode 100644
index 0000000000..b85fc65587
--- /dev/null
+++ b/docs/interfaces/txreceipt.md
@@ -0,0 +1,68 @@
+[ethereumjs-vm](../README.md) > [TxReceipt](../interfaces/txreceipt.md)
+
+# Interface: TxReceipt
+
+Receipt generated for a transaction
+
+## Hierarchy
+
+**TxReceipt**
+
+## Index
+
+### Properties
+
+* [bitvector](txreceipt.md#bitvector)
+* [gasUsed](txreceipt.md#gasused)
+* [logs](txreceipt.md#logs)
+* [status](txreceipt.md#status)
+
+---
+
+## Properties
+
+
+
+### bitvector
+
+**● bitvector**: *`Buffer`*
+
+*Defined in [runBlock.ts:74](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runBlock.ts#L74)*
+
+Bloom bitvector
+
+___
+
+
+### gasUsed
+
+**● gasUsed**: *`Buffer`*
+
+*Defined in [runBlock.ts:70](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runBlock.ts#L70)*
+
+Gas used
+
+___
+
+
+### logs
+
+**● logs**: *`any`[]*
+
+*Defined in [runBlock.ts:78](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runBlock.ts#L78)*
+
+Logs emitted
+
+___
+
+
+### status
+
+**● status**: *`0` \| `1`*
+
+*Defined in [runBlock.ts:66](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/runBlock.ts#L66)*
+
+Status of transaction, `0` if successful, `1` if an exception occured
+
+___
+
diff --git a/docs/interfaces/vmopts.md b/docs/interfaces/vmopts.md
new file mode 100644
index 0000000000..9387c8cad3
--- /dev/null
+++ b/docs/interfaces/vmopts.md
@@ -0,0 +1,106 @@
+[ethereumjs-vm](../README.md) > [VMOpts](../interfaces/vmopts.md)
+
+# Interface: VMOpts
+
+Options for instantiating a [VM](../classes/vm.md).
+
+## Hierarchy
+
+**VMOpts**
+
+## Index
+
+### Properties
+
+* [activatePrecompiles](vmopts.md#activateprecompiles)
+* [allowUnlimitedContractSize](vmopts.md#allowunlimitedcontractsize)
+* [blockchain](vmopts.md#blockchain)
+* [chain](vmopts.md#chain)
+* [hardfork](vmopts.md#hardfork)
+* [state](vmopts.md#state)
+* [stateManager](vmopts.md#statemanager)
+
+---
+
+## Properties
+
+
+
+### `` activatePrecompiles
+
+**● activatePrecompiles**: *`undefined` \| `false` \| `true`*
+
+*Defined in [index.ts:43](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L43)*
+
+If true, create entries in the state tree for the precompiled contracts
+
+___
+
+
+### `` allowUnlimitedContractSize
+
+**● allowUnlimitedContractSize**: *`undefined` \| `false` \| `true`*
+
+*Defined in [index.ts:47](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L47)*
+
+Allows unlimited contract sizes while debugging. By setting this to `true`, the check for contract size limit of 24KB (see [EIP-170](https://git.io/vxZkK)) is bypassed
+
+___
+
+
+### `` blockchain
+
+**● blockchain**: *`any`*
+
+*Defined in [index.ts:39](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L39)*
+
+A [blockchain](https://github.com/ethereumjs/ethereumjs-blockchain) object for storing/retrieving blocks
+
+___
+
+
+### `` chain
+
+**● chain**: *`undefined` \| `string`*
+
+*Defined in [index.ts:22](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L22)*
+
+The chain the VM operates on
+
+___
+
+
+### `` hardfork
+
+**● hardfork**: *`undefined` \| `string`*
+
+*Defined in [index.ts:26](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L26)*
+
+Hardfork rules to be used
+
+___
+
+
+### `` state
+
+**● state**: *`any`*
+
+*Defined in [index.ts:35](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L35)*
+
+A [merkle-patricia-tree](https://github.com/ethereumjs/merkle-patricia-tree) instance for the state tree (ignored if stateManager is passed)
+
+*__deprecated__*:
+
+___
+
+
+### `` stateManager
+
+**● stateManager**: *[StateManager](../classes/statemanager.md)*
+
+*Defined in [index.ts:30](https://github.com/ethereumjs/ethereumjs-vm/blob/de4d574/lib/index.ts#L30)*
+
+A [StateManager](../classes/statemanager.md) instance to use as the state store (Beta API)
+
+___
+
diff --git a/docs/stateManager.md b/docs/stateManager.md
deleted file mode 100644
index beaa6e19d8..0000000000
--- a/docs/stateManager.md
+++ /dev/null
@@ -1,480 +0,0 @@
-
-
-### Table of Contents
-
-- [StateManager][1]
- - [getAccount][2]
- - [Parameters][3]
- - [putAccount][4]
- - [Parameters][5]
- - [putContractCode][6]
- - [Parameters][7]
- - [getContractCode][8]
- - [Parameters][9]
- - [getContractStorage][10]
- - [Parameters][11]
- - [putContractStorage][12]
- - [Parameters][13]
- - [clearContractStorage][14]
- - [Parameters][15]
- - [checkpoint][16]
- - [Parameters][17]
- - [commit][18]
- - [Parameters][19]
- - [revert][20]
- - [Parameters][21]
- - [getStateRoot][22]
- - [Parameters][23]
- - [setStateRoot][24]
- - [Parameters][25]
- - [generateCanonicalGenesis][26]
- - [Parameters][27]
- - [accountIsEmpty][28]
- - [Parameters][29]
- - [cleanupTouchedAccounts][30]
- - [Parameters][31]
-- [DefaultStateManager][32]
- - [Parameters][33]
- - [copy][34]
- - [dumpStorage][35]
- - [Parameters][36]
- - [hasGenesisState][37]
- - [Parameters][38]
- - [generateGenesis][39]
- - [Parameters][40]
-- [getAccount~callback][41]
- - [Parameters][42]
-- [getContractCode~callback][43]
- - [Parameters][44]
-- [getContractStorage~callback][45]
- - [Parameters][46]
-- [getStateRoot~callback][47]
- - [Parameters][48]
-- [dumpStorage~callback][49]
- - [Parameters][50]
-- [hasGenesisState~callback][51]
- - [Parameters][52]
-- [accountIsEmpty~callback][53]
- - [Parameters][54]
-
-## StateManager
-
-Interface for getting and setting data from an underlying
-state trie
-
-### getAccount
-
-Gets the [`ethereumjs-account`][55]
-associated with `address`. Returns an empty account if the account does not exist.
-
-#### Parameters
-
-- `address` **[Buffer][56]** Address of the `account` to get
-- `cb` **[getAccount~callback][57]**
-
-### putAccount
-
-Saves an [`ethereumjs-account`][55]
-into state under the provided `address`
-
-#### Parameters
-
-- `address` **[Buffer][56]** Address under which to store `account`
-- `account` **Account** The [`ethereumjs-account`][55] to store
-- `cb` **[Function][58]** Callback function
-
-### putContractCode
-
-Adds `value` to the state trie as code, and sets `codeHash` on the account
-corresponding to `address` to reference this.
-
-#### Parameters
-
-- `address` **[Buffer][56]** Address of the `account` to add the `code` for
-- `value` **[Buffer][56]** The value of the `code`
-- `cb` **[Function][58]** Callback function
-
-### getContractCode
-
-Gets the code corresponding to the provided `address`
-
-#### Parameters
-
-- `address` **[Buffer][56]** Address to get the `code` for
-- `cb` **[getContractCode~callback][59]**
-
-### getContractStorage
-
-Gets the storage value associated with the provided `address` and `key`
-
-#### Parameters
-
-- `address` **[Buffer][56]** Address of the account to get the storage for
-- `key` **[Buffer][56]** Key in the account's storage to get the value for
-- `cb` **[getContractCode~callback][59]**
-
-### putContractStorage
-
-Adds value to the state trie for the `account`
-corresponding to `address` at the provided `key`
-
-#### Parameters
-
-- `address` **[Buffer][56]** Address to set a storage value for
-- `key` **[Buffer][56]** Key to set the value at
-- `value` **[Buffer][56]** Value to set at `key` for account corresponding to `address`
-- `cb` **[Function][58]** Callback function
-
-### clearContractStorage
-
-Clears all storage entries for the account corresponding to `address`
-
-#### Parameters
-
-- `address` **[Buffer][56]** Address to clear the storage of
-- `cb` **[Function][58]** Callback function
-
-### checkpoint
-
-Checkpoints the current state of the StateManager instance.
-State changes that follow can then be committed by calling
-`commit` or `reverted` by calling rollback.
-
-#### Parameters
-
-- `cb` **[Function][58]** Callback function
-
-### commit
-
-Commits the current change-set to the instance since the
-last call to checkpoint.
-
-#### Parameters
-
-- `cb` **[Function][58]** Callback function
-
-### revert
-
-Reverts the current change-set to the instance since the
-last call to checkpoint.
-
-#### Parameters
-
-- `cb` **[Function][58]** Callback function
-
-### getStateRoot
-
-Gets the state-root of the Merkle-Patricia trie representation
-of the state of this StateManager. Will error if there are uncommitted
-checkpoints on the instance.
-
-#### Parameters
-
-- `cb` **[getStateRoot~callback][60]**
-
-### setStateRoot
-
-Sets the state of the instance to that represented
-by the provided `stateRoot`. Will error if there are uncommitted
-checkpoints on the instance or if the state root does not exist in
-the state trie.
-
-#### Parameters
-
-- `stateRoot` **[Buffer][56]** The state-root to reset the instance to
-- `cb` **[Function][58]** Callback function
-
-### generateCanonicalGenesis
-
-Generates a canonical genesis state on the instance based on the
-configured chain parameters. Will error if there are uncommitted
-checkpoints on the instance.
-
-#### Parameters
-
-- `cb` **[Function][58]** Callback function
-
-### accountIsEmpty
-
-Checks if the `account` corresponding to `address` is empty as defined in
-EIP-161 ([https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md][61])
-
-#### Parameters
-
-- `address` **[Buffer][56]** Address to check
-- `cb` **[accountIsEmpty~callback][62]**
-
-### cleanupTouchedAccounts
-
-Removes accounts form the state trie that have been touched,
-as defined in EIP-161 ([https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md][61]).
-
-#### Parameters
-
-- `cb` **[Function][58]** Callback function
-
-## DefaultStateManager
-
-Default implementation of the `StateManager` interface
-
-### Parameters
-
-- `opts` **[Object][63]** (optional, default `{}`)
- - `opts.common` **Common?** [`Common`][64] parameters of the chain
- - `opts.trie` **Trie?** a [`merkle-patricia-tree`][65] instance
-
-### copy
-
-Copies the current instance of the `DefaultStateManager`
-at the last fully committed point, i.e. as if all current
-checkpoints were reverted
-
-### dumpStorage
-
-Dumps the the storage values for an `account` specified by `address`
-
-#### Parameters
-
-- `address` **[Buffer][56]** The address of the `account` to return storage for
-- `cb` **[dumpStorage~callback][66]**
-
-### hasGenesisState
-
-Checks whether the current instance has the canonical genesis state
-for the configured chain parameters.
-
-#### Parameters
-
-- `cb` **[hasGenesisState~callback][67]**
-
-### generateGenesis
-
-Initializes the provided genesis state into the state trie
-
-#### Parameters
-
-- `initState` **[Object][63]**
-- `cb` **[Function][58]** Callback function
-
-## getAccount~callback
-
-Callback for `getAccount` method
-
-Type: [Function][58]
-
-### Parameters
-
-- `error` **[Error][68]** an error that may have happened or `null`
-- `account` **Account** An [`ethereumjs-account`][55]
- instance corresponding to the provided `address`
-
-## getContractCode~callback
-
-Callback for `getContractCode` method
-
-Type: [Function][58]
-
-### Parameters
-
-- `error` **[Error][68]** an error that may have happened or `null`
-- `code` **[Buffer][56]** The code corresponding to the provided address.
- Returns an empty `Buffer` if the account has no associated code.
-
-## getContractStorage~callback
-
-Callback for `getContractStorage` method
-
-Type: [Function][58]
-
-### Parameters
-
-- `error` **[Error][68]** an error that may have happened or `null`
-- `storageValue` **[Buffer][56]** The storage value for the account
- corresponding to the provided address at the provided key.
- If this does not exists an empty `Buffer` is returned
-
-## getStateRoot~callback
-
-Callback for `getStateRoot` method
-
-Type: [Function][58]
-
-### Parameters
-
-- `error` **[Error][68]** an error that may have happened or `null`.
- Will be an error if the un-committed checkpoints on the instance.
-- `stateRoot` **[Buffer][56]** The state-root of the `StateManager`
-
-## dumpStorage~callback
-
-Callback for `dumpStorage` method
-
-Type: [Function][58]
-
-### Parameters
-
-- `error` **[Error][68]** an error that may have happened or `null`
-- `accountState` **[Object][63]** The state of the account as an `Object` map.
- Keys are are the storage keys, values are the storage values as strings.
- Both are represented as hex strings without the `0x` prefix.
-
-## hasGenesisState~callback
-
-Callback for `hasGenesisState` method
-
-Type: [Function][58]
-
-### Parameters
-
-- `error` **[Error][68]** an error that may have happened or `null`
-- `hasGenesisState` **[Boolean][69]** Whether the storage trie contains the
- canonical genesis state for the configured chain parameters.
-
-## accountIsEmpty~callback
-
-Callback for `accountIsEmpty` method
-
-Type: [Function][58]
-
-### Parameters
-
-- `error` **[Error][68]** an error that may have happened or `null`
-- `empty` **[Boolean][69]** True if the account is empty false otherwise
-
-[1]: #statemanager
-
-[2]: #getaccount
-
-[3]: #parameters
-
-[4]: #putaccount
-
-[5]: #parameters-1
-
-[6]: #putcontractcode
-
-[7]: #parameters-2
-
-[8]: #getcontractcode
-
-[9]: #parameters-3
-
-[10]: #getcontractstorage
-
-[11]: #parameters-4
-
-[12]: #putcontractstorage
-
-[13]: #parameters-5
-
-[14]: #clearcontractstorage
-
-[15]: #parameters-6
-
-[16]: #checkpoint
-
-[17]: #parameters-7
-
-[18]: #commit
-
-[19]: #parameters-8
-
-[20]: #revert
-
-[21]: #parameters-9
-
-[22]: #getstateroot
-
-[23]: #parameters-10
-
-[24]: #setstateroot
-
-[25]: #parameters-11
-
-[26]: #generatecanonicalgenesis
-
-[27]: #parameters-12
-
-[28]: #accountisempty
-
-[29]: #parameters-13
-
-[30]: #cleanuptouchedaccounts
-
-[31]: #parameters-14
-
-[32]: #defaultstatemanager
-
-[33]: #parameters-15
-
-[34]: #copy
-
-[35]: #dumpstorage
-
-[36]: #parameters-16
-
-[37]: #hasgenesisstate
-
-[38]: #parameters-17
-
-[39]: #generategenesis
-
-[40]: #parameters-18
-
-[41]: #getaccountcallback
-
-[42]: #parameters-19
-
-[43]: #getcontractcodecallback
-
-[44]: #parameters-20
-
-[45]: #getcontractstoragecallback
-
-[46]: #parameters-21
-
-[47]: #getstaterootcallback
-
-[48]: #parameters-22
-
-[49]: #dumpstoragecallback
-
-[50]: #parameters-23
-
-[51]: #hasgenesisstatecallback
-
-[52]: #parameters-24
-
-[53]: #accountisemptycallback
-
-[54]: #parameters-25
-
-[55]: https://github.com/ethereumjs/ethereumjs-account
-
-[56]: https://nodejs.org/api/buffer.html
-
-[57]: #getaccountcallback
-
-[58]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
-
-[59]: #getcontractcodecallback
-
-[60]: #getstaterootcallback
-
-[61]: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md
-
-[62]: #accountisemptycallback
-
-[63]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
-
-[64]: https://github.com/ethereumjs/ethereumjs-common
-
-[65]: https://github.com/ethereumjs/merkle-patricia-tree
-
-[66]: #dumpstoragecallback
-
-[67]: #hasgenesisstatecallback
-
-[68]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error
-
-[69]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
diff --git a/lib/evm/interpreter.ts b/lib/evm/interpreter.ts
index 2785c0aad1..bc0addc8c7 100644
--- a/lib/evm/interpreter.ts
+++ b/lib/evm/interpreter.ts
@@ -19,26 +19,70 @@ import EEI from './eei'
import { default as Loop, LoopResult, RunState, IsException, RunOpts } from './loop'
const Block = require('ethereumjs-block')
+/**
+ * Result of executing a message via the [[Interpreter]].
+ */
export interface InterpreterResult {
+ /**
+ * Amount of gas used by the transaction
+ */
gasUsed: BN
+ /**
+ * Address of created account durint transaction, if any
+ */
createdAddress?: Buffer
+ /**
+ * Contains the results from running the code, if any, as described in [[runCode]]
+ */
vm: ExecResult
}
+/**
+ * Result of executing a call via the [[Interpreter]].
+ */
export interface ExecResult {
runState?: RunState
+ /**
+ * `0` if the contract encountered an exception, `1` otherwise
+ */
exception: IsException
+ /**
+ * Description of the exception, if any occured
+ */
exceptionError?: VmError | ERROR
+ /**
+ * Amount of gas left
+ */
gas?: BN
+ /**
+ * Amount of gas the code used to run
+ */
gasUsed: BN
+ /**
+ * Return value from the contract
+ */
return: Buffer
- // From RunResult
+ /**
+ * Array of logs that the contract emitted
+ */
logs?: any[]
+ /**
+ * Value returned by the contract
+ */
returnValue?: Buffer
+ /**
+ * Amount of gas to refund from deleting storage values
+ */
gasRefund?: BN
+ /**
+ * A set of accounts that have self-destructed
+ */
selfdestruct?: { [k: string]: Buffer }
}
+/**
+ * @ignore
+ */
export default class Interpreter {
_vm: any
_state: PStateManager
diff --git a/lib/index.ts b/lib/index.ts
index afb926864a..740f89d65d 100644
--- a/lib/index.ts
+++ b/lib/index.ts
@@ -12,27 +12,44 @@ const AsyncEventEmitter = require('async-eventemitter')
const Blockchain = require('ethereumjs-blockchain')
const Trie = require('merkle-patricia-tree/secure.js')
+/**
+ * Options for instantiating a [[VM]].
+ */
export interface VMOpts {
+ /**
+ * The chain the VM operates on
+ */
chain?: string
+ /**
+ * Hardfork rules to be used
+ */
hardfork?: string
+ /**
+ * A [[StateManager]] instance to use as the state store (Beta API)
+ */
stateManager?: StateManager
+ /**
+ * A [merkle-patricia-tree](https://github.com/ethereumjs/merkle-patricia-tree) instance for the state tree (ignored if stateManager is passed)
+ * @deprecated
+ */
state?: any // TODO
+ /**
+ * A [blockchain](https://github.com/ethereumjs/ethereumjs-blockchain) object for storing/retrieving blocks
+ */
blockchain?: any // TODO
+ /**
+ * If true, create entries in the state tree for the precompiled contracts
+ */
activatePrecompiles?: boolean
+ /**
+ * Allows unlimited contract sizes while debugging. By setting this to `true`, the check for contract size limit of 24KB (see [EIP-170](https://git.io/vxZkK)) is bypassed
+ */
allowUnlimitedContractSize?: boolean
}
/**
- * VM Class, `new VM(opts)` creates a new VM object
- * @method VM
- * @param {Object} opts
- * @param {StateManager} opts.stateManager a [`StateManager`](stateManager.md) instance to use as the state store (Beta API)
- * @param {Trie} opts.state a merkle-patricia-tree instance for the state tree (ignored if stateManager is passed)
- * @param {Blockchain} opts.blockchain a blockchain object for storing/retrieving blocks (ignored if stateManager is passed)
- * @param {String|Number} opts.chain the chain the VM operates on [default: 'mainnet']
- * @param {String} opts.hardfork hardfork rules to be used [default: 'petersburg', supported: 'byzantium', 'constantinople', 'petersburg' (will throw on unsupported)]
- * @param {Boolean} opts.activatePrecompiles create entries in the state tree for the precompiled contracts
- * @param {Boolean} opts.allowUnlimitedContractSize allows unlimited contract sizes while debugging. By setting this to `true`, the check for contract size limit of 24KB (see [EIP-170](https://git.io/vxZkK)) is bypassed. (default: `false`; ONLY set to `true` during debugging)
+ * Execution engine which can be used to run a blockchain, individual
+ * blocks, individual transactions, or snippets of EVM bytecode.
*/
export default class VM extends AsyncEventEmitter {
opts: VMOpts
@@ -41,6 +58,14 @@ export default class VM extends AsyncEventEmitter {
blockchain: any
allowUnlimitedContractSize: boolean
+ /**
+ * Instantiates a new [[VM]] Object.
+ * @param opts - Default values for the options are:
+ * - `chain`: 'mainnet'
+ * - `hardfork`: 'petersburg' [supported: 'byzantium', 'constantinople', 'petersburg' (will throw on unsupported)]
+ * - `activatePrecompiles`: false
+ * - `allowUnlimitedContractSize`: false [ONLY set to `true` during debugging]
+ */
constructor(opts: VMOpts = {}) {
super()
@@ -69,26 +94,49 @@ export default class VM extends AsyncEventEmitter {
opts.allowUnlimitedContractSize === undefined ? false : opts.allowUnlimitedContractSize
}
+ /**
+ * Processes blocks and adds them to the blockchain.
+ * @param blockchain - A [blockchain](https://github.com/ethereum/ethereumjs-blockchain) object to process
+ * @param cb - the callback function
+ */
runBlockchain(blockchain: any, cb: any): void {
runBlockchain.bind(this)(blockchain, cb)
}
+ /**
+ * Processes the `block` running all of the transactions it contains and updating the miner's account
+ * @param opts - Default values for options:
+ * - `generate`: false
+ * @param cb - Callback function
+ */
runBlock(opts: RunBlockOpts, cb: RunBlockCb): void {
runBlock.bind(this)(opts, cb)
}
+ /**
+ * Process a transaction. Run the vm. Transfers eth. Checks balances.
+ */
runTx(opts: RunTxOpts, cb: RunTxCb): void {
runTx.bind(this)(opts, cb)
}
+ /**
+ * runs a call (or create) operation.
+ */
runCall(opts: RunCallOpts, cb: RunCallCb): void {
runCall.bind(this)(opts, cb)
}
+ /**
+ * Runs EVM code.
+ */
runCode(opts: RunCodeOpts, cb: RunCodeCb): void {
runCode.bind(this)(opts, cb)
}
+ /**
+ * Returns a copy of the [[VM]] instance.
+ */
copy(): VM {
return new VM({
stateManager: this.stateManager.copy(),
diff --git a/lib/runBlock.ts b/lib/runBlock.ts
index c186e68fc9..16d6276e58 100644
--- a/lib/runBlock.ts
+++ b/lib/runBlock.ts
@@ -8,45 +8,78 @@ import PStateManager from './state/promisified'
const promisify = require('util.promisify')
const Trie = require('merkle-patricia-tree')
+/**
+ * Options for running a block.
+ */
export interface RunBlockOpts {
+ /**
+ * The [`Block`](https://github.com/ethereumjs/ethereumjs-block) to process
+ */
block: any
+ /**
+ * Root of the state trie
+ */
root?: Buffer
+ /**
+ * Whether to generate the stateRoot. If false `runBlock` will check the
+ * stateRoot of the block against the Trie
+ */
generate?: boolean
+ /**
+ * If true, will skip block validation
+ */
skipBlockValidation?: boolean
}
+/**
+ * Callback function for [[runBlock]]
+ */
export interface RunBlockCb {
+ /**
+ * @param err - Any error that happened during execution, or `null`
+ * @param result - Result of execution, `null` in case of error
+ */
(err: Error | null, result: RunBlockResult | null): void
}
+/**
+ * Result of [[runBlock]]
+ */
export interface RunBlockResult {
+ /**
+ * Receipts generated for transactions in the block
+ */
receipts: TxReceipt[]
+ /**
+ * Results of executing the transactions in the block
+ */
results: RunTxResult[]
}
+/**
+ * Receipt generated for a transaction
+ */
export interface TxReceipt {
+ /**
+ * Status of transaction, `0` if successful, `1` if an exception occured
+ */
status: 0 | 1
+ /**
+ * Gas used
+ */
gasUsed: Buffer
+ /**
+ * Bloom bitvector
+ */
bitvector: Buffer
+ /**
+ * Logs emitted
+ */
logs: any[]
}
/**
- * Processes the `block` running all of the transactions it contains and updating the miner's account
- * @method vm.runBlock
- * @param opts
- * @param {Block} opts.block the [`Block`](https://github.com/ethereumjs/ethereumjs-block) to process
- * @param {Boolean} opts.generate [gen=false] whether to generate the stateRoot, if false `runBlock` will check the stateRoot of the block against the Trie
- * @param {runBlock~callback} cb callback
- */
-
-/**
- * Callback for `runBlock` method
- * @callback runBlock~callback
- * @param {Error} error an error that may have happened or `null`
- * @param {Object} results
- * @param {Array} results.receipts the receipts from the transactions in the block
- * @param {Array} results.results
+ * @ignore
*/
export default function runBlock(this: VM, opts: RunBlockOpts, cb: RunBlockCb): void {
if (typeof opts === 'function' && cb === undefined) {
@@ -69,7 +102,7 @@ async function _runBlock(this: VM, opts: RunBlockOpts): Promise
const generateStateRoot = !!opts.generate
/**
- * The `beforeBlock` event
+ * The `beforeBlock` event.
*
* @event Event: beforeBlock
* @type {Object}
diff --git a/lib/runBlockchain.ts b/lib/runBlockchain.ts
index 35a732ed3c..aa3b4dbd0c 100644
--- a/lib/runBlockchain.ts
+++ b/lib/runBlockchain.ts
@@ -2,10 +2,7 @@ import VM from './index'
const async = require('async')
/**
- * Processes blocks and adds them to the blockchain
- * @method vm.runBlockchain
- * @param {Blockchain} blockchain A [blockchain](https://github.com/ethereum/ethereumjs-blockchain) that to process
- * @param {Function} cb the callback function
+ * @ignore
*/
export default function runBlockchain(this: VM, blockchain: any, cb: any) {
const self = this
diff --git a/lib/runCall.ts b/lib/runCall.ts
index db1d36f31f..9fd24094db 100644
--- a/lib/runCall.ts
+++ b/lib/runCall.ts
@@ -7,6 +7,9 @@ import Message from './evm/message'
import { default as Interpreter, InterpreterResult } from './evm/interpreter'
const Block = require('ethereumjs-block')
+/**
+ * Options for running a call (or create) operation
+ */
export interface RunCallOpts {
block?: any
storageReader?: StorageReader
@@ -17,6 +20,9 @@ export interface RunCallOpts {
to?: Buffer
value?: Buffer
data?: Buffer
+ /**
+ * This is for CALLCODE where the code to load is different than the code from the to account
+ */
code?: Buffer
depth?: number
compiled?: boolean
@@ -26,25 +32,19 @@ export interface RunCallOpts {
delegatecall?: boolean
}
+/**
+ * Callback for the [[runCall]] method.
+ */
export interface RunCallCb {
+ /**
+ * @param error - Any error that occured during execution, or `null`
+ * @param results - Results of call, or `null` if an error occured
+ */
(err: Error | null, results: InterpreterResult | null): void
}
/**
- * runs a CALL operation
- * @method vm.runCall
- * @private
- * @param opts
- * @param opts.block {Block}
- * @param opts.caller {Buffer}
- * @param opts.code {Buffer} this is for CALLCODE where the code to load is different than the code from the to account.
- * @param opts.data {Buffer}
- * @param opts.gasLimit {Buffer | BN.js }
- * @param opts.gasPrice {Buffer}
- * @param opts.origin {Buffer} []
- * @param opts.to {Buffer}
- * @param opts.value {Buffer}
- * @param {Function} cb the callback
+ * @ignore
*/
export default function runCall(this: VM, opts: RunCallOpts, cb: RunCallCb): void {
const block = opts.block || new Block()
diff --git a/lib/runCode.ts b/lib/runCode.ts
index e79f005b1f..5e2985c0b5 100644
--- a/lib/runCode.ts
+++ b/lib/runCode.ts
@@ -19,60 +19,69 @@ import { default as Interpreter, ExecResult } from './evm/interpreter'
import { StorageReader } from './state'
const Block = require('ethereumjs-block')
+/**
+ * Options for the [[runCode]] method.
+ */
export interface RunCodeOpts {
+ /**
+ * The [`Block`](https://github.com/ethereumjs/ethereumjs-block) the `tx` belongs to. If omitted a blank block will be used
+ */
block?: any
storageReader?: StorageReader
interpreter?: Interpreter
txContext?: TxContext
gasPrice?: Buffer
+ /**
+ * The address where the call originated from. The address should be a `Buffer` of 20bits. Defaults to `0`
+ */
origin?: Buffer
message?: Message
+ /**
+ * The address that ran this code. The address should be a `Buffer` of 20bits. Defaults to `0`
+ */
caller?: Buffer
+ /**
+ * The EVM code to run
+ */
code?: Buffer
+ /**
+ * The input data
+ */
data?: Buffer
+ /**
+ * Gas limit
+ */
gasLimit?: Buffer
+ /**
+ * The value in ether that is being sent to `opt.address`. Defaults to `0`
+ */
value?: Buffer
depth?: number
isStatic?: boolean
selfdestruct?: { [k: string]: boolean }
+ /**
+ * The address of the account that is executing this code. The address should be a `Buffer` of bytes. Defaults to `0`
+ */
address?: Buffer
+ /**
+ * The initial program counter. Defaults to `0`
+ */
pc?: number
}
+/**
+ * Callback for `runCode` method
+ */
export interface RunCodeCb {
+ /**
+ * @param error - an error that may have happened or `null`
+ * @param results - results of code execution
+ */
(err: Error | null, res: ExecResult | null): void
}
/**
- * Runs EVM code
- * @method vm.runCode
- * @param {Object} opts
- * @param {Account} opts.account the [`Account`](https://github.com/ethereumjs/ethereumjs-account) that the executing code belongs to. If omitted an empty account will be used
- * @param {Buffer} opts.address the address of the account that is executing this code. The address should be a `Buffer` of bytes. Defaults to `0`
- * @param {Block} opts.block the [`Block`](https://github.com/ethereumjs/ethereumjs-block) the `tx` belongs to. If omitted a blank block will be used
- * @param {Buffer} opts.caller the address that ran this code. The address should be a `Buffer` of 20bits. Defaults to `0`
- * @param {Buffer} opts.code the EVM code to run given as a `Buffer`
- * @param {Buffer} opts.data the input data
- * @param {Buffer} opts.gasLimit the gas limit for the code
- * @param {Buffer} opts.origin the address where the call originated from. The address should be a `Buffer` of 20bits. Defaults to `0`
- * @param {Buffer} opts.value the value in ether that is being sent to `opt.address`. Defaults to `0`
- * @param {Number} opts.pc the initial program counter. Defaults to `0`
- * @param {runCode~callback} cb callback
- */
-
-/**
- * Callback for `runCode` method
- * @callback runCode~callback
- * @param {Error} error an error that may have happened or `null`
- * @param {Object} results
- * @param {BN} results.gas the amount of gas left
- * @param {BN} results.gasUsed the amount of gas as a `bignum` the code used to run
- * @param {BN} results.gasRefund a `bignum` containing the amount of gas to refund from deleting storage values
- * @param {Object} results.selfdestruct an `Object` with keys for accounts that have selfdestructed and values for balance transfer recipient accounts
- * @param {Array} results.logs an `Array` of logs that the contract emitted
- * @param {Number} results.exception `0` if the contract encountered an exception, `1` otherwise
- * @param {String} results.exceptionError a `String` describing the exception if there was one
- * @param {Buffer} results.return a `Buffer` containing the value that was returned by the contract
+ * @ignore
*/
export default function runCode(this: VM, opts: RunCodeOpts, cb: RunCodeCb): void {
if (!opts.block) {
diff --git a/lib/runTx.ts b/lib/runTx.ts
index f1dd8c4576..27ff31e9b9 100644
--- a/lib/runTx.ts
+++ b/lib/runTx.ts
@@ -10,43 +10,59 @@ import { StorageReader } from './state'
import PStateManager from './state/promisified'
const Block = require('ethereumjs-block')
+/**
+ * Options for the `runTx` method.
+ */
export interface RunTxOpts {
+ /**
+ * The block to which the `tx` belongs
+ */
block?: any
+ /**
+ * A [`Transaction`](https://github.com/ethereum/ethereumjs-tx) to run
+ */
tx: any // TODO: Update ethereumjs-tx
+ /**
+ * If true, skips the nonce check
+ */
skipNonce?: boolean
+ /**
+ * If true, skips the balance check
+ */
skipBalance?: boolean
}
+/**
+ * Callback for `runTx` method
+ */
export interface RunTxCb {
+ /**
+ * @param error - An error that may have happened or `null`
+ * @param results - Results of the execution
+ */
(err: Error | null, results: RunTxResult | null): void
}
+/**
+ * Execution result of a transaction
+ */
export interface RunTxResult extends InterpreterResult {
+ /**
+ * Bloom filter resulted from transaction
+ */
bloom: Bloom
+ /**
+ * The amount of ether used by this transaction
+ */
amountSpent: BN
+ /**
+ * The amount of gas as that was refunded during the transaction (i.e. `gasUsed = totalGasConsumed - gasRefund`)
+ */
gasRefund?: BN
}
/**
- * Process a transaction. Run the vm. Transfers eth. Checks balances.
- * @method vm.runTx
- * @param opts
- * @param {Transaction} opts.tx a [`Transaction`](https://github.com/ethereum/ethereumjs-tx) to run
- * @param {Boolean} opts.skipNonce skips the nonce check
- * @param {Boolean} opts.skipBalance skips the balance check
- * @param {Block} opts.block the block to which the `tx` belongs, if no block is given a default one is created
- * @param {runTx~callback} cb the callback
- */
-
-/**
- * Callback for `runTx` method
- * @callback runTx~callback
- * @param {Error} error an error that may have happened or `null`
- * @param {Object} results
- * @param {BN} results.amountSpent the amount of ether used by this transaction as a `bignum`
- * @param {BN} results.gasUsed the amount of gas as a `bignum` used by the transaction
- * @param {BN} results.gasRefund the amount of gas as a `bignum` that was refunded during the transaction (i.e. `gasUsed = totalGasConsumed - gasRefund`)
- * @param {VM} vm contains the results from running the code, if any, as described in `vm.runCode(params, cb)`
+ * @ignore
*/
export default function runTx(this: VM, opts: RunTxOpts, cb: RunTxCb) {
if (typeof opts === 'function' && cb === undefined) {
diff --git a/lib/state/cache.ts b/lib/state/cache.ts
index 2930b6ed23..cc33dad643 100644
--- a/lib/state/cache.ts
+++ b/lib/state/cache.ts
@@ -2,6 +2,9 @@ const asyncLib = require('async')
const Tree = require('functional-red-black-tree')
import Account from 'ethereumjs-account'
+/**
+ * @ignore
+ */
export default class Cache {
_cache: any
_checkpoints: any[]
diff --git a/lib/state/promisified.ts b/lib/state/promisified.ts
index c41d853459..fc3907d200 100644
--- a/lib/state/promisified.ts
+++ b/lib/state/promisified.ts
@@ -2,6 +2,10 @@ const promisify = require('util.promisify')
import Account from 'ethereumjs-account'
import { default as StateManager, StorageDump } from './stateManager'
+/**
+ * Promisified wrapper around [[StateManager]]
+ * @ignore
+ */
export default class PStateManager {
_wrapped: StateManager
diff --git a/lib/state/stateManager.ts b/lib/state/stateManager.ts
index d96d814eb9..c0f3d1c3b9 100644
--- a/lib/state/stateManager.ts
+++ b/lib/state/stateManager.ts
@@ -9,6 +9,9 @@ import { genesisStateByName } from 'ethereumjs-common/dist/genesisStates'
import Account from 'ethereumjs-account'
import Cache from './cache'
+/**
+ * Storage values of an account
+ */
export interface StorageDump {
[key: string]: string
}
diff --git a/lib/state/storageReader.ts b/lib/state/storageReader.ts
index 152fd985a4..e5eb89ac07 100644
--- a/lib/state/storageReader.ts
+++ b/lib/state/storageReader.ts
@@ -1,5 +1,8 @@
import StateManager from './stateManager'
+/**
+ * @ignore
+ */
export default class StorageReader {
_stateManager: StateManager
_storageCache: Map
diff --git a/package.json b/package.json
index 5e8f38f31d..3b234e8d8c 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
"coverage": "nyc npm run coverageTests && nyc report --reporter=text-lcov > .nyc_output/lcov.info",
"coverageTests": "npm run build:dist && tape './tests/api/**/*.js' ./tests/tester.js -s --dist",
"coveralls": "npm run coverage && if [ -n \"$COVERALLS_REPO_TOKEN\" ]; then coveralls <.nyc_output/lcov.info; fi",
+ "docs:build": "typedoc lib",
"testVM": "node ./tests/tester -v",
"testStateByzantium": "npm run build:dist && node ./tests/tester -s --fork='Byzantium' --dist",
"testStateConstantinople": "npm run build:dist && node ./tests/tester -s --fork='Constantinople' --dist",
@@ -72,7 +73,6 @@
"@types/node": "^11.13.4",
"browserify": "^16.2.3",
"coveralls": "^3.0.0",
- "documentation": "^8.1.2",
"ethereumjs-testing": "git+https://github.com/ethereumjs/ethereumjs-testing.git#v1.2.7",
"ethereumjs-tx": "1.3.7",
"husky": "^2.1.0",
@@ -92,6 +92,8 @@
"tap-spec": "^5.0.0",
"tape": "4.6.3",
"tslint": "^5.16.0",
+ "typedoc": "^0.14.2",
+ "typedoc-plugin-markdown": "^1.2.1",
"typescript": "^3.4.3",
"typestrict": "^1.0.2"
},
diff --git a/typedoc.json b/typedoc.json
new file mode 100644
index 0000000000..d5cc04d2af
--- /dev/null
+++ b/typedoc.json
@@ -0,0 +1,9 @@
+{
+ "out": "docs",
+ "mode": "file",
+ "readme": "none",
+ "theme": "markdown",
+ "mdEngine": "github",
+ "excludeNotExported": true,
+ "exclude": ["lib/bloom/*.ts", "lib/evm/precompiles/*.ts", "lib/evm/eei.ts", "lib/evm/loop.ts", "lib/evm/memory.ts", "lib/evm/message.ts", "lib/evm/opcodes.ts", "lib/evm/opFns.ts", "lib/evm/stack.ts", "lib/evm/txContext.ts"]
+}