Skip to content

Files

This branch is 366 commits behind ethereum/sourcify:staging.

bytecode-utils

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jun 25, 2024
Jun 25, 2024
Jun 12, 2024
Jun 12, 2024
Jul 25, 2024
Nov 16, 2022
Nov 16, 2022
Aug 14, 2024
Jun 12, 2024
Nov 16, 2022

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
}