neo_solidity/cli/bytecode/bytecode_helpers/
locals.rs

1fn emit_load_parameter(bytecode: &mut Vec<u8>, _method: &FunctionMetadata, index: usize) {
2    if index <= 6 {
3        bytecode.push(0x78 + index as u8);
4    } else {
5        bytecode.push(0x7F); // LDARG
6        bytecode.push(index as u8);
7    }
8}
9
10fn emit_load_local(bytecode: &mut Vec<u8>, index: usize) {
11    match index {
12        0..=6 => bytecode.push(0x68 + index as u8),
13        _ => {
14            bytecode.push(0x6F); // LDLOC
15            bytecode.push(index as u8);
16        }
17    }
18}
19
20fn emit_store_local(bytecode: &mut Vec<u8>, index: usize) {
21    match index {
22        0..=6 => bytecode.push(0x70 + index as u8),
23        _ => {
24            bytecode.push(0x77); // STLOC
25            bytecode.push(index as u8);
26        }
27    }
28}
29