Skip to content

Commit

Permalink
📝 Update & validate docs' README
Browse files Browse the repository at this point in the history
  • Loading branch information
acuarica committed Nov 30, 2023
1 parent 983240e commit 11e3f11
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ jobs:
- name: Setup Pages
uses: actions/configure-pages@v3
- run: yarn install --frozen-lockfile
- run: yarn tsdoc
- run: yarn make:docs
- run: git --no-pager diff --exit-code docs/README.md
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
Expand Down
72 changes: 67 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/acuarica/evm/main.yaml?style=flat-square)](https://github.com/acuarica/evm/actions/workflows/main.yaml)
![nycrc config on GitHub](https://img.shields.io/nycrc/acuarica/evm?style=flat-square)
[![npm (scoped)](https://img.shields.io/npm/v/@acuarica/evm?style=flat-square)](https://www.npmjs.com/package/@acuarica/evm)
![npm](https://img.shields.io/npm/dt/@acuarica/evm)
[![npm](https://img.shields.io/npm/v/sevm?style=flat-square)](https://www.npmjs.com/package/sevm)
![npm](https://img.shields.io/npm/dt/sevm?style=flat-square)
[![GitHub](https://img.shields.io/github/license/acuarica/evm?style=flat-square)](https://github.com/acuarica/evm/blob/main/LICENSE)
[![install size](https://packagephobia.com/badge?p=@acuarica/evm)](https://packagephobia.com/result?p=@acuarica/evm)
[![install size](https://packagephobia.com/badge?p=sevm)](https://packagephobia.com/result?p=sevm)
[![Demo](https://img.shields.io/badge/demo-acuarica.github.io%2Fevm-informational?style=flat-square)](https://acuarica.github.io/evm)

A Symbolic [Ethereum Virtual Machine (EVM)](https://medium.com/mycrypto/the-ethereum-virtual-machine-how-does-it-work-9abac2b7c9e) interpreter and decompiler, along with several other utils for programmatically extracting information from bytecode.
Expand Down Expand Up @@ -35,13 +35,19 @@ Install using your package manager or Browser's `script` tag
### **yarn**

```sh
yarn add @acuarica/evm
yarn add sevm
```

### **npm**

```sh
npm install @acuarica/evm
npm install sevm
```

or to install globally in your system

```sh
npm install --global sevm
```

### **Browser <span class="tab-badge">WIP</span>**
Expand Down Expand Up @@ -182,6 +188,62 @@ web3.eth.getTransaction(

<!-- tabs:end -->

## `--help`

<!-- BEGIN:sevm --help -->
<!-- Autogenerated fenced code block DO NOT EDIT MANUALLY -->

```console
$ sevm --help
sevm <cmd> <contract>

Commands:
sevm metadata <contract> Shows the Metadata of the contract[1]
sevm abi <contract> Shows the ABI of the contract[2]
sevm dis <contract> Disassemble the bytecode into Opcodes
sevm cfg <contract> Writes the cfg of the selected function in `dot` for
mat into standard output
sevm sol <contract> Decompile the contract's bytecode into Solidity-like
source code
sevm yul <contract> Decompile the contract's bytecode into Yul-like sour
ce code[3]
sevm config Shows cache path used to store downloaded bytecode

Options:
--version Show version number [boolean]
--color Display with colors, use `--no-color` to deactivate colors
[boolean] [default: true]
-s, --selector Function signature, e.g., `balanceOf(address)` or selector has
h to choose a specific function [string]
--help Show help [boolean]

Examples:
sevm abi 0x00000000000C2E074eC69A0dFb299 shows the ABI of the ENS registry co
7BA6C7d2e1e ntract
sevm decompile 0x00000000000C2E074eC69A0 decompiles the ENS registry contract
dFb2997BA6C7d2e1e

[1] See https://docs.soliditylang.org/en/latest/metadata.html for more informati
on regarding Metadata generated by the Solidity compiler.
[2] See https://docs.soliditylang.org/en/latest/abi-spec.html#abi-json for more
information regarding the ABI specification.
[3] See https://docs.soliditylang.org/en/latest/yul.html for more information re
garding Yul.

At least one command must be specified

```

<!-- END:sevm --help -->

## EVM Bytecode Decompiler Signature & Topics Hashes _4byte_

Collection of Ethereum `function` and `event` signatures.
It looks up in the signature and events database for matching hashes.

When a matching `function` or `event` is found in a `Contract`,
it patches the `function` or `event` with the corresponding signature.

## Detached Fork

This GitHub repo was originally a fork of <https://github.com/MrLuit/evm>.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@
"make:ercs": "scripts/ercs.mjs > src/ercs.ts",
"make:4byte": "node scripts/4byte.mjs",
"make:help": "bin/sevm.mjs 2>&1 | MARKER='sevm --help' scripts/help.mjs README.md",
"make:docs": "cp README.md docs && typedoc --out docs/tsdoc src/index.ts src/ast/index.ts",
"prettier": "prettier --write .",
"prettier:staged": "pretty-quick --staged",
"docs": "http-server docs",
"tsdoc": "typedoc --out docs/tsdoc src/index.ts src/ast/index.ts",
"clean": "rm -r .solc/"
},
"engines": {
Expand Down

0 comments on commit 11e3f11

Please sign in to comment.