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

Download history 151246/week @ 2025-07-24 143112/week @ 2025-07-31 137017/week @ 2025-08-07 133680/week @ 2025-08-14 140385/week @ 2025-08-21 145874/week @ 2025-08-28 153820/week @ 2025-09-04 153591/week @ 2025-09-11 147096/week @ 2025-09-18 162487/week @ 2025-09-25 156322/week @ 2025-10-02 163285/week @ 2025-10-09 163453/week @ 2025-10-16 169687/week @ 2025-10-23 180245/week @ 2025-10-30 164193/week @ 2025-11-06

712,141 downloads per month
Used in 505 crates (34 directly)

MIT/Apache

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 Contract struct is now called JsonAbi and also contains the fallback and receive functions
  • the Param and EventParam structs 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