Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pumpkinseed/libdisevm

EVM bytecode disassembler
https://github.com/pumpkinseed/libdisevm

blockchain disassembler evm smart-contracts

Last synced: about 2 months ago
JSON representation

EVM bytecode disassembler

Awesome Lists containing this project

README

        

# libdisevm

EVM bytecode disassembler

### Installation

```shell
go get github.com/PumpkinSeed/libdisevm
```

### Usage

```go
package main

import (
"fmt"

"github.com/PumpkinSeed/libdisevm"
)

func main() {
bytecode := "..."
opcodes, err := libdisevm.Disassemble(bytecode)
if err != nil {
panic(err)
}

formatter := libdisevm.NewFormatter(opcodes)

fmt.Println(formatter.SingleLine())
// Output: PUSH1 0x42 PUSH1 0x00 MSTORE PUSH1 0x20 PUSH1 0x00 RETURN

fmt.Println(formatter.MultiLine())
// Output:
// PUSH1 0x42
// PUSH1 0x00
// MSTORE
// PUSH1 0x20
// PUSH1 0x00
// RETURN
}
```