ore_api/state/proof.rs
1use steel::*;
2
3use super::OreAccount;
4
5/// Proof accounts track a miner's current hash, claimable rewards, and lifetime stats.
6/// Every miner is allowed one proof account which is required by the program to mine or claim rewards.
7#[repr(C)]
8#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
9pub struct Proof {
10 /// The signer authorized to use this proof.
11 pub authority: Pubkey,
12
13 /// The quantity of tokens this miner has staked or earned.
14 pub balance: u64,
15
16 /// The current mining challenge.
17 pub challenge: [u8; 32],
18
19 /// The last hash the miner provided.
20 pub last_hash: [u8; 32],
21
22 /// The last time this account provided a hash.
23 pub last_hash_at: i64,
24
25 /// Buffer for possible future use.
26 pub _buffer: [u8; 8],
27
28 /// The keypair which has permission to submit hashes for mining.
29 pub miner: Pubkey,
30
31 /// The total lifetime hashes provided by this miner.
32 pub total_hashes: u64,
33
34 /// The total lifetime rewards distributed to this miner.
35 pub total_rewards: u64,
36}
37
38account!(OreAccount, Proof);