From 2575edb0a7db872a51a1a1d7dec4bfbc4074dab5 Mon Sep 17 00:00:00 2001 From: David Meister Date: Sat, 23 May 2026 08:10:02 +0000 Subject: [PATCH] docs: README for rain-erc 0.1.0 Rust-only crate Closes #22. Co-Authored-By: Claude Opus 4.7 --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 333c63a..f624574 100644 --- a/README.md +++ b/README.md @@ -1 +1,53 @@ -# rain.erc \ No newline at end of file +# rain-erc + +ERC-related utilities for the Rain Protocol ecosystem, in Rust. + +[![crates.io](https://img.shields.io/crates/v/rain-erc.svg)](https://crates.io/crates/rain-erc) +[![docs.rs](https://docs.rs/rain-erc/badge.svg)](https://docs.rs/rain-erc) + +## What's here + +- `erc165` — Probe arbitrary contracts for `IERC165` support. The probe is + spec-compliant: it distinguishes execution-revert results (treated as + "interface not supported", per + [EIP-165](https://eips.ethereum.org/EIPS/eip-165)) from genuine RPC / decoding + errors (returned as `Err`). Works against any `alloy::providers::Provider`. + +## Install + +```toml +[dependencies] +rain-erc = "0.1" +``` + +## Use + +```rust +use alloy::primitives::Address; +use alloy::providers::ProviderBuilder; +use rain_erc::erc165::supports_erc165; + +let provider = ProviderBuilder::new().connect_http("https://...".parse()?); +let contract: Address = "0x...".parse()?; + +if supports_erc165(&provider, contract).await? { + // contract responds correctly to ERC-165 probes +} +``` + +## Develop + +Requires Nix with flakes: + +```sh +nix develop # default = rust-shell (slim Rust toolchain) +nix develop -c cargo test +nix develop -c cargo clippy +``` + +CI runs via [rainlanguage/rainix](https://github.com/rainlanguage/rainix) +reusable workflows. + +## License + +CAL-1.0.