abi2human-1.0.2 is not a library.
abi2human
A zero-dependency Rust implementation for converting Ethereum ABI to human-readable format.
Features
- ๐ Zero Dependencies: Pure Rust implementation with no external dependencies
- ๐ Human-Readable Output: Convert complex ABI JSON to readable function signatures
- ๐ฏ Multiple Output Formats: JSON array, raw text, or compact JSON
- ๐ Batch Processing: Convert single files or entire directories
- ๐งช Well Tested: Comprehensive test suite included
- โก Fast: Optimized Rust performance
Installation
The binary will be available at ./target/release/abi2human
Usage
Quick ABI Inspection
# Output to stdout in JSON format
# Raw text format (one function per line)
# Compact JSON (no pretty printing)
File Conversion
# Convert and save to a new file
# Convert with custom suffix
Batch Directory Processing
# Convert all JSON files in a directory
# Filter with pattern
Command Line Options
OPTIONS:
-o, --stdout Output to stdout
-r, --raw Output raw text format instead of JSON
-h, --help Show help message
-v, --version Show version
-q, --quiet Suppress non-output messages
-d, --dir Process directory
-p, --pattern Glob pattern for filtering files
-s, --suffix Custom suffix for output files (default: ".readable")
--no-pretty Disable pretty-printing
Examples
ERC20 Token ABI
Input:
Output:
function transfer(address to, uint256 amount) returns (bool)
Event Example
Input:
Output:
event Transfer(address indexed from, address indexed to, uint256 value)
Supported ABI Types
- โ Functions (view, pure, payable, nonpayable)
- โ Events (with indexed parameters)
- โ Constructors
- โ Fallback functions
- โ Receive functions
Development
Running Tests
Building
# Debug build
# Release build (optimized)
Architecture
The project is organized into several modules:
abi.rs- ABI data structures and formattingjson_parser.rs- Custom JSON parser implementationconverter.rs- Core conversion logicfile_ops.rs- File and directory operationsmain.rs- CLI entry point and argument parsingtests.rs- Unit tests
Why Zero Dependencies?
This implementation uses no external crates, providing:
- Security: No supply chain vulnerabilities from dependencies
- Simplicity: Easy to audit and understand
- Portability: Works anywhere Rust compiles
- Stability: No breaking changes from dependency updates
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.