64 releases (11 stable)
Uses new Rust 2024
| 1.4.1 | Oct 14, 2025 |
|---|---|
| 1.3.1 | Aug 17, 2025 |
| 1.3.0 | Jul 22, 2025 |
| 1.0.0-rc.1 | Mar 26, 2025 |
| 0.3.1 | Jul 30, 2023 |
#20 in #ethereum
712,141 downloads per month
Used in 505 crates
(34 directly)
600KB
13K
SLoC
alloy-json-abi
Full Ethereum JSON-ABI implementation.
This crate is a re-implementation of a part of ethabi's API, with a few main differences:
- the
Contractstruct is now calledJsonAbiand also contains thefallbackandreceivefunctions - the
ParamandEventParamstructs only partially parse the type string instead of fully resolving it into a Solidity type
Examples
Parse a JSON ABI file into a JsonAbi struct:
use alloy_json_abi::JsonAbi;
# stringify!(
let path = "path/to/abi.json";
let json = std::fs::read_to_string(path).unwrap();
# );
# let json = "[]";
let abi: JsonAbi = serde_json::from_str(&json).unwrap();
for item in abi.items() {
println!("{item:?}");
}
Dependencies
~5.5–9MB
~181K SLoC