Reference

ethers-rs has been deprecated in favor of Alloy and Foundry.

The following is a reference guide for finding the migration path for your specific crate, dependency or information source.

Documentation

Examples

Crates

Types

Primitives

Due to a limitation in ruint, BigEndianHash ethers::types::BigEndianHash can be expressed as follows:

// `U256` => `B256`
let x = B256::from(u256);

// `B256` => `U256`
let x: U256 = b256.into();
let x = U256::from_be_bytes(b256.into())

Due to Rust issue #50133, the native TryFrom trait is not supported for Uints. Instead, use UintTryFrom as follows:

use alloy_primitives::ruint::UintTryFrom;

let x: U512 = uint!(1234_U512);
let y: U256 = U256::uint_try_from(x).unwrap();

RPC

ABI