revm_optimism/
constants.rs

1use revm::primitives::{address, Address, U256};
2
3pub const ZERO_BYTE_COST: u64 = 4;
4pub const NON_ZERO_BYTE_COST: u64 = 16;
5
6/// The two 4-byte Ecotone fee scalar values are packed into the same storage slot as the 8-byte sequence number.
7/// Byte offset within the storage slot of the 4-byte baseFeeScalar attribute.
8pub const BASE_FEE_SCALAR_OFFSET: usize = 16;
9/// The two 4-byte Ecotone fee scalar values are packed into the same storage slot as the 8-byte sequence number.
10/// Byte offset within the storage slot of the 4-byte blobBaseFeeScalar attribute.
11pub const BLOB_BASE_FEE_SCALAR_OFFSET: usize = 20;
12
13/// The Isthmus operator fee scalar values are similarly packed. Byte offset within
14/// the storage slot of the 4-byte operatorFeeScalar attribute.
15pub const OPERATOR_FEE_SCALAR_OFFSET: usize = 20;
16/// The Isthmus operator fee scalar values are similarly packed. Byte offset within
17/// the storage slot of the 8-byte operatorFeeConstant attribute.
18pub const OPERATOR_FEE_CONSTANT_OFFSET: usize = 24;
19
20/// The fixed point decimal scaling factor associated with the operator fee scalar.
21///
22/// Allows users to use 6 decimal points of precision when specifying the operator_fee_scalar.
23pub const OPERATOR_FEE_SCALAR_DECIMAL: u64 = 1_000_000;
24
25pub const L1_BASE_FEE_SLOT: U256 = U256::from_limbs([1u64, 0, 0, 0]);
26pub const L1_OVERHEAD_SLOT: U256 = U256::from_limbs([5u64, 0, 0, 0]);
27pub const L1_SCALAR_SLOT: U256 = U256::from_limbs([6u64, 0, 0, 0]);
28
29/// [ECOTONE_L1_BLOB_BASE_FEE_SLOT] was added in the Ecotone upgrade and stores the L1 blobBaseFee attribute.
30pub const ECOTONE_L1_BLOB_BASE_FEE_SLOT: U256 = U256::from_limbs([7u64, 0, 0, 0]);
31
32/// As of the ecotone upgrade, this storage slot stores the 32-bit basefeeScalar and blobBaseFeeScalar attributes at
33/// offsets [BASE_FEE_SCALAR_OFFSET] and [BLOB_BASE_FEE_SCALAR_OFFSET] respectively.
34pub const ECOTONE_L1_FEE_SCALARS_SLOT: U256 = U256::from_limbs([3u64, 0, 0, 0]);
35
36/// This storage slot stores the 32-bit operatorFeeScalar and operatorFeeConstant attributes at
37/// offsets [OPERATOR_FEE_SCALAR_OFFSET] and [OPERATOR_FEE_CONSTANT_OFFSET] respectively.
38pub const OPERATOR_FEE_SCALARS_SLOT: U256 = U256::from_limbs([8u64, 0, 0, 0]);
39
40/// An empty 64-bit set of scalar values.
41pub const EMPTY_SCALARS: [u8; 8] = [0u8; 8];
42
43/// The address of L1 fee recipient.
44pub const L1_FEE_RECIPIENT: Address = address!("420000000000000000000000000000000000001A");
45
46/// The address of the operator fee recipient.
47pub const OPERATOR_FEE_RECIPIENT: Address = address!("420000000000000000000000000000000000001B");
48
49/// The address of the base fee recipient.
50pub const BASE_FEE_RECIPIENT: Address = address!("4200000000000000000000000000000000000019");
51
52/// The address of the L1Block contract.
53pub const L1_BLOCK_CONTRACT: Address = address!("4200000000000000000000000000000000000015");