npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@youbox/debugger

v1.0.0-alpha.33

Published

Core functionality for debugging Solidity files built with YOUBox

Downloads

13

Readme

@youbox/debugger

Portable Solidity debugger library, for use with or without Truffle.

Debugger in Action

Features:

  • Solidity stepping and breakpoints
  • Variable inspection
  • Watch expressions
  • and more!

API Documentation

API Documentation for this library can be found at trufflesuite.github.io/truffle-debugger.

Library Usage

:warning: This documentation is currently a work in progress. Please see the reference integration provided by the truffle debug command.

Required Parameters

To start a @youbox/debugger session, you'll need the following:

  • txHash - A transaction hash (prefixed with 0x), for the transaction to debug
  • provider - A web3 provider instance (see web3.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)

Optionally (and recommended), you can also provide a files argument:

  • files - An array of sourcePaths representing file indexes (from solc or @youbox/compile-solidity)

Invocation

  1. Start the debugger session by constructing a Debugger instance with .forTx() and then .connect() to it:
import Debugger from "@youbox/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);

Useful API Docs References

Contributing

It's our goal that this library should serve as a reliable and well-maintained tool for the Solidity ecosystem. Ultimately, we hope to support all language features and meet the varied requirements of a mature debugging library.

We believe that a good Solidity debugger belongs to the community. We welcome, with our most humble gratitude, any and all community efforts in bringing this debugger closer to that goal. If you find something broken or missing, please open an issue!

Some other ideas for how to get involved:

  • Bug fix PRs
  • Documentation improvements
  • Additional tests - unit tests and integration
  • Technical discussion (ways to improve architecture, etc.)

Thank you for all the continued support. :bow: