@wandevs/bytecode-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

bytecode-utils

Decode the CBOR encoded data at the end of an Ethereum contract's bytecode.

Install

yarn add @ethereum-sourcify/bytecode-utils

Usage

import { decode } from "@ethereum-sourcify/bytecode-utils";

const bytecodeRaw = "0x60806040526004361061003f5760003560e01...7265206c656e677468a2646970667358221220dceca8706b29e917dacf25fceef95acac8d90d765ac926663ce4096195952b6164736f6c634300060b0033"

decode(bytecodeRaw);

Result

{
  "cbor": {
    "bytes": "0xa2646970667358221220dceca8706b29e917dacf25fceef95acac8d90d765ac926663ce4096195952b6164736f6c634300060b",
    "length": 51
  },
  "ipfs": "QmdD3hpMj6mEFVy9DP4QqjHaoeYbhKsYvApX1YZNfjTVWp",
  "solcVersion": "0.6.11"
  "experimental": true
}

/@wandevs/bytecode-utils/

    Package Sidebar

    Install

    npm i @wandevs/bytecode-utils

    Weekly Downloads

    1

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    627 kB

    Total Files

    48

    Last publish

    Collaborators

    • zhwir
    • gabriel97
    • wanfans
    • mutouji