pocketh

0.1.67 • Public • Published
_______________________________________________________________________________________/\\\_________        
 ____________________________________________/\\\______________________________________\/\\\_________       
  ___/\\\\\\\\\______________________________\/\\\____________________________/\\\______\/\\\_________      
   __/\\\/////\\\_____/\\\\\________/\\\\\\\\_\/\\\\\\\\________/\\\\\\\\___/\\\\\\\\\\\_\/\\\_________     
    _\/\\\\\\\\\\____/\\\///\\\____/\\\//////__\/\\\////\\\____/\\\/////\\\_\////\\\////__\/\\\\\\\\\\__    
     _\/\\\//////____/\\\__\//\\\__/\\\_________\/\\\\\\\\/____/\\\\\\\\\\\_____\/\\\______\/\\\/////\\\_   
      _\/\\\_________\//\\\__/\\\__\//\\\________\/\\\///\\\___\//\\///////______\/\\\_/\\__\/\\\___\/\\\_  
       _\/\\\__________\///\\\\\/____\///\\\\\\\\_\/\\\_\///\\\__\//\\\\\\\\\\____\//\\\\\___\/\\\___\/\\\_ 
        _\///_____________\/////________\////////__\///____\///____\//////////______\/////____\///____\///__

A pocket knife for developing and auditing smart contracts. Provides a series of cli commands that allow you to quickly operate on a contract, such as:

- getcode <deployedAddress> [targetFilePath] - Retrieves a contract's code from Etherscan.
- split <sourcePath> <outputDirectory> - Splits Solidity files.
- inheritance <contractPath> - Displays the inheritance tree of a contract.
- members <contractPath> - Lists all members of a contract.
- selectors <contractPath> - Lists all selectors of a contract.
- calldata <data> - Splits up calldata into a more readable format.
- blockdate <networkUrl> <blockHashOrNumber> - Gets the date of a block.
- txs <networkUrl> <contractAddress> <functionSelector> <fromBlock> [toBlock] [maxThreads] - Finds transactions.
- pastevents <networkUrl> <contractPath> <contractAddress> <eventName> <fromBlock> [toBlock] [batchSize] - Finds past events of a contract.
- disassemble <contractPath> - Disassembles bytecode to EVM opcodes.
- hex2str <hexString> - Converts hex to string.
- str2hex <asciiString> - Converts string to hex.
- transaction <networkUrl> <txHash> - Gets info about a transaction.
- block <networkUrl> [blockHashOrNumber] - Gets info about a block.
- info <networkUrlOrName> - Retrieves info about a network.
- hex2uint <hexString> - Converts hex to uint.
- uint2hex <decNumber> - Converts uint to hex.
- convert [value] [sourceDenom] [destDenom] - Converts between ether denominations.
- pad <value> [direction] [amount] [char] - Pads hex numbers.
- compile <sourcePath> <outputDirectory> [solcVersion] - Compiles single Solidity files.
- storage <networkUrl> <contractAddress> <storageSlot> - Reads the storage of a contract.
- liststorage <networkUrl> <contractPath> <contractAddress> - Reads the storage of a contract.
- checksum <address> - Checksums an address.
- selector <signature> - Calculates a selector.
- docyul [keyword] - Gets yul documentation.
- int2hex <decNumber> - Converts int to hex.
- hex2int <hexString> - Converts hex to int.

One script to rule them all!

Pocketh is basically a curated list of useful scripts, packed up in a commanderjs program.

On the fly compilation 🚀

Pocketh uses AST information for analysing contracts, but it doesn't require you to do any compilation at all. Whenever pocketh sees a Solidity file, it will compile it in background. Pocketh's compiler is super handy btw; it can compile anything, on the spot.

Installation:

npm install --global pocketh

Usage:

pocketh <command> [options]

Documentation:

Please refer to the inline documentation of the program for a list of available commands,

pocketh --help

or, for command specific documentation.

pocketh <command> --help

Contributing:

If you think of something useful that could be added to the tool, or have an idea, please don't hesitate to create a new issue with your feature request. Or, even better, go ahead and create a PR! Pocketh's architecture is intended to be as simple as possible so that it's super easy to add new scripts. Every command is pretty much a standalone script, with the exception of a few convenient tools that are shared between some of the commands.

Running tests

Make sure that you run npm run ganache before starting tests. Then run npm test.

Note: Unfortunately, pocketh currently requires an active internet connection for some of its tests, since some commands interact with public networks like mainnet and ropsten, and use public apis like Etherscan's api.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.672latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.672
0.1.660
0.1.650
0.1.640
0.1.630
0.1.620
0.1.610
0.1.600
0.1.590
0.1.580
0.1.571
0.1.560
0.1.550
0.1.541
0.1.530
0.1.521
0.1.510
0.1.500
0.1.490
0.1.480
0.1.471
0.1.460
0.1.450
0.1.441
0.1.430
0.1.420
0.1.410
0.1.400
0.1.390
0.1.380
0.1.370
0.1.360
0.1.350
0.1.340
0.1.330
0.1.320
0.1.310
0.1.300
0.1.290
0.1.270
0.1.260
0.1.250
0.1.240
0.1.230
0.1.220
0.1.210
0.1.200
0.1.191
0.1.170
0.1.160
0.1.150
0.1.140
0.1.130
0.1.120
0.1.110
0.1.100
0.1.90
0.1.80
0.1.70
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00

Package Sidebar

Install

npm i pocketh

Weekly Downloads

8

Version

0.1.67

License

ISC

Unpacked Size

676 kB

Total Files

103

Last publish

Collaborators

  • ajsantander