| Crates.io | riglr-evm-common |
| lib.rs | riglr-evm-common |
| version | 0.3.0 |
| created_at | 2025-09-10 18:15:40.457065+00 |
| updated_at | 2025-09-10 18:15:40.457065+00 |
| description | Common EVM utilities shared across Riglr crates |
| homepage | https://github.com/riglr/riglr |
| repository | https://github.com/riglr/riglr |
| max_upload_size | |
| id | 1832831 |
| size | 244,962 |
Common EVM utilities shared across the Riglr workspace.
This crate provides a single source of truth for EVM-related functionality that is shared between multiple crates in the Riglr workspace. It eliminates code duplication and ensures consistent behavior across all EVM operations.
Add this to your Cargo.toml:
[dependencies]
riglr-evm-common = { path = "../riglr-evm-common" }
Then use the utilities in your code:
use riglr_evm_common::{
parse_evm_address,
validate_evm_address,
eth_to_wei,
chain_id_to_name,
EvmConfig,
};
// Parse and validate addresses
let address = parse_evm_address("0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb5")?;
// Convert between units
let wei_amount = eth_to_wei("1.5")?;
// Get chain information
let chain_name = chain_id_to_name(1)?; // "Ethereum"
This crate is designed to be:
MIT OR Apache-2.0