#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc as std;
pub mod constants;
pub mod eip170;
pub mod eip3860;
pub mod eip4844;
pub mod eip7702;
pub mod eip7708;
pub mod eip7823;
pub mod eip7825;
pub mod eip7907;
pub mod eip7954;
pub mod hardfork;
pub mod hints_util;
mod once_lock;
pub use constants::*;
pub use once_lock::OnceLock;
pub use alloy_primitives::{
self, address, b256, bytes, fixed_bytes, hex, hex_literal, keccak256,
map::{
self, hash_map, hash_set, indexmap, AddressIndexMap, AddressMap, AddressSet, B256Map,
HashMap, HashSet, IndexMap, U256Map,
},
ruint, uint, Address, Bytes, FixedBytes, Log, LogData, TxKind, B256, I128, I256, U128, U256,
};
pub type StorageKey = U256;
pub type StorageValue = U256;
pub type StorageKeyMap<V> = U256Map<V>;
pub const SHORT_ADDRESS_CAP: usize = 300;
#[inline]
pub fn short_address(address: &Address) -> Option<usize> {
if address[..18].iter().all(|b| *b == 0) {
let short_address = u16::from_be_bytes([address[18], address[19]]) as usize;
if short_address < SHORT_ADDRESS_CAP {
return Some(short_address);
}
}
None
}
pub const ONE_ETHER: u128 = 1_000_000_000_000_000_000;
pub const ONE_GWEI: u128 = 1_000_000_000;