mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-14 07:26:51 +00:00
scaffolding
This commit is contained in:
@@ -3,19 +3,19 @@ use steel::*;
|
||||
#[repr(u8)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
|
||||
pub enum OreInstruction {
|
||||
// Block
|
||||
// Mine
|
||||
Open = 0,
|
||||
Close = 1,
|
||||
Mine = 2,
|
||||
|
||||
// Market
|
||||
Buy = 3,
|
||||
Sell = 4,
|
||||
|
||||
// Stake
|
||||
Deposit = 5,
|
||||
Withdraw = 6,
|
||||
Free = 7,
|
||||
Deposit = 3,
|
||||
Withdraw = 4,
|
||||
Free = 5,
|
||||
|
||||
// Trade
|
||||
Buy = 6,
|
||||
Sell = 7,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
@@ -34,6 +34,22 @@ pub struct Mine {
|
||||
pub amount: [u8; 8],
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Deposit {
|
||||
pub amount: [u8; 8],
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Withdraw {
|
||||
pub amount: [u8; 8],
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Free {}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Buy {}
|
||||
@@ -42,23 +58,11 @@ pub struct Buy {}
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Sell {}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Deposit {}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Withdraw {}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Free {}
|
||||
|
||||
instruction!(OreInstruction, Open);
|
||||
instruction!(OreInstruction, Close);
|
||||
instruction!(OreInstruction, Mine);
|
||||
instruction!(OreInstruction, Buy);
|
||||
instruction!(OreInstruction, Sell);
|
||||
instruction!(OreInstruction, Deposit);
|
||||
instruction!(OreInstruction, Withdraw);
|
||||
instruction!(OreInstruction, Free);
|
||||
instruction!(OreInstruction, Buy);
|
||||
instruction!(OreInstruction, Sell);
|
||||
|
||||
@@ -6,7 +6,10 @@ use super::OreAccount;
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
|
||||
pub struct Market {
|
||||
/// The id of the block this market is associated with.
|
||||
pub block_id: u64,
|
||||
pub id: u64,
|
||||
|
||||
/// Mint of the hash token.
|
||||
pub mint: Pubkey,
|
||||
}
|
||||
|
||||
// TODO Bonding curve stuff
|
||||
|
||||
@@ -11,8 +11,8 @@ pub struct Miner {
|
||||
/// The ID of the last block this miner mined in.
|
||||
pub block_id: u64,
|
||||
|
||||
/// The amount of ORE this miner can deploy into hashpower markets.
|
||||
pub capacity: u64,
|
||||
/// The amount of ORE this miner has deployed into hashpower markets.
|
||||
pub deployed: u64,
|
||||
|
||||
/// The hash of the last block this miner mined in.
|
||||
pub hash: [u8; 32],
|
||||
|
||||
@@ -6,6 +6,9 @@ use super::OreAccount;
|
||||
/// the program's global token account.
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
|
||||
pub struct Treasury {}
|
||||
pub struct Treasury {
|
||||
/// The total amount of ORE that has been staked.
|
||||
pub total_stake: u64,
|
||||
}
|
||||
|
||||
account!(OreAccount, Treasury);
|
||||
|
||||
Reference in New Issue
Block a user