1use steel::*;
2use bytemuck;
3
4#[repr(u8)]
5#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
6pub enum OilInstruction {
7 Automate = 0,
9 AutomateWithSession = 40,
10 Initialize = 1,
11 Checkpoint = 2,
12 CheckpointWithSession = 52,
13 ClaimSOL = 3,
14 ClaimSOLWithSession = 44,
15 ClaimOIL = 4,
16 ClaimOILWithSession = 45,
17 Close = 5,
18 Deploy = 6,
19 DeployWithSession = 39,
20 Log = 8,
21 Reset = 9,
22 ReloadSOL = 22,
23 CreateReferral = 27,
24 CreateReferralWithSession = 49,
25 ClaimReferral = 28,
26 ClaimReferralWithSession = 50,
27
28 PlaceBid = 29,
30 PlaceBidWithSession = 41,
31 ClaimAuctionOIL = 31,
32 ClaimAuctionOILWithSession = 42,
33 ClaimAuctionSOL = 32,
34 ClaimAuctionSOLWithSession = 43,
35 Contribute = 53,
36 ContributeWithSession = 54,
37 CheckpointAuction = 55,
38 CheckpointAuctionWithSession = 56,
39
40 InitializeRefinery = 57,
42 PurchasePlot = 58,
43 UpgradePlot = 59,
44 PurchaseRig = 60,
45 PlaceRig = 61,
46 RemoveRig = 62,
47 ClaimRefineryRewards = 63,
48 RefuelPlot = 64,
49 SetRigConfig = 65,
50 PurchasePlotWithSession = 66,
51 UpgradePlotWithSession = 67,
52 PurchaseRigWithSession = 68,
53 PlaceRigWithSession = 69,
54 RemoveRigWithSession = 70,
55 RefuelPlotWithSession = 71,
56 ClaimRefineryRewardsWithSession = 72,
57
58 Deposit = 10,
60 DepositWithSession = 48,
61 Withdraw = 11,
62 WithdrawWithSession = 47,
63 ClaimYield = 12,
64 ClaimYieldWithSession = 51,
65
66 Buyback = 13,
68 Wrap = 14,
69 SetAdmin = 16,
70 SetFeeCollector = 17,
71 SetSwapProgram = 18,
72 SetVarAddress = 19,
73 NewVar = 20,
74 SetAdminFee = 21,
75 Migrate = 26,
76 SetAuction = 33,
77 CreateWhitelist = 34,
78 SetTgeTimestamp = 35,
79 Liq = 37,
80 Barrel = 38,
81}
82
83#[repr(C)]
84#[derive(Clone, Copy, Debug, Pod, Zeroable)]
85pub struct Automate {
86 pub amount: [u8; 8],
87 pub deposit: [u8; 8],
88 pub fee: [u8; 8],
89 pub mask: [u8; 8],
90 pub strategy: u8,
91 pub reload: [u8; 8],
92 pub referrer: [u8; 32],
94 pub pooled: u8,
96}
97
98#[repr(C)]
99#[derive(Clone, Copy, Debug, Pod, Zeroable)]
100pub struct ClaimSOL {}
101
102#[repr(C)]
103#[derive(Clone, Copy, Debug, Pod, Zeroable)]
104pub struct ClaimOIL {}
105
106#[repr(C)]
107#[derive(Clone, Copy, Debug, Pod, Zeroable)]
108pub struct Deploy {
109 pub amount: [u8; 8],
110 pub squares: [u8; 4],
111 pub referrer: [u8; 32],
113 pub pooled: u8,
115}
116
117#[repr(C)]
118#[derive(Clone, Copy, Debug, Pod, Zeroable)]
119pub struct Log {}
120
121#[repr(C)]
122#[derive(Clone, Copy, Debug, Pod, Zeroable)]
123pub struct Reset {}
124
125#[repr(C)]
126#[derive(Clone, Copy, Debug, Pod, Zeroable)]
127pub struct Close {}
128
129#[repr(C)]
130#[derive(Clone, Copy, Debug, Pod, Zeroable)]
131pub struct SetAdmin {
132 pub admin: [u8; 32],
133}
134
135#[repr(C)]
136#[derive(Clone, Copy, Debug, Pod, Zeroable)]
137pub struct SetFeeCollector {
138 pub fee_collector: [u8; 32],
139}
140
141#[repr(C)]
142#[derive(Clone, Copy, Debug, Pod, Zeroable)]
143pub struct Buyback {}
144
145#[repr(C)]
146#[derive(Clone, Copy, Debug, Pod, Zeroable)]
147pub struct Liq {}
148
149#[repr(C)]
150#[derive(Clone, Copy, Debug, Pod, Zeroable)]
151pub struct Barrel {
152 pub amount: [u8; 8],
153}
154
155#[repr(C)]
156#[derive(Clone, Copy, Debug, Pod, Zeroable)]
157pub struct Wrap {
158 pub use_liquidity: u8,
160 pub amount: [u8; 8],
161}
162
163#[repr(C)]
164#[derive(Clone, Copy, Debug, Pod, Zeroable)]
165pub struct ReloadSOL {}
166
167#[repr(C)]
168#[derive(Clone, Copy, Debug, Pod, Zeroable)]
169pub struct Deposit {
170 pub amount: [u8; 8],
171 pub lock_duration_days: [u8; 8], pub stake_id: [u8; 8], }
174
175#[repr(C)]
176#[derive(Clone, Copy, Debug, Pod, Zeroable)]
177pub struct Withdraw {
178 pub amount: [u8; 8],
179 pub stake_id: [u8; 8],
180}
181
182#[repr(C)]
183#[derive(Clone, Copy, Debug, Pod, Zeroable)]
184pub struct ClaimYield {
185 pub amount: [u8; 8],
186}
187
188#[repr(C)]
189#[derive(Clone, Copy, Debug, Pod, Zeroable)]
190pub struct Checkpoint {}
191
192#[repr(C)]
193#[derive(Clone, Copy, Debug, Pod, Zeroable)]
194pub struct NewVar {
195 pub id: [u8; 8],
196 pub commit: [u8; 32],
197 pub samples: [u8; 8],
198}
199
200#[repr(C)]
201#[derive(Clone, Copy, Debug, Pod, Zeroable)]
202pub struct SetAdminFee {
203 pub admin_fee: [u8; 8],
204}
205
206#[repr(C)]
207#[derive(Clone, Copy, Debug, Pod, Zeroable)]
208pub struct SetSwapProgram {}
209
210#[repr(C)]
211#[derive(Clone, Copy, Debug, Pod, Zeroable)]
212pub struct SetVarAddress {}
213
214#[repr(C)]
215#[derive(Clone, Copy, Debug, Pod, Zeroable)]
216pub struct Migrate {}
217
218#[repr(C)]
219#[derive(Clone, Copy, Debug, Pod, Zeroable)]
220pub struct CreateReferral {}
221
222#[repr(C)]
223#[derive(Clone, Copy, Debug, Pod, Zeroable)]
224pub struct ClaimReferral {}
225
226#[repr(C)]
227#[derive(Clone, Copy, Debug, Pod, Zeroable)]
228pub struct CreateWhitelist {
229 pub code_hash: [u8; 32],
231}
232
233#[repr(C)]
234#[derive(Clone, Copy, Debug, Pod, Zeroable)]
235pub struct SetTgeTimestamp {
236 pub tge_timestamp: [u8; 8],
240}
241
242#[repr(C)]
243#[derive(Clone, Copy, Debug, Pod, Zeroable)]
244pub struct Initialize {
245 pub barrel_authority: [u8; 32],
246 pub fee_collector: [u8; 32],
247 pub swap_program: [u8; 32],
248 pub var_address: [u8; 32],
249 pub admin_fee: [u8; 8],
250 pub halving_period_seconds: [u8; 8],
252 pub base_mining_rates: [[u8; 8]; 4], pub auction_duration_seconds: [u8; 8],
254 pub starting_prices: [[u8; 8]; 4], }
256
257#[repr(C)]
258#[derive(Clone, Copy, Debug, Pod, Zeroable)]
259pub struct PlaceBid {
260 pub square_id: [u8; 8],
261 pub referrer: [u8; 32],
263}
264
265#[repr(C)]
266#[derive(Clone, Copy, Debug, Pod, Zeroable)]
267pub struct ClaimAuctionOIL {
268 pub well_mask: u8,
271}
272
273#[repr(C)]
274#[derive(Clone, Copy, Debug, Pod, Zeroable)]
275pub struct ClaimAuctionSOL {
276 pub _reserved: u8,
278}
279
280#[repr(C)]
281#[derive(Clone, Copy, Debug, Pod, Zeroable)]
282pub struct SetAuction {
283 pub halving_period_seconds: [u8; 8],
284 pub last_halving_time: [u8; 8],
285 pub base_mining_rates: [[u8; 8]; 4], pub auction_duration_seconds: [u8; 8],
287 pub starting_prices: [[u8; 8]; 4], pub well_id: [u8; 8], }
290
291#[repr(C)]
292#[derive(Clone, Copy, Debug, Pod, Zeroable)]
293pub struct Contribute {
294 pub well_id: [u8; 8],
296 pub amount: [u8; 8],
298}
299
300#[repr(C)]
301#[derive(Clone, Copy, Debug, Pod, Zeroable)]
302pub struct CheckpointAuction {
303 pub well_mask: u8,
306 pub epoch_ids: [[u8; 8]; 4],
310}
311
312instruction!(OilInstruction, Automate);
313instruction!(OilInstruction, Initialize);
314instruction!(OilInstruction, Checkpoint);
315instruction!(OilInstruction, ClaimSOL);
316instruction!(OilInstruction, ClaimOIL);
317instruction!(OilInstruction, ReloadSOL);
318instruction!(OilInstruction, Deploy);
319instruction!(OilInstruction, Log);
320instruction!(OilInstruction, Buyback);
321instruction!(OilInstruction, Wrap);
322instruction!(OilInstruction, Reset);
323instruction!(OilInstruction, Close);
324instruction!(OilInstruction, SetAdmin);
325instruction!(OilInstruction, SetFeeCollector);
326instruction!(OilInstruction, Deposit);
327instruction!(OilInstruction, Withdraw);
328instruction!(OilInstruction, ClaimYield);
329instruction!(OilInstruction, NewVar);
330instruction!(OilInstruction, SetAdminFee);
331instruction!(OilInstruction, SetSwapProgram);
332instruction!(OilInstruction, SetVarAddress);
333instruction!(OilInstruction, Migrate);
334instruction!(OilInstruction, CreateReferral);
335instruction!(OilInstruction, ClaimReferral);
336instruction!(OilInstruction, PlaceBid);
337instruction!(OilInstruction, ClaimAuctionOIL);
338instruction!(OilInstruction, ClaimAuctionSOL);
339instruction!(OilInstruction, SetAuction);
340instruction!(OilInstruction, CreateWhitelist);
341instruction!(OilInstruction, SetTgeTimestamp);
342instruction!(OilInstruction, Liq);
343instruction!(OilInstruction, Barrel);
344instruction!(OilInstruction, Contribute);
345instruction!(OilInstruction, CheckpointAuction);
346
347#[repr(C)]
349#[derive(Clone, Copy, Debug, Pod, Zeroable)]
350pub struct InitializeRefinery {
351 pub initial_emission: [u8; 8],
353 pub mining_powers: [[u8; 8]; 15],
355 pub fuel_requirements: [[u8; 8]; 15],
357 pub fuel_consumption_rates: [[u8; 8]; 15],
359 pub rig_supplies: [[u8; 8]; 15],
361}
362
363#[repr(C)]
364#[derive(Clone, Copy, Debug, Pod, Zeroable)]
365pub struct PurchasePlot {}
366
367#[repr(C)]
368#[derive(Clone, Copy, Debug, Pod, Zeroable)]
369pub struct UpgradePlot {
370 pub plot_level: [u8; 8],
371}
372
373#[repr(C)]
374#[derive(Clone, Copy, Debug, Pod, Zeroable)]
375pub struct PurchaseRig {
376 pub rig_type: [u8; 8],
377}
378
379#[repr(C)]
380#[derive(Clone, Copy, Debug, Pod, Zeroable)]
381pub struct PlaceRig {
382 pub rig_mint: [u8; 32],
383 pub slot: [u8; 8],
384}
385
386#[repr(C)]
387#[derive(Clone, Copy, Debug, Pod, Zeroable)]
388pub struct RemoveRig {
389 pub rig_mint: [u8; 32],
390}
391
392#[repr(C)]
393#[derive(Clone, Copy, Debug, Pod, Zeroable)]
394pub struct ClaimRefineryRewards {
395 pub fee_lamports: [u8; 8],
397}
398
399#[repr(C)]
400#[derive(Clone, Copy, Debug, Pod, Zeroable)]
401pub struct RefuelPlot {}
402
403#[repr(C)]
404#[derive(Clone, Copy, Debug, Pod, Zeroable)]
405pub struct SetRigConfig {
406 pub rig_type: [u8; 8],
407 pub mining_power: [u8; 8],
408 pub fuel_requirement: [u8; 8],
409 pub fuel_consumption_rate: [u8; 8],
410}
411
412instruction!(OilInstruction, InitializeRefinery);
413instruction!(OilInstruction, PurchasePlot);
414instruction!(OilInstruction, UpgradePlot);
415instruction!(OilInstruction, PurchaseRig);
416instruction!(OilInstruction, PlaceRig);
417instruction!(OilInstruction, RemoveRig);
418instruction!(OilInstruction, ClaimRefineryRewards);
419instruction!(OilInstruction, RefuelPlot);
420instruction!(OilInstruction, SetRigConfig);