rgb/vm/
opcodes.rs

1// RGB Core Library: consensus layer for RGB smart contracts.
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5// Written in 2019-2023 by
6//     Dr Maxim Orlovsky <orlovsky@lnp-bp.org>
7//
8// Copyright (C) 2019-2023 LNP/BP Standards Association. All rights reserved.
9// Copyright (C) 2019-2023 Dr Maxim Orlovsky. All rights reserved.
10//
11// Licensed under the Apache License, Version 2.0 (the "License");
12// you may not use this file except in compliance with the License.
13// You may obtain a copy of the License at
14//
15//     http://www.apache.org/licenses/LICENSE-2.0
16//
17// Unless required by applicable law or agreed to in writing, software
18// distributed under the License is distributed on an "AS IS" BASIS,
19// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20// See the License for the specific language governing permissions and
21// limitations under the License.
22
23#![allow(clippy::unusual_byte_groupings)]
24
25// CONTRACTS:
26pub const INSTR_CNP: u8 = 0b11_000_000;
27pub const INSTR_CNS: u8 = 0b11_000_001;
28pub const INSTR_CNG: u8 = 0b11_000_010;
29pub const INSTR_CNC: u8 = 0b11_000_011;
30
31pub const INSTR_LDP: u8 = 0b11_000_100;
32pub const INSTR_LDS: u8 = 0b11_000_101;
33pub const INSTR_LDF: u8 = 0b11_000_110;
34// Reserved 0b11_000_111
35
36pub const INSTR_LDG: u8 = 0b11_001_000;
37pub const INSTR_LDC: u8 = 0b11_001_001;
38pub const INSTR_LDM: u8 = 0b11_001_010;
39// Reserved 0b11_001_111
40
41pub const INSTR_PCVS: u8 = 0b11_010_000;
42pub const INSTR_PCCS: u8 = 0b11_010_001;
43// Reserved 0b11_010_010
44// Reserved 0b11_010_011
45
46// Reserved 0b11_011_100
47// Reserved 0b11_011_101
48// Reserved 0b11_011_110
49// Reserved 0b11_011_111
50
51// TIMECHAIN:
52
53// DATA:
54
55// NB: For now we prohibit all other ISAE than this one. More ISAEs can be
56// allowed in a future with fast-forwards.
57pub use aluvm::isa::opcodes::{INSTR_ISAE_FROM, INSTR_ISAE_TO};
58// pub const INSTR_ISAE_FROM: u8 = 0b11_000_000;
59// pub const INSTR_ISAE_TO: u8 = 0b11_000_000;