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