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

debug-solidity

v1.0.0

Published

Solidity library and related contracts for debugging contracts

Downloads

6

Readme

debug-solidity

Travis npm

Solidity library and related contracts for debugging contracts

API Reference

Installation & Usage

:warning: Do not use debug-solidity in production contracts. It is meant to aid in development and test environments.

Install using yarn/npm:

$ yarn add debug-solidity

Then, in your Solidity file, use the library:

import "debug-solidity/contracts/Debuggable.sol";
import "debug-solidity/contracts/DebugCounter.sol";

contract MyContract {

    using Debuggable for *;

    function myFunction() public {
        string valueString = "foobar";
        bytes32 valueBytes32 = 0x1234;
        uint256 valueUint256 = 1234;
        address valueAddress = address(0x0);

        valueString.debug();  // => emit DebugString(value: "foobar")
        valueBytes32.debug(); // => emit DebugBytes32(value: 0x1234)
        valueUint256.debug(); // => emit DebugUint256(value: 1234)
        valueAddress.debug(); // => emit DebugAddress(value: 0x0)

        Debuggable.debugRevert("msg");  // always reverts
        Debuggable.debugNoop();         // does nothing
        Debuggable.debugNoopConstant(); // does nothing (constant fn)

        DebugCounter counter = new DebugCounter("xyz");
        counter.increment(); // => emit DebugCount(name: "my counter", count: 1)
        counter.increment(); // => emit DebugCount(name: "my counter", count: 2)
        counter.increment(); // => emit DebugCount(name: "my counter", count: 3)
    }

}

Development

PRs welcome. To install dependencies and start the local development server:

$ yarn install
$ yarn run migrate
$ yarn start

Testing

$ yarn test
$ yarn watch

Regenerate documentation

$ npm run gen-docs

License

Licensed under Apache 2.0.

API Reference

Debuggable

Alexander Kern [email protected]

function debugRevert

Debuggable.debugRevert() pure 29b9505f

Reverts when called

function debug

Debuggable.debug(value) nonpayable 2f50fbfa

Emits a DebugString event with a string value

Inputs

| type | name | description | |-|-|-| | string | value | The string value |

function debugNoopConstant

Debuggable.debugNoopConstant() pure 58e8e8db

Does nothing (constant fn)

function debug

Debuggable.debug(value) nonpayable 6714a34e

Emits a DebugAddress event with an address value

Inputs

| type | name | description | |-|-|-| | address | value | The address value |

function debugRevert

Debuggable.debugRevert(message) pure 6a9b418f

Reverts with a message when called

Inputs

| type | name | description | |-|-|-| | string | message | The message |

function debug

Debuggable.debug(value) nonpayable 815dd951

Emits a DebugUint256 event with a uint256 value

Inputs

| type | name | description | |-|-|-| | uint256 | value | The uint256 value |

function debug

Debuggable.debug(value) nonpayable 9bb4050e

Emits a DebugBytes32 event with a bytes32 value

Inputs

| type | name | description | |-|-|-| | bytes32 | value | The bytes32 value |

function debugNoop

Debuggable.debugNoop() nonpayable eda892c1

Does nothing

event DebugString

Debuggable.DebugString(value) 20670ef4

Arguments

| type | name | description | |-|-|-| | string | value | not indexed |

event DebugBytes32

Debuggable.DebugBytes32(value) 110cb96f

Arguments

| type | name | description | |-|-|-| | bytes32 | value | not indexed |

event DebugUint256

Debuggable.DebugUint256(value) 43d4b470

Arguments

| type | name | description | |-|-|-| | uint256 | value | not indexed |

event DebugAddress

Debuggable.DebugAddress(value) e7375f84

Arguments

| type | name | description | |-|-|-| | address | value | not indexed |