Crates.io | alloy-json-abi |
lib.rs | alloy-json-abi |
version | |
source | src |
created_at | 2023-07-04 10:26:07.575776 |
updated_at | 2024-12-09 12:43:26.444753 |
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 |
Cargo.toml error: | TOML parse error at line 20, column 1 | 20 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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:?}");
}