🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@tact-lang/opcode

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tact-lang/opcode

TVM BoC disassembler

0.3.2
latest
Source
npm
Version published
Weekly downloads
5.9K
9.58%
Maintainers
2
Weekly downloads
 
Created
Source

TON Opcodes

A decompiler for The Open Network Virtual Machine (TVM) bytecode to Fift assembly.

Installation

yarn add @tact-lang/opcode

Usage

For most cases you will want to disassemble a BoC file generated by the Tact/FunC/Tolk compiler. In this case decompiler will unpack the dictionary to procedures and methods.

import {AssemblyWriter, disassembleRoot} from "@tact-lang/opcode"

// Disassemble a source file into a program AST
const program = disassembleRoot(source, {
    computeRefs: false,
})

// Write the program AST into a Fift assembly string
const res = AssemblyWriter.write(program, {})
console.log(res)

If you want to decompile BoC file without unpacking of the dictionary, you can do the following:

import {AssemblyWriter, disassembleRawRoot} from "@tact-lang/opcode"

const program = disassembleRawRoot(source)

const res = AssemblyWriter.write(program, {})
console.log(res)

If you want to disassemble a single Cell into an array of opcodes, you can do the following:

import {disassemble} from "@tact-lang/opcode"

const opcodes = disassemble({source: cell})

Thanks to

  • Steve Korshakov
  • Nick Nekilov
  • Vladimir Lebedev

License

MIT

FAQs

Package last updated on 11 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts