alloy-json-abi

Crates.ioalloy-json-abi
lib.rsalloy-json-abi
version1.3.1
created_at2023-07-04 10:26:07.575776+00
updated_at2025-08-17 10:03:33.925356+00
descriptionFull Ethereum JSON-ABI implementation
homepagehttps://github.com/alloy-rs/core/tree/main/crates/json-abi
repositoryhttps://github.com/alloy-rs/core
max_upload_size
id907884
size202,078
core (github:alloy-rs:core)

documentation

README

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:?}");
}
Commit count: 780

cargo fmt