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

cryptoprof

v0.2.0

Published

Gas profiler for Ethereum smart contracts

Downloads

2

Readme

cryptoprof

Gas profiler for Ethereum smart contracts


What is this?

cryptoprof profiles the gas usage of smart contracts. It can help with:

  • debugging smart contracts

  • evaluating dapp feasibility

  • evaluating dapp security

  • choosing implementations of smart contract standards

You can find more information about these use cases in the rationale document.

Getting started

Requirements

Installing the profiler

Global install

If you want to install it globally:

npm install -g cryptoprof

after which it should be available globally as cryptoprof. You can verify this using:

cryptoprof --help

Local install

If you want to install it locally to some npm package:

npm install cryptoprof

after which it should be available in that package's node_modules/.bin directory. You can verify this from the directory containing that package by running:

./node_modules/.bin/cryptoprof --help

Using the profiler

In order to use cryptoprof, you have to point it at some sample smart contracts. If you just want to try it out, you can run it against the ERC20 contracts that are used in the cryptoprof tests. These contracts can be found in the node_modules folder into which you installed cryptoprof.

Let us say your cryptoprof as installed into the node_modules directory in the $NODE_MODULES_PARENT directory. Then, to test cryptoprof against the test ERC20 contracts, run:

cryptoprof -t erc20 \
  --contract-specs ${NODE_MODULES_PARENT}/node_modules/cryptoprof/test/contracts/consensys/EIP20.sol:EIP20,1200000,ConsensysERC20,1,CON \
                   ${NODE_MODULES_PARENT}/node_modules/cryptoprof/test/contracts/consensys/CrappyEIP20.sol:EIP20,1200000,CrappyERC20Token,1,CRP

This should yield a table similar to the one in the following image: cryptoprof sample

Contributions

If you'd like to contribute to cryptoprof, just open up a pull request. The guidelines are very light:

  1. Work off of your own fork of this repository, and open up a pull request into master when you are ready. Give your pull request an informative description.

  2. Make sure that the tests pass: npm test. (Bonus points for adding tests.)

  3. Add one of the maintainers of this repository (nkashy1 for now) as a reviewer on the pull request.

Also, feel free to create issues as you find them. Your contributions are very much welcome.