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
16 Buyback = 13,
18 Bury = 24,
19 Wrap = 14,
20 UpdateProtocolConfig = 15,
21 NewVar = 19,
22 Liq = 25,
23}
24
25#[repr(u8)]
26#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
27pub enum OreInstructionV2 {
28 AutomateV2 = 0,
29}
30
31#[repr(C)]
32#[derive(Clone, Copy, Debug, Pod, Zeroable)]
33pub struct Automate {
34 pub amount: [u8; 8],
35 pub deposit: [u8; 8],
36 pub fee: [u8; 8],
37 pub mask: [u8; 8],
38 pub strategy: u8,
39 pub reload: [u8; 8],
40}
41
42#[repr(C)]
43#[derive(Clone, Copy, Debug, Pod, Zeroable)]
44pub struct AutomateV2 {
45 pub amount: [u8; 8],
46 pub deposit: [u8; 8],
47 pub fee: [u8; 8],
48 pub mask: [u8; 8],
49 pub strategy: u8,
50 pub reload: [u8; 8],
51 pub conditions: [u8; 24],
52}
53
54#[repr(C)]
55#[derive(Clone, Copy, Debug, Pod, Zeroable)]
56pub struct ClaimSOL {}
57
58#[repr(C)]
59#[derive(Clone, Copy, Debug, Pod, Zeroable)]
60pub struct ClaimORE {
61 pub bps: [u8; 8],
62}
63
64#[repr(C)]
65#[derive(Clone, Copy, Debug, Pod, Zeroable)]
66pub struct Deploy {
67 pub amount: [u8; 8],
68 pub squares: [u8; 4],
69}
70
71#[repr(C)]
72#[derive(Clone, Copy, Debug, Pod, Zeroable)]
73pub struct Log {}
74
75#[repr(C)]
76#[derive(Clone, Copy, Debug, Pod, Zeroable)]
77pub struct Reset {}
78
79#[repr(C)]
80#[derive(Clone, Copy, Debug, Pod, Zeroable)]
81pub struct SetFeeCollector {
82 pub fee_collector: [u8; 32],
83}
84
85#[repr(C)]
86#[derive(Clone, Copy, Debug, Pod, Zeroable)]
87pub struct SetFeeRate {
88 pub fee_rate: [u8; 8],
89}
90
91#[repr(C)]
92#[derive(Clone, Copy, Debug, Pod, Zeroable)]
93pub struct Wrap {
94 pub amount: [u8; 8],
95}
96
97#[repr(C)]
98#[derive(Clone, Copy, Debug, Pod, Zeroable)]
99pub struct Buyback {}
100
101#[repr(C)]
102#[derive(Clone, Copy, Debug, Pod, Zeroable)]
103pub struct Bury {
104 pub amount: [u8; 8],
105}
106
107#[repr(C)]
108#[derive(Clone, Copy, Debug, Pod, Zeroable)]
109pub struct Checkpoint {}
110
111#[repr(C)]
112#[derive(Clone, Copy, Debug, Pod, Zeroable)]
113pub struct Close {}
114
115#[repr(C)]
116#[derive(Clone, Copy, Debug, Pod, Zeroable)]
117pub struct NewVar {
118 pub id: [u8; 8],
119 pub commit: [u8; 32],
120 pub samples: [u8; 8],
121}
122
123#[repr(C)]
124#[derive(Clone, Copy, Debug, Pod, Zeroable)]
125pub struct UpdateProtocolConfig {
126 pub admin: [u8; 32],
127 pub fee_collector: [u8; 32],
128 pub fee_rate: [u8; 8],
129 pub intermission_slots: [u8; 8],
130 pub round_slots: [u8; 8],
131 pub entropy_var_address: [u8; 32],
132 pub entropy_program_id: [u8; 32],
133}
134
135instruction!(OreInstruction, Automate);
136instruction!(OreInstruction, Close);
137instruction!(OreInstruction, Checkpoint);
138instruction!(OreInstruction, ClaimSOL);
139instruction!(OreInstruction, ClaimORE);
140instruction!(OreInstruction, Deploy);
141instruction!(OreInstruction, Log);
142instruction!(OreInstruction, Wrap);
143instruction!(OreInstruction, Buyback);
144instruction!(OreInstruction, Bury);
145instruction!(OreInstruction, Reset);
146instruction!(OreInstruction, NewVar);
147instruction!(OreInstruction, UpdateProtocolConfig);
148instruction!(OreInstructionV2, AutomateV2);