#![deny(unsafe_code)]
#![warn(missing_docs)]
use alloy_primitives::{Address, U256};
pub const ZERO_ADDRESS: Address = Address::ZERO;
pub const ZERO_HASH: &str = "0x0000000000000000000000000000000000000000000000000000000000000000";
pub const ZERO: U256 = U256::ZERO;
pub const ONE: U256 = U256::from_limbs([1, 0, 0, 0]);
pub const MAX_UINT32: U256 = U256::from_limbs([u32::MAX as u64, 0, 0, 0]);
pub const MAX_UINT256: U256 = U256::MAX;
pub const HUNDRED_THOUSANDS: u64 = 100_000;
pub const ONE_HUNDRED_BPS: u64 = 10_000;
pub const LIMIT_CONCURRENT_REQUESTS: u32 = 5;
pub const ATTESTATION_PREFIX_CONST: &str = "0x0a773570";
pub const ATTESTION_VERSION_BYTE: &str = "0x00";
pub const ATTESTATOR_ADDRESS: Address = Address::new([
0x00, 0x73, 0xdd, 0x10, 0x0b, 0x51, 0xc5, 0x55, 0xe4, 0x1b, 0x2a, 0x45, 0x2e, 0x59, 0x33, 0xef,
0x76, 0xf4, 0x27, 0x90,
]);
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn constants_are_correct() {
assert!(ZERO_ADDRESS.is_zero());
assert_eq!(ZERO, U256::ZERO);
assert_eq!(ONE, U256::from(1));
assert_eq!(MAX_UINT32, U256::from(u32::MAX));
assert_eq!(MAX_UINT256, U256::MAX);
assert_eq!(ONE_HUNDRED_BPS, 10_000);
assert_eq!(HUNDRED_THOUSANDS, 100_000);
assert_eq!(LIMIT_CONCURRENT_REQUESTS, 5);
}
#[test]
fn zero_hash_is_correct_length() {
assert_eq!(ZERO_HASH.len(), 66); assert!(ZERO_HASH.starts_with("0x"));
}
#[test]
fn attestator_address_is_nonzero() {
assert!(!ATTESTATOR_ADDRESS.is_zero());
}
}