| Crates.io | abi2human |
| lib.rs | abi2human |
| version | 1.0.3 |
| created_at | 2025-08-06 12:10:27.497065+00 |
| updated_at | 2025-08-06 12:15:25.008698+00 |
| description | Zero-dependency CLI tool to convert Ethereum ABI JSON to human-readable format |
| homepage | https://github.com/yourusername/abi2human-rs |
| repository | https://github.com/yourusername/abi2human-rs |
| max_upload_size | |
| id | 1783711 |
| size | 53,375 |
A zero-dependency Rust implementation for converting Ethereum ABI to human-readable format.
cargo install abi2human
cargo build --release
The binary will be available at ./target/release/abi2human
# Output to stdout in JSON format
abi2human contract.json -o
# Raw text format (one function per line)
abi2human contract.json -or
# Compact JSON (no pretty printing)
abi2human contract.json -o --no-pretty
# Convert and save to a new file
abi2human input.json output.json
# Convert with custom suffix
abi2human input.json -s ".readable"
# Convert all JSON files in a directory
abi2human ./abis/ -d ./readable/
# Filter with pattern
abi2human ./abis/ -d ./readable/ -p "*.abi.json"
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
Input:
[
{
"type": "function",
"name": "transfer",
"inputs": [
{"name": "to", "type": "address"},
{"name": "amount", "type": "uint256"}
],
"outputs": [{"type": "bool"}],
"stateMutability": "nonpayable"
}
]
Output:
function transfer(address to, uint256 amount) returns (bool)
Input:
{
"type": "event",
"name": "Transfer",
"inputs": [
{"name": "from", "type": "address", "indexed": true},
{"name": "to", "type": "address", "indexed": true},
{"name": "value", "type": "uint256", "indexed": false}
]
}
Output:
event Transfer(address indexed from, address indexed to, uint256 value)
cargo test
# Debug build
cargo build
# Release build (optimized)
cargo build --release
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 testsThis implementation uses no external crates, providing:
MIT
Contributions are welcome! Please feel free to submit a Pull Request.