mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-13 23:16:52 +00:00
143 lines
2.8 KiB
Rust
143 lines
2.8 KiB
Rust
use steel::*;
|
|
|
|
#[repr(u8)]
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
|
|
pub enum OreInstruction {
|
|
// User
|
|
Automate = 0,
|
|
Boost = 1,
|
|
ClaimSOL = 2,
|
|
ClaimORE = 3,
|
|
Deploy = 4,
|
|
Initialize = 5,
|
|
Log = 6,
|
|
Reset = 7,
|
|
|
|
// Admin
|
|
Bury = 9,
|
|
Wrap = 10,
|
|
SetAdmin = 11,
|
|
SetFeeCollector = 12,
|
|
|
|
// Seeker
|
|
ClaimSeeker = 15,
|
|
MigrateMiner = 16,
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct Automate {
|
|
pub amount: [u8; 8],
|
|
pub deposit: [u8; 8],
|
|
pub fee: [u8; 8],
|
|
pub mask: [u8; 8],
|
|
pub strategy: u8,
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct Boost {}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct ClaimSOL {
|
|
pub amount: [u8; 8],
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct ClaimORE {
|
|
pub amount: [u8; 8],
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct Deploy {
|
|
pub amount: [u8; 8],
|
|
pub squares: [u8; 4],
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct Initialize {}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct Log {}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct Reset {}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct Mine {
|
|
pub nonce: [u8; 8],
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct Swap {
|
|
pub amount: [u8; 8],
|
|
pub direction: u8,
|
|
pub precision: u8,
|
|
pub seed: [u8; 32],
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct Uncommit {
|
|
pub amount: [u8; 8],
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct SetAdmin {
|
|
pub admin: [u8; 32],
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct SetFeeCollector {
|
|
pub fee_collector: [u8; 32],
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct SetFeeRate {
|
|
pub fee_rate: [u8; 8],
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct Wrap {}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct Bury {
|
|
pub min_amount_out: [u8; 8],
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct ClaimSeeker {}
|
|
|
|
#[repr(C)]
|
|
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
|
pub struct MigrateMiner {}
|
|
|
|
instruction!(OreInstruction, Automate);
|
|
instruction!(OreInstruction, Boost);
|
|
instruction!(OreInstruction, ClaimSOL);
|
|
instruction!(OreInstruction, ClaimORE);
|
|
instruction!(OreInstruction, Deploy);
|
|
instruction!(OreInstruction, Initialize);
|
|
instruction!(OreInstruction, Log);
|
|
instruction!(OreInstruction, Wrap);
|
|
instruction!(OreInstruction, Bury);
|
|
instruction!(OreInstruction, Reset);
|
|
instruction!(OreInstruction, SetAdmin);
|
|
instruction!(OreInstruction, SetFeeCollector);
|
|
instruction!(OreInstruction, ClaimSeeker);
|
|
instruction!(OreInstruction, MigrateMiner);
|