arb_primitives/
arbos_versions.rs1use alloy_primitives::{Address, Bytes, address, bytes};
2
3pub const HISTORY_STORAGE_ADDRESS: Address = address!("0000F90827F1C53a10cb7A02335B175320002935");
5
6pub const HISTORY_STORAGE_CODE_ARBITRUM: Bytes = bytes!(
8 "3373fffffffffffffffffffffffffffffffffffffffe1460605760203603605c575f3563a3b1b31d5f5260205f6004601c60645afa15605c575f51600181038211605c57816205ffd0910311605c576205ffd09006545f5260205ff35b5f5ffd5b5f356205ffd0600163a3b1b31d5f5260205f6004601c60645afa15605c575f5103065500"
9);
10
11pub static PRECOMPILE_MIN_ARBOS_VERSIONS: &[(Address, u64)] = &[
16 (address!("0000000000000000000000000000000000000071"), 30),
18 (address!("0000000000000000000000000000000000000072"), 30),
20 (address!("0000000000000000000000000000000000000073"), 41),
22 (address!("0000000000000000000000000000000000000074"), 60),
24];
25
26#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
30#[repr(u64)]
31pub enum ArbOSVersion {
32 V1 = 1,
33 V2 = 2,
34 V3 = 3,
35 V4 = 4,
36 V5 = 5,
37 V10 = 10,
38 V11 = 11,
39 V20 = 20,
40 V30 = 30,
41 V31 = 31,
42 V32 = 32,
43 V40 = 40,
44 V41 = 41,
45 V50 = 50,
46 V51 = 51,
47 V60 = 60,
48}
49
50impl ArbOSVersion {
51 pub fn from_u64(v: u64) -> Option<Self> {
52 match v {
53 1 => Some(Self::V1),
54 2 => Some(Self::V2),
55 3 => Some(Self::V3),
56 4 => Some(Self::V4),
57 5 => Some(Self::V5),
58 10 => Some(Self::V10),
59 11 => Some(Self::V11),
60 20 => Some(Self::V20),
61 30 => Some(Self::V30),
62 31 => Some(Self::V31),
63 32 => Some(Self::V32),
64 40 => Some(Self::V40),
65 41 => Some(Self::V41),
66 50 => Some(Self::V50),
67 51 => Some(Self::V51),
68 60 => Some(Self::V60),
69 _ => None,
70 }
71 }
72
73 pub fn as_u64(self) -> u64 {
74 self as u64
75 }
76
77 pub fn is_orbit_reserved(version: u64) -> bool {
79 matches!(
80 version,
81 12..=19 | 21..=29 | 33..=39 | 42..=49 | 52..=59
82 )
83 }
84}