MCPcopy Index your code
hub / github.com/alloy-rs/core

github.com/alloy-rs/core @v1.6.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.6.0 ↗ · + Follow
2,758 symbols 6,030 edges 254 files 394 documented · 14%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Alloy

Core libraries at the root of the Rust Ethereum ecosystem.

Alloy is a rewrite of [ethers-rs] from the ground up, with exciting new features, high performance, and excellent docs.

We have a book on all things Alloy and many examples to help you get started.

[ethers-rs] has been deprecated, and users are recommended to migrate to Alloy.

Build Status Telegram chat

Overview

This repository contains the following crates:

  • [alloy-core]: Meta-crate for the entire project
  • [alloy-primitives] - Primitive integer and byte types
  • [alloy-sol-types] - Compile-time ABI and EIP-712 implementations
  • [alloy-sol-macro] - The [sol!] procedural macro
  • [alloy-dyn-abi] - Run-time ABI and EIP-712 implementations
  • [alloy-json-abi] - Full Ethereum JSON-ABI implementation
  • [alloy-sol-type-parser] - A simple parser for Solidity type strings
  • [syn-solidity] - [syn]-powered Solidity parser

Supported Rust Versions (MSRV)

The current MSRV (minimum supported rust version) is 1.85.

Alloy will keep a rolling MSRV policy of at least two versions behind the latest stable release (so if the latest stable release is 1.58, we would support 1.56).

Note that the MSRV is not increased automatically, and only as part of a patch (pre-1.0) or minor (post-1.0) release.

Contributing

Thanks for your help improving the project! We are so happy to have you! We have a contributing guide to help you get involved in the Alloy project.

Pull requests will not be merged unless CI passes, so please ensure that your contribution follows the linting rules and passes clippy.

WASM support

We provide full support for all the wasm*-* targets. If a crate does not build on a WASM target, please open an issue.

When building for the wasm32-unknown-unknown target and the "getrandom" feature is enabled, compilation for the getrandom crate will fail. This is expected: see their documentation for more details.

To fix this, either disable the "getrandom" feature on alloy-core or add getrandom to your dependencies with the "wasm_js" feature enabled:

getrandom = { version = "0.4", features = ["wasm_js"] }

There is currently no plan to provide an official JS/TS-accessible library interface, as we believe viem or ethers.js serve that need very well.

Note on no_std

All crates in this workspace should support no_std environments, with the alloc crate. If you find a crate that does not support no_std, please open an issue.

Credits

None of these crates would have been possible without the great work done in:

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in these crates by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Extension points exported contracts — how you extend this code

ParseNested (Interface)
Helper trait to parsing nested expressions. [7 implementers]
crates/syn-solidity/src/utils.rs
Specifier (Interface)
Trait for items that can be resolved to `DynSol*`, i.e. they specify some Solidity interface item. The `Specifier` trai [12 …
crates/dyn-abi/src/specifier.rs
ContainsSolAttrs (Interface)
Trait for items that contain `#[sol(...)]` attributes among other attributes. This is usually a shortcut for [`SolAttrs [8 …
crates/sol-macro-input/src/attr.rs
Verbatim (Interface)
Conversion to tokens that represent the value itself. [7 implementers]
crates/sol-macro-expander/src/verbatim.rs
SolTypeValue (Interface)
An ABI-encodable is any type that may be encoded via a given `SolType`. The `SolType` trait contains encoding logic for [16 …
crates/sol-types/src/lib.rs
ToSol (Interface)
(no doc) [10 implementers]
crates/json-abi/src/to_sol.rs
IntoLogData (Interface)
Trait for an object that can be converted into a log data object. [2 implementers]
crates/primitives/src/log/mod.rs
Spanned (Interface)
A trait that can provide the `Span` of the complete contents of a syntax tree node. The main difference between this tr [108 …
crates/syn-solidity/src/spanned.rs

Core symbols most depended-on inside this repo

write_str
called by 137
crates/sol-types/src/types/data_type.rs
len
called by 130
crates/json-abi/src/abi.rs
finish
called by 95
crates/sol-types/src/abi/encoder.rs
clone
called by 79
crates/sol-types/src/types/interface/mod.rs
peek
called by 74
crates/syn-solidity/src/lit/mod.rs
len
called by 65
crates/sol-types/src/types/interface/mod.rs
parse
called by 60
crates/syn-solidity/src/lib.rs
to_string
called by 52
crates/dyn-abi/src/dynamic/ty.rs

Shape

Method 1,663
Function 788
Class 207
Enum 59
Interface 41

Languages

Rust100%
Python1%
C1%

Modules by API surface

crates/primitives/src/signed/ops.rs75 symbols
crates/sol-macro-expander/src/expand/mod.rs68 symbols
crates/primitives/src/signed/int.rs68 symbols
crates/primitives/src/signature/sig.rs61 symbols
crates/sol-types/src/abi/encoder.rs58 symbols
crates/dyn-abi/src/coerce.rs54 symbols
crates/primitives/src/bits/fixed.rs52 symbols
crates/dyn-abi/src/eip712/resolver.rs51 symbols
crates/sol-types/src/abi/decoder.rs46 symbols
crates/sol-types/tests/macros/sol/mod.rs45 symbols
crates/json-abi/src/abi.rs45 symbols
crates/sol-types/src/types/interface/mod.rs43 symbols

For agents

$ claude mcp add core \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact