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
36 Deposit = 10,
38 DepositWithSession = 48,
39 Withdraw = 11,
40 WithdrawWithSession = 47,
41 ClaimYield = 12,
42 ClaimYieldWithSession = 51,
43
44 Buyback = 13,
46 Wrap = 14,
47 SetAdmin = 16,
48 SetFeeCollector = 17,
49 SetSwapProgram = 18,
50 SetVarAddress = 19,
51 NewVar = 20,
52 SetAdminFee = 21,
53 Migrate = 26,
54 SetAuction = 33,
55 CreateWhitelist = 34,
56 SetTgeTimestamp = 35,
57 Liq = 37,
58 Barrel = 38,
59}
60
61#[repr(C)]
62#[derive(Clone, Copy, Debug, Pod, Zeroable)]
63pub struct Automate {
64 pub amount: [u8; 8],
65 pub deposit: [u8; 8],
66 pub fee: [u8; 8],
67 pub mask: [u8; 8],
68 pub strategy: u8,
69 pub reload: [u8; 8],
70 pub referrer: [u8; 32],
72 pub pooled: u8,
74}
75
76#[repr(C)]
77#[derive(Clone, Copy, Debug, Pod, Zeroable)]
78pub struct ClaimSOL {}
79
80#[repr(C)]
81#[derive(Clone, Copy, Debug, Pod, Zeroable)]
82pub struct ClaimOIL {}
83
84#[repr(C)]
85#[derive(Clone, Copy, Debug, Pod, Zeroable)]
86pub struct Deploy {
87 pub amount: [u8; 8],
88 pub squares: [u8; 4],
89 pub referrer: [u8; 32],
91 pub pooled: u8,
93}
94
95#[repr(C)]
96#[derive(Clone, Copy, Debug, Pod, Zeroable)]
97pub struct Log {}
98
99#[repr(C)]
100#[derive(Clone, Copy, Debug, Pod, Zeroable)]
101pub struct Reset {}
102
103#[repr(C)]
104#[derive(Clone, Copy, Debug, Pod, Zeroable)]
105pub struct Close {}
106
107#[repr(C)]
108#[derive(Clone, Copy, Debug, Pod, Zeroable)]
109pub struct SetAdmin {
110 pub admin: [u8; 32],
111}
112
113#[repr(C)]
114#[derive(Clone, Copy, Debug, Pod, Zeroable)]
115pub struct SetFeeCollector {
116 pub fee_collector: [u8; 32],
117}
118
119#[repr(C)]
120#[derive(Clone, Copy, Debug, Pod, Zeroable)]
121pub struct Buyback {}
122
123#[repr(C)]
124#[derive(Clone, Copy, Debug, Pod, Zeroable)]
125pub struct Liq {}
126
127#[repr(C)]
128#[derive(Clone, Copy, Debug, Pod, Zeroable)]
129pub struct Barrel {
130 pub amount: [u8; 8],
131}
132
133#[repr(C)]
134#[derive(Clone, Copy, Debug, Pod, Zeroable)]
135pub struct Wrap {
136 pub use_liquidity: u8,
138 pub amount: [u8; 8],
139}
140
141#[repr(C)]
142#[derive(Clone, Copy, Debug, Pod, Zeroable)]
143pub struct ReloadSOL {}
144
145#[repr(C)]
146#[derive(Clone, Copy, Debug, Pod, Zeroable)]
147pub struct Deposit {
148 pub amount: [u8; 8],
149 pub lock_duration_days: [u8; 8], pub stake_id: [u8; 8], }
152
153#[repr(C)]
154#[derive(Clone, Copy, Debug, Pod, Zeroable)]
155pub struct Withdraw {
156 pub amount: [u8; 8],
157 pub stake_id: [u8; 8],
158}
159
160#[repr(C)]
161#[derive(Clone, Copy, Debug, Pod, Zeroable)]
162pub struct ClaimYield {
163 pub amount: [u8; 8],
164}
165
166#[repr(C)]
167#[derive(Clone, Copy, Debug, Pod, Zeroable)]
168pub struct Checkpoint {}
169
170#[repr(C)]
171#[derive(Clone, Copy, Debug, Pod, Zeroable)]
172pub struct NewVar {
173 pub id: [u8; 8],
174 pub commit: [u8; 32],
175 pub samples: [u8; 8],
176}
177
178#[repr(C)]
179#[derive(Clone, Copy, Debug, Pod, Zeroable)]
180pub struct SetAdminFee {
181 pub admin_fee: [u8; 8],
182}
183
184#[repr(C)]
185#[derive(Clone, Copy, Debug, Pod, Zeroable)]
186pub struct SetSwapProgram {}
187
188#[repr(C)]
189#[derive(Clone, Copy, Debug, Pod, Zeroable)]
190pub struct SetVarAddress {}
191
192#[repr(C)]
193#[derive(Clone, Copy, Debug, Pod, Zeroable)]
194pub struct Migrate {}
195
196#[repr(C)]
197#[derive(Clone, Copy, Debug, Pod, Zeroable)]
198pub struct CreateReferral {}
199
200#[repr(C)]
201#[derive(Clone, Copy, Debug, Pod, Zeroable)]
202pub struct ClaimReferral {}
203
204#[repr(C)]
205#[derive(Clone, Copy, Debug, Pod, Zeroable)]
206pub struct CreateWhitelist {
207 pub code_hash: [u8; 32],
209}
210
211#[repr(C)]
212#[derive(Clone, Copy, Debug, Pod, Zeroable)]
213pub struct SetTgeTimestamp {
214 pub tge_timestamp: [u8; 8],
218}
219
220#[repr(C)]
221#[derive(Clone, Copy, Debug, Pod, Zeroable)]
222pub struct Initialize {
223 pub barrel_authority: [u8; 32],
224 pub fee_collector: [u8; 32],
225 pub swap_program: [u8; 32],
226 pub var_address: [u8; 32],
227 pub admin_fee: [u8; 8],
228 pub halving_period_seconds: [u8; 8],
230 pub base_mining_rates: [[u8; 8]; 4], pub auction_duration_seconds: [u8; 8],
232 pub starting_prices: [[u8; 8]; 4], }
234
235#[repr(C)]
236#[derive(Clone, Copy, Debug, Pod, Zeroable)]
237pub struct PlaceBid {
238 pub square_id: [u8; 8],
239 pub referrer: [u8; 32],
241}
242
243#[repr(C)]
244#[derive(Clone, Copy, Debug, Pod, Zeroable)]
245pub struct ClaimAuctionOIL {
246 pub well_mask: u8,
249}
250
251#[repr(C)]
252#[derive(Clone, Copy, Debug, Pod, Zeroable)]
253pub struct ClaimAuctionSOL {
254 pub _reserved: u8,
256}
257
258#[repr(C)]
259#[derive(Clone, Copy, Debug, Pod, Zeroable)]
260pub struct SetAuction {
261 pub halving_period_seconds: [u8; 8],
262 pub last_halving_time: [u8; 8],
263 pub base_mining_rates: [[u8; 8]; 4], pub auction_duration_seconds: [u8; 8],
265 pub starting_prices: [[u8; 8]; 4], pub well_id: [u8; 8], }
268
269instruction!(OilInstruction, Automate);
270instruction!(OilInstruction, Initialize);
271instruction!(OilInstruction, Checkpoint);
272instruction!(OilInstruction, ClaimSOL);
273instruction!(OilInstruction, ClaimOIL);
274instruction!(OilInstruction, ReloadSOL);
275instruction!(OilInstruction, Deploy);
276instruction!(OilInstruction, Log);
277instruction!(OilInstruction, Buyback);
278instruction!(OilInstruction, Wrap);
279instruction!(OilInstruction, Reset);
280instruction!(OilInstruction, Close);
281instruction!(OilInstruction, SetAdmin);
282instruction!(OilInstruction, SetFeeCollector);
283instruction!(OilInstruction, Deposit);
284instruction!(OilInstruction, Withdraw);
285instruction!(OilInstruction, ClaimYield);
286instruction!(OilInstruction, NewVar);
287instruction!(OilInstruction, SetAdminFee);
288instruction!(OilInstruction, SetSwapProgram);
289instruction!(OilInstruction, SetVarAddress);
290instruction!(OilInstruction, Migrate);
291instruction!(OilInstruction, CreateReferral);
292instruction!(OilInstruction, ClaimReferral);
293instruction!(OilInstruction, PlaceBid);
294instruction!(OilInstruction, ClaimAuctionOIL);
295instruction!(OilInstruction, ClaimAuctionSOL);
296instruction!(OilInstruction, SetAuction);
297instruction!(OilInstruction, CreateWhitelist);
298instruction!(OilInstruction, SetTgeTimestamp);
299instruction!(OilInstruction, Liq);
300instruction!(OilInstruction, Barrel);