1use steel::*;
2
3#[repr(u8)]
4#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
5pub enum OreInstruction {
6 Automate = 0,
8 Checkpoint = 2,
9 ClaimSOL = 3,
10 ClaimORE = 4,
11 Close = 5,
12 Deploy = 6,
13 Log = 8,
14 Reset = 9,
15 ReloadSOL = 21,
16
17 Buyback = 13,
19 Bury = 24,
20 Wrap = 14,
21 SetAdmin = 15,
22 NewVar = 19,
23 Liq = 25,
24
25 Migrate = 100,
27}
28
29#[repr(C)]
30#[derive(Clone, Copy, Debug, Pod, Zeroable)]
31pub struct Automate {
32 pub amount: [u8; 8],
33 pub deposit: [u8; 8],
34 pub fee: [u8; 8],
35 pub mask: [u8; 8],
36 pub strategy: u8,
37 pub reload: [u8; 8],
38}
39
40#[repr(C)]
41#[derive(Clone, Copy, Debug, Pod, Zeroable)]
42pub struct ClaimSOL {}
43
44#[repr(C)]
45#[derive(Clone, Copy, Debug, Pod, Zeroable)]
46pub struct ClaimORE {}
47
48#[repr(C)]
49#[derive(Clone, Copy, Debug, Pod, Zeroable)]
50pub struct Deploy {
51 pub amount: [u8; 8],
52 pub squares: [u8; 4],
53}
54
55#[repr(C)]
56#[derive(Clone, Copy, Debug, Pod, Zeroable)]
57pub struct Log {}
58
59#[repr(C)]
60#[derive(Clone, Copy, Debug, Pod, Zeroable)]
61pub struct Reset {}
62
63#[repr(C)]
64#[derive(Clone, Copy, Debug, Pod, Zeroable)]
65pub struct Mine {
66 pub nonce: [u8; 8],
67}
68
69#[repr(C)]
70#[derive(Clone, Copy, Debug, Pod, Zeroable)]
71pub struct Swap {
72 pub amount: [u8; 8],
73 pub direction: u8,
74 pub precision: u8,
75 pub seed: [u8; 32],
76}
77
78#[repr(C)]
79#[derive(Clone, Copy, Debug, Pod, Zeroable)]
80pub struct Uncommit {
81 pub amount: [u8; 8],
82}
83
84#[repr(C)]
85#[derive(Clone, Copy, Debug, Pod, Zeroable)]
86pub struct SetAdmin {
87 pub admin: [u8; 32],
88}
89
90#[repr(C)]
91#[derive(Clone, Copy, Debug, Pod, Zeroable)]
92pub struct SetFeeCollector {
93 pub fee_collector: [u8; 32],
94}
95
96#[repr(C)]
97#[derive(Clone, Copy, Debug, Pod, Zeroable)]
98pub struct SetFeeRate {
99 pub fee_rate: [u8; 8],
100}
101
102#[repr(C)]
103#[derive(Clone, Copy, Debug, Pod, Zeroable)]
104pub struct Wrap {
105 pub amount: [u8; 8],
106}
107
108#[repr(C)]
109#[derive(Clone, Copy, Debug, Pod, Zeroable)]
110pub struct Buyback {}
111
112#[repr(C)]
113#[derive(Clone, Copy, Debug, Pod, Zeroable)]
114pub struct Bury {
115 pub amount: [u8; 8],
116}
117
118#[repr(C)]
119#[derive(Clone, Copy, Debug, Pod, Zeroable)]
120pub struct ReloadSOL {}
121
122#[repr(C)]
123#[derive(Clone, Copy, Debug, Pod, Zeroable)]
124pub struct Checkpoint {}
125
126#[repr(C)]
127#[derive(Clone, Copy, Debug, Pod, Zeroable)]
128pub struct Close {}
129
130#[repr(C)]
131#[derive(Clone, Copy, Debug, Pod, Zeroable)]
132pub struct NewVar {
133 pub id: [u8; 8],
134 pub commit: [u8; 32],
135 pub samples: [u8; 8],
136}
137
138#[repr(C)]
139#[derive(Clone, Copy, Debug, Pod, Zeroable)]
140pub struct SetAdminFee {
141 pub admin_fee: [u8; 8],
142}
143
144#[repr(C)]
145#[derive(Clone, Copy, Debug, Pod, Zeroable)]
146pub struct SetSwapProgram {}
147
148#[repr(C)]
149#[derive(Clone, Copy, Debug, Pod, Zeroable)]
150pub struct SetVarAddress {}
151
152#[repr(C)]
153#[derive(Clone, Copy, Debug, Pod, Zeroable)]
154pub struct Migrate {}
155
156instruction!(OreInstruction, Automate);
157instruction!(OreInstruction, Close);
158instruction!(OreInstruction, Checkpoint);
159instruction!(OreInstruction, ClaimSOL);
160instruction!(OreInstruction, ClaimORE);
161instruction!(OreInstruction, ReloadSOL);
162instruction!(OreInstruction, Deploy);
163instruction!(OreInstruction, Log);
164instruction!(OreInstruction, Wrap);
165instruction!(OreInstruction, Buyback);
166instruction!(OreInstruction, Bury);
167instruction!(OreInstruction, Reset);
168instruction!(OreInstruction, SetAdmin);
169instruction!(OreInstruction, NewVar);
170instruction!(OreInstruction, Migrate);