alloy-best-practices
Installation
SKILL.md
Alloy best practices
Use when building or reviewing Rust code that interacts with Ethereum or other EVM chains via Alloy.
Mental model
- Alloy is a modular Rust toolkit for EVM chains, not just one monolithic crate.
- Prefer the smallest set of crates and features that matches the use case. The meta-crate is convenient for quick starts, but larger codebases often benefit from more selective dependencies.
- Keep chain interaction boundaries explicit: provider setup, signer ownership, contract binding, and transaction building should each be easy to reason about.
Dependency and feature selection
- Start with the
alloymeta-crate when you need a quick working setup. - For larger or compile-time-sensitive projects, consider pulling in only the specific crates you need instead of defaulting to the full meta-crate surface.
- Review feature flags intentionally. Alloy exposes many features, and careless defaults can increase build times and dependency weight.
- Pin versions deliberately and check the current MSRV before adopting the latest release in a workspace.