linera-alloy-json-abi

Crates.iolinera-alloy-json-abi
lib.rslinera-alloy-json-abi
version0.7.4
sourcesrc
created_at2024-05-30 20:02:21.021361
updated_at2024-05-30 20:02:21.021361
descriptionFull Ethereum JSON-ABI implementation
homepagehttps://github.com/MathieuDutSik/ethreum_core/tree/main/crates/json-abi
repositoryhttps://github.com/MathieuDutSik/ethreum_core
max_upload_size
id1257225
size124,370
Mathieu Baudet (ma2bd)

documentation

README

linera-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 linera_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: 520

cargo fmt