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 pub amount: [u8; 8],
112}
113
114#[repr(C)]
115#[derive(Clone, Copy, Debug, Pod, Zeroable)]
116pub struct Buyback {}
117
118#[repr(C)]
119#[derive(Clone, Copy, Debug, Pod, Zeroable)]
120pub struct Bury {
121 pub amount: [u8; 8],
122}
123
124#[repr(C)]
125#[derive(Clone, Copy, Debug, Pod, Zeroable)]
126pub struct ReloadSOL {}
127
128#[repr(C)]
129#[derive(Clone, Copy, Debug, Pod, Zeroable)]
130pub struct Deposit {
131 pub amount: [u8; 8],
132}
133
134#[repr(C)]
135#[derive(Clone, Copy, Debug, Pod, Zeroable)]
136pub struct Withdraw {
137 pub amount: [u8; 8],
138}
139
140#[repr(C)]
141#[derive(Clone, Copy, Debug, Pod, Zeroable)]
142pub struct ClaimYield {
143 pub amount: [u8; 8],
144}
145
146#[repr(C)]
147#[derive(Clone, Copy, Debug, Pod, Zeroable)]
148pub struct Checkpoint {}
149
150#[repr(C)]
151#[derive(Clone, Copy, Debug, Pod, Zeroable)]
152pub struct Close {}
153
154#[repr(C)]
155#[derive(Clone, Copy, Debug, Pod, Zeroable)]
156pub struct NewVar {
157 pub id: [u8; 8],
158 pub commit: [u8; 32],
159 pub samples: [u8; 8],
160}
161
162#[repr(C)]
163#[derive(Clone, Copy, Debug, Pod, Zeroable)]
164pub struct SetAdminFee {
165 pub admin_fee: [u8; 8],
166}
167
168#[repr(C)]
169#[derive(Clone, Copy, Debug, Pod, Zeroable)]
170pub struct SetSwapProgram {}
171
172#[repr(C)]
173#[derive(Clone, Copy, Debug, Pod, Zeroable)]
174pub struct SetVarAddress {}
175
176#[repr(C)]
177#[derive(Clone, Copy, Debug, Pod, Zeroable)]
178pub struct Liq {}
179
180instruction!(OreInstruction, Automate);
181instruction!(OreInstruction, Close);
182instruction!(OreInstruction, Checkpoint);
183instruction!(OreInstruction, ClaimSOL);
184instruction!(OreInstruction, ClaimORE);
185instruction!(OreInstruction, ReloadSOL);
186instruction!(OreInstruction, Deploy);
187instruction!(OreInstruction, Log);
188instruction!(OreInstruction, Wrap);
189instruction!(OreInstruction, Buyback);
190instruction!(OreInstruction, Bury);
191instruction!(OreInstruction, Reset);
192instruction!(OreInstruction, SetAdmin);
193instruction!(OreInstruction, SetFeeCollector);
194instruction!(OreInstruction, Deposit);
195instruction!(OreInstruction, Withdraw);
196instruction!(OreInstruction, ClaimYield);
197instruction!(OreInstruction, NewVar);
198instruction!(OreInstruction, SetAdminFee);
199instruction!(OreInstruction, SetSwapProgram);
200instruction!(OreInstruction, SetVarAddress);
201instruction!(OreInstruction, Liq);