1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
use fuel_types::{Bytes32, Word};
use std::mem;
pub const VM_REGISTER_COUNT: usize = 64;
pub const REG_ZERO: usize = 0x00;
pub const REG_ONE: usize = 0x01;
pub const REG_OF: usize = 0x02;
pub const REG_PC: usize = 0x03;
pub const REG_SSP: usize = 0x04;
pub const REG_SP: usize = 0x05;
pub const REG_FP: usize = 0x06;
pub const REG_HP: usize = 0x07;
pub const REG_ERR: usize = 0x08;
pub const REG_GGAS: usize = 0x09;
pub const REG_CGAS: usize = 0x0a;
pub const REG_BAL: usize = 0x0b;
pub const REG_IS: usize = 0x0c;
pub const REG_RET: usize = 0x0d;
pub const REG_RETL: usize = 0x0e;
pub const REG_FLAG: usize = 0x0f;
pub const REG_WRITABLE: usize = 0x10;
pub const WORD_SIZE: usize = mem::size_of::<Word>();
pub const FUEL_MAX_MEMORY_SIZE: u64 = 64;
pub const VM_MAX_RAM: u64 = 16 * 1024 * FUEL_MAX_MEMORY_SIZE * WORD_SIZE as u64;
pub const MEM_MAX_ACCESS_SIZE: u64 = VM_MAX_RAM;
pub const VM_MEMORY_BALANCES_OFFSET: usize = Bytes32::LEN;
pub const VM_REGISTER_WIDTH: u8 = 6;
pub const EMPTY_RECEIPTS_MERKLE_ROOT: [u8; 32] = [
0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41,
0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55,
];