ERC-related utilities for the Rain Protocol ecosystem, in Rust.
erc165— Probe arbitrary contracts forIERC165support. The probe is spec-compliant: it distinguishes execution-revert results (treated as "interface not supported", per EIP-165) from genuine RPC / decoding errors (returned asErr). Works against anyalloy::providers::Provider.
[dependencies]
rain-erc = "0.1"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
}Requires Nix with flakes:
nix develop # default = rust-shell (slim Rust toolchain)
nix develop -c cargo test
nix develop -c cargo clippyCI runs via rainlanguage/rainix reusable workflows.
CAL-1.0.