1#![deny(unsafe_code)]
15#![warn(missing_docs)]
16
17use alloy_primitives::{Address, U256};
18
19pub const ZERO_ADDRESS: Address = Address::ZERO;
23
24pub const ZERO_HASH: &str = "0x0000000000000000000000000000000000000000000000000000000000000000";
26
27pub const ZERO: U256 = U256::ZERO;
29
30pub const ONE: U256 = U256::from_limbs([1, 0, 0, 0]);
32
33pub const MAX_UINT32: U256 = U256::from_limbs([u32::MAX as u64, 0, 0, 0]);
35
36pub const MAX_UINT256: U256 = U256::MAX;
38
39pub const HUNDRED_THOUSANDS: u64 = 100_000;
41
42pub const ONE_HUNDRED_BPS: u64 = 10_000;
44
45pub const LIMIT_CONCURRENT_REQUESTS: u32 = 5;
47
48pub const ATTESTATION_PREFIX_CONST: &str = "0x0a773570";
50
51pub const ATTESTION_VERSION_BYTE: &str = "0x00";
53
54pub const ATTESTATOR_ADDRESS: Address = Address::new([
58 0x00, 0x73, 0xdd, 0x10, 0x0b, 0x51, 0xc5, 0x55, 0xe4, 0x1b, 0x2a, 0x45, 0x2e, 0x59, 0x33, 0xef,
59 0x76, 0xf4, 0x27, 0x90,
60]);
61
62#[cfg(test)]
63mod tests {
64 use super::*;
65
66 #[test]
67 fn constants_are_correct() {
68 assert!(ZERO_ADDRESS.is_zero());
69 assert_eq!(ZERO, U256::ZERO);
70 assert_eq!(ONE, U256::from(1));
71 assert_eq!(MAX_UINT32, U256::from(u32::MAX));
72 assert_eq!(MAX_UINT256, U256::MAX);
73 assert_eq!(ONE_HUNDRED_BPS, 10_000);
74 assert_eq!(HUNDRED_THOUSANDS, 100_000);
75 assert_eq!(LIMIT_CONCURRENT_REQUESTS, 5);
76 }
77
78 #[test]
79 fn zero_hash_is_correct_length() {
80 assert_eq!(ZERO_HASH.len(), 66); assert!(ZERO_HASH.starts_with("0x"));
82 }
83
84 #[test]
85 fn attestator_address_is_nonzero() {
86 assert!(!ATTESTATOR_ADDRESS.is_zero());
87 }
88}