| Crates.io | alloy-json-abi |
| lib.rs | alloy-json-abi |
| version | 1.3.1 |
| created_at | 2023-07-04 10:26:07.575776+00 |
| updated_at | 2025-08-17 10:03:33.925356+00 |
| description | Full Ethereum JSON-ABI implementation |
| homepage | https://github.com/alloy-rs/core/tree/main/crates/json-abi |
| repository | https://github.com/alloy-rs/core |
| max_upload_size | |
| id | 907884 |
| size | 202,078 |
Full Ethereum JSON-ABI implementation.
This crate is a re-implementation of a part of ethabi's API, with a few main differences:
Contract struct is now called JsonAbi and also contains the fallback
and receive functionsParam and EventParam structs only partially parse the type string
instead of fully resolving it into a Solidity typeParse 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:?}");
}