diff --git a/api/src/state/seeker.rs b/api/src/state/seeker.rs index d45a6c5..d1801e8 100644 --- a/api/src/state/seeker.rs +++ b/api/src/state/seeker.rs @@ -2,11 +2,11 @@ use steel::*; use super::OreAccount; -/// Seeker is an account which prevents multiple Seeker genesis tokens from being claimed. +/// Seeker tracks which Seeker genesis tokens have been claimed. #[repr(C)] #[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)] pub struct Seeker { - // The mint address of the Seeker token. + // The mint address of a Seeker genesis token. pub mint: Pubkey, } diff --git a/program/src/claim_seeker.rs b/program/src/claim_seeker.rs index b844926..f61f855 100644 --- a/program/src/claim_seeker.rs +++ b/program/src/claim_seeker.rs @@ -12,7 +12,7 @@ use spl_token_2022::{ pod::{PodCOption, PodMint}, }; -/// Claims ORE for seeker device. +/// Claims a Seeker genesis token for a miner. pub fn process_claim_seeker(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult { // Load accounts. let [signer_info, miner_info, mint_info, seeker_info, token_account_info, system_program] = @@ -65,6 +65,7 @@ pub fn process_claim_seeker(accounts: &[AccountInfo<'_>], _data: &[u8]) -> Progr miner_info .as_account_mut::(&ore_api::ID)? .assert_mut(|m| m.authority == *signer_info.key)? + .assert_mut(|m| m.is_seeker == 0)? }; // Load mint. @@ -89,7 +90,7 @@ pub fn process_claim_seeker(accounts: &[AccountInfo<'_>], _data: &[u8]) -> Progr "metadata address mismatch" ); - // Give miner a Seeker designation. + // Flag the miner as a Seeker. miner.is_seeker = 1; Ok(()) diff --git a/program/src/reset.rs b/program/src/reset.rs index c46731b..0cf3ee0 100644 --- a/program/src/reset.rs +++ b/program/src/reset.rs @@ -183,7 +183,7 @@ pub fn process_reset(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResul treasury.motherlode = 0; } - // If activation is enabled, pay out 1 ORE to all Seeker miners, proportional to their deployment. + // If Seeker activation is enabled, pay out 1 ORE to all winning Seeker miners, proportional to their deployment. let mint = mint_info.as_mint()?; let seeker_mint_amount = ONE_ORE.min(MAX_SUPPLY - mint.supply()); if config.is_seeker_activation_enabled == 1