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 Deposit = 10,
19 Withdraw = 11,
20 ClaimYield = 12,
21
22 Buyback = 13,
24 Bury = 24,
25 Wrap = 14,
26 SetAdmin = 15,
27 SetFeeCollector = 16,
28 SetSwapProgram = 17,
29 SetVarAddress = 18,
30 NewVar = 19,
31 SetAdminFee = 20,
32 Liq = 25,
33}
34
35#[repr(C)]
36#[derive(Clone, Copy, Debug, Pod, Zeroable)]
37pub struct Automate {
38 pub amount: [u8; 8],
39 pub deposit: [u8; 8],
40 pub fee: [u8; 8],
41 pub mask: [u8; 8],
42 pub strategy: u8,
43 pub reload: [u8; 8],
44}
45
46#[repr(C)]
47#[derive(Clone, Copy, Debug, Pod, Zeroable)]
48pub struct ClaimSOL {}
49
50#[repr(C)]
51#[derive(Clone, Copy, Debug, Pod, Zeroable)]
52pub struct ClaimORE {}
53
54#[repr(C)]
55#[derive(Clone, Copy, Debug, Pod, Zeroable)]
56pub struct Deploy {
57 pub amount: [u8; 8],
58 pub squares: [u8; 4],
59}
60
61#[repr(C)]
62#[derive(Clone, Copy, Debug, Pod, Zeroable)]
63pub struct Log {}
64
65#[repr(C)]
66#[derive(Clone, Copy, Debug, Pod, Zeroable)]
67pub struct Reset {}
68
69#[repr(C)]
70#[derive(Clone, Copy, Debug, Pod, Zeroable)]
71pub struct Mine {
72 pub nonce: [u8; 8],
73}
74
75#[repr(C)]
76#[derive(Clone, Copy, Debug, Pod, Zeroable)]
77pub struct Swap {
78 pub amount: [u8; 8],
79 pub direction: u8,
80 pub precision: u8,
81 pub seed: [u8; 32],
82}
83
84#[repr(C)]
85#[derive(Clone, Copy, Debug, Pod, Zeroable)]
86pub struct Uncommit {
87 pub amount: [u8; 8],
88}
89
90#[repr(C)]
91#[derive(Clone, Copy, Debug, Pod, Zeroable)]
92pub struct SetAdmin {
93 pub admin: [u8; 32],
94}
95
96#[repr(C)]
97#[derive(Clone, Copy, Debug, Pod, Zeroable)]
98pub struct SetFeeCollector {
99 pub fee_collector: [u8; 32],
100}
101
102#[repr(C)]
103#[derive(Clone, Copy, Debug, Pod, Zeroable)]
104pub struct SetFeeRate {
105 pub fee_rate: [u8; 8],
106}
107
108#[repr(C)]
109#[derive(Clone, Copy, Debug, Pod, Zeroable)]
110pub struct Wrap {}
111
112#[repr(C)]
113#[derive(Clone, Copy, Debug, Pod, Zeroable)]
114pub struct Buyback {}
115
116#[repr(C)]
117#[derive(Clone, Copy, Debug, Pod, Zeroable)]
118pub struct Bury {
119 pub amount: [u8; 8],
120}
121
122#[repr(C)]
123#[derive(Clone, Copy, Debug, Pod, Zeroable)]
124pub struct ReloadSOL {}
125
126#[repr(C)]
127#[derive(Clone, Copy, Debug, Pod, Zeroable)]
128pub struct Deposit {
129 pub amount: [u8; 8],
130}
131
132#[repr(C)]
133#[derive(Clone, Copy, Debug, Pod, Zeroable)]
134pub struct Withdraw {
135 pub amount: [u8; 8],
136}
137
138#[repr(C)]
139#[derive(Clone, Copy, Debug, Pod, Zeroable)]
140pub struct ClaimYield {
141 pub amount: [u8; 8],
142}
143
144#[repr(C)]
145#[derive(Clone, Copy, Debug, Pod, Zeroable)]
146pub struct Checkpoint {}
147
148#[repr(C)]
149#[derive(Clone, Copy, Debug, Pod, Zeroable)]
150pub struct Close {}
151
152#[repr(C)]
153#[derive(Clone, Copy, Debug, Pod, Zeroable)]
154pub struct NewVar {
155 pub id: [u8; 8],
156 pub commit: [u8; 32],
157 pub samples: [u8; 8],
158}
159
160#[repr(C)]
161#[derive(Clone, Copy, Debug, Pod, Zeroable)]
162pub struct SetAdminFee {
163 pub admin_fee: [u8; 8],
164}
165
166#[repr(C)]
167#[derive(Clone, Copy, Debug, Pod, Zeroable)]
168pub struct SetSwapProgram {}
169
170#[repr(C)]
171#[derive(Clone, Copy, Debug, Pod, Zeroable)]
172pub struct SetVarAddress {}
173
174#[repr(C)]
175#[derive(Clone, Copy, Debug, Pod, Zeroable)]
176pub struct Liq {}
177
178instruction!(OreInstruction, Automate);
179instruction!(OreInstruction, Close);
180instruction!(OreInstruction, Checkpoint);
181instruction!(OreInstruction, ClaimSOL);
182instruction!(OreInstruction, ClaimORE);
183instruction!(OreInstruction, ReloadSOL);
184instruction!(OreInstruction, Deploy);
185instruction!(OreInstruction, Log);
186instruction!(OreInstruction, Wrap);
187instruction!(OreInstruction, Buyback);
188instruction!(OreInstruction, Bury);
189instruction!(OreInstruction, Reset);
190instruction!(OreInstruction, SetAdmin);
191instruction!(OreInstruction, SetFeeCollector);
192instruction!(OreInstruction, Deposit);
193instruction!(OreInstruction, Withdraw);
194instruction!(OreInstruction, ClaimYield);
195instruction!(OreInstruction, NewVar);
196instruction!(OreInstruction, SetAdminFee);
197instruction!(OreInstruction, SetSwapProgram);
198instruction!(OreInstruction, SetVarAddress);
199instruction!(OreInstruction, Liq);