Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ethereum-transaction-debugger

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethereum-transaction-debugger

Solidity debugger library

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-88.89%
Maintainers
1
Weekly downloads
 
Created
Source

Solidity debugger library

Required Parameters

To start the debugger session, you'll need the following parameters:

  • txHash - A transaction hash (prefixed with 0x), for the transaction to debug

  • provider - A ethers.js provider instance (see ethers.js)

  • contracts - An array of contract objects, with the following properties:

    • contractName - The name of the contract
    • source - The full Solidity source code
    • sourcePath - (optional) the path to the Solidity file on disk
    • ast - The Solidity compiler's output AST (new style, not legacyAST)
    • binary - 0x-prefixed string with the binary used to create a contract instance
    • sourceMap - The Solidity compiler output source map for the creation binary
    • deployedBinary - 0x-prefixed string with the on-chain binary for a contract instance
    • deployedSourceMap - The source map corresponding to the on-chain binary (from the Solidity compiler)
  • files - An array of sourcePaths representing file indexes (For example: /Users/username/etherlimeProject/contracts/LimeFactory.sol)

Run

  1. Start the debugger session by constructing a Debugger instance with .forTx() and then .connect() to it:
import Debugger from "ethereum-transaction-debugger";

let bugger = await Debugger
  .forTx(txHash, { contracts, files, provider });

let session = bugger.connect();
  1. Resolve the session's ready() promise:
await session.ready();
  1. Use the provided public methods on the session instance in order to step through the trace for the transaction:
session.stepNext();
session.stepOver();
session.stepInto();
  1. Access data provided by the debugger via the session.view() interface, and the provided selectors:
let { ast, data, evm, solidity, trace } = Debugger.selectors;

let variables = session.view(data.current.identifiers.native);
let sourceRange = session.view(solidity.current.sourceRange);

License

MIT (c) 2019 Truffle, LimeChain LTD

FAQs

Package last updated on 19 Mar 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc