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 CompoundYield = 22,
22
23 Buyback = 13,
25 Bury = 24,
26 Wrap = 14,
27 SetAdmin = 15,
28 NewVar = 19,
29 Liq = 25,
30
31 MigrateStake = 26,
32}
33
34#[repr(C)]
35#[derive(Clone, Copy, Debug, Pod, Zeroable)]
36pub struct Automate {
37 pub amount: [u8; 8],
38 pub deposit: [u8; 8],
39 pub fee: [u8; 8],
40 pub mask: [u8; 8],
41 pub strategy: u8,
42 pub reload: [u8; 8],
43}
44
45#[repr(C)]
46#[derive(Clone, Copy, Debug, Pod, Zeroable)]
47pub struct ClaimSOL {}
48
49#[repr(C)]
50#[derive(Clone, Copy, Debug, Pod, Zeroable)]
51pub struct ClaimORE {}
52
53#[repr(C)]
54#[derive(Clone, Copy, Debug, Pod, Zeroable)]
55pub struct Deploy {
56 pub amount: [u8; 8],
57 pub squares: [u8; 4],
58}
59
60#[repr(C)]
61#[derive(Clone, Copy, Debug, Pod, Zeroable)]
62pub struct Log {}
63
64#[repr(C)]
65#[derive(Clone, Copy, Debug, Pod, Zeroable)]
66pub struct Reset {}
67
68#[repr(C)]
69#[derive(Clone, Copy, Debug, Pod, Zeroable)]
70pub struct Mine {
71 pub nonce: [u8; 8],
72}
73
74#[repr(C)]
75#[derive(Clone, Copy, Debug, Pod, Zeroable)]
76pub struct Swap {
77 pub amount: [u8; 8],
78 pub direction: u8,
79 pub precision: u8,
80 pub seed: [u8; 32],
81}
82
83#[repr(C)]
84#[derive(Clone, Copy, Debug, Pod, Zeroable)]
85pub struct Uncommit {
86 pub amount: [u8; 8],
87}
88
89#[repr(C)]
90#[derive(Clone, Copy, Debug, Pod, Zeroable)]
91pub struct SetAdmin {
92 pub admin: [u8; 32],
93}
94
95#[repr(C)]
96#[derive(Clone, Copy, Debug, Pod, Zeroable)]
97pub struct SetFeeCollector {
98 pub fee_collector: [u8; 32],
99}
100
101#[repr(C)]
102#[derive(Clone, Copy, Debug, Pod, Zeroable)]
103pub struct SetFeeRate {
104 pub fee_rate: [u8; 8],
105}
106
107#[repr(C)]
108#[derive(Clone, Copy, Debug, Pod, Zeroable)]
109pub struct Wrap {
110 pub amount: [u8; 8],
111}
112
113#[repr(C)]
114#[derive(Clone, Copy, Debug, Pod, Zeroable)]
115pub struct Buyback {}
116
117#[repr(C)]
118#[derive(Clone, Copy, Debug, Pod, Zeroable)]
119pub struct Bury {
120 pub amount: [u8; 8],
121}
122
123#[repr(C)]
124#[derive(Clone, Copy, Debug, Pod, Zeroable)]
125pub struct ReloadSOL {}
126
127#[repr(C)]
128#[derive(Clone, Copy, Debug, Pod, Zeroable)]
129pub struct Deposit {
130 pub amount: [u8; 8],
131 pub compound_fee: [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
180#[repr(C)]
181#[derive(Clone, Copy, Debug, Pod, Zeroable)]
182pub struct CompoundYield {}
183
184#[repr(C)]
185#[derive(Clone, Copy, Debug, Pod, Zeroable)]
186pub struct MigrateStake {}
187
188instruction!(OreInstruction, Automate);
189instruction!(OreInstruction, Close);
190instruction!(OreInstruction, Checkpoint);
191instruction!(OreInstruction, ClaimSOL);
192instruction!(OreInstruction, ClaimORE);
193instruction!(OreInstruction, ReloadSOL);
194instruction!(OreInstruction, Deploy);
195instruction!(OreInstruction, Log);
196instruction!(OreInstruction, Wrap);
197instruction!(OreInstruction, Buyback);
198instruction!(OreInstruction, Bury);
199instruction!(OreInstruction, Reset);
200instruction!(OreInstruction, SetAdmin);
201instruction!(OreInstruction, Deposit);
202instruction!(OreInstruction, Withdraw);
203instruction!(OreInstruction, ClaimYield);
204instruction!(OreInstruction, NewVar);
205instruction!(OreInstruction, Liq);
206instruction!(OreInstruction, CompoundYield);
207instruction!(OreInstruction, MigrateStake);