diff --git a/sdk-libs/account-pinocchio/src/lib.rs b/sdk-libs/account-pinocchio/src/lib.rs index 9c1d0a048e..dc6b3e6a9b 100644 --- a/sdk-libs/account-pinocchio/src/lib.rs +++ b/sdk-libs/account-pinocchio/src/lib.rs @@ -307,7 +307,7 @@ pub fn find_mint_address(mint_seed: &[u8; 32]) -> ([u8; 32], u8) { light_sdk_types::interface::cpi::create_mints::find_mint_address::(mint_seed) } -/// Derive the compressed mint address from a mint seed and address tree pubkey. +/// Derive the light mint address from a mint seed and address tree pubkey. #[cfg(feature = "token")] pub fn derive_mint_compressed_address( mint_seed: &[u8; 32], diff --git a/sdk-libs/account/src/lib.rs b/sdk-libs/account/src/lib.rs index 99af267af2..c9b585ae19 100644 --- a/sdk-libs/account/src/lib.rs +++ b/sdk-libs/account/src/lib.rs @@ -424,7 +424,7 @@ pub fn find_mint_address(mint_seed: &[u8; 32]) -> ([u8; 32], u8) { ) } -/// Derive the compressed mint address from a mint seed and address tree pubkey. +/// Derive the light mint address from a mint seed and address tree pubkey. #[cfg(feature = "token")] pub fn derive_mint_compressed_address( mint_seed: &[u8; 32], diff --git a/sdk-libs/client/src/interface/create_accounts_proof.rs b/sdk-libs/client/src/interface/create_accounts_proof.rs index aaac726e38..09abdda0e9 100644 --- a/sdk-libs/client/src/interface/create_accounts_proof.rs +++ b/sdk-libs/client/src/interface/create_accounts_proof.rs @@ -56,7 +56,7 @@ impl CreateAccountsProofInput { Self::PdaWithOwner { pda, owner } } - /// Compressed mint (Mint). + /// Light mint (Mint). /// Address derived: `derive_mint_compressed_address(&mint_signer, &tree)` pub fn mint(mint_signer: Pubkey) -> Self { Self::Mint(mint_signer) diff --git a/sdk-libs/compressed-token-sdk/README.md b/sdk-libs/compressed-token-sdk/README.md index 057183ad22..63e1e9443e 100644 --- a/sdk-libs/compressed-token-sdk/README.md +++ b/sdk-libs/compressed-token-sdk/README.md @@ -38,7 +38,7 @@ For full examples, see the [Compressed Token Examples](https://github.com/Lightp | Compress SPL account | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/compress-spl-account.ts) | | Decompress | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/decompress.ts) | | Merge token accounts | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/merge-token-accounts.ts) | -| Create token pool | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/create-token-pool.ts) | +| Create SPL interface PDA | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/create-token-pool.ts) | ### Toolkit guides diff --git a/sdk-libs/compressed-token-sdk/src/compat.rs b/sdk-libs/compressed-token-sdk/src/compat.rs index 3caf5db2ed..c9ffe09adf 100644 --- a/sdk-libs/compressed-token-sdk/src/compat.rs +++ b/sdk-libs/compressed-token-sdk/src/compat.rs @@ -58,7 +58,7 @@ pub struct TokenData { pub delegate: Option, /// The account's state pub state: AccountState, - /// TLV extensions for compressed token accounts + /// TLV extensions for light token accounts pub tlv: Option>, } diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/mod.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/mod.rs index 4594ff3387..7d29a3991d 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/mod.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/mod.rs @@ -1,4 +1,4 @@ -//! Compressed token account types and instruction builders. +//! Light token account types and instruction builders. #[cfg(feature = "v1")] mod v1; diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v1/approve/account_metas.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v1/approve/account_metas.rs index 7517bd733a..a65ab8171d 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v1/approve/account_metas.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v1/approve/account_metas.rs @@ -108,7 +108,7 @@ pub fn get_approve_instruction_account_metas(config: ApproveMetaConfig) -> Vec TransferAccountInfos<'_, 'info, N> { account_infos.push(self.fee_payer.clone()); account_infos.push(self.authority.clone()); - // Add ctoken accounts + // Add light-token accounts for account in self.ctoken_accounts { account_infos.push(account.clone()); } diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/account_metas.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/account_metas.rs index 74a21d14f4..1d392c5378 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/account_metas.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/account_metas.rs @@ -3,7 +3,7 @@ use solana_pubkey::Pubkey; use crate::utils::TokenDefaultAccounts; -/// Account metadata configuration for compressed token instructions +/// Account metadata configuration for light token instructions #[derive(Debug, Default, Copy, Clone)] pub struct TokenAccountsMetaConfig { pub fee_payer: Option, @@ -134,7 +134,7 @@ impl TokenAccountsMetaConfig { } } -/// Get the standard account metas for a compressed token transfer instruction +/// Get the standard account metas for a light token transfer instruction pub fn get_transfer_instruction_account_metas(config: TokenAccountsMetaConfig) -> Vec { let default_pubkeys = TokenDefaultAccounts::default(); // Direct invoke adds fee_payer, and authority @@ -159,7 +159,7 @@ pub fn get_transfer_instruction_account_metas(config: TokenAccountsMetaConfig) - AccountMeta::new_readonly(default_pubkeys.account_compression_authority, false), // account_compression_program AccountMeta::new_readonly(default_pubkeys.account_compression_program, false), - // self_program (compressed token program) + // self_program (light token program) AccountMeta::new_readonly(default_pubkeys.self_program, false), ] } else { @@ -176,12 +176,12 @@ pub fn get_transfer_instruction_account_metas(config: TokenAccountsMetaConfig) - AccountMeta::new_readonly(default_pubkeys.account_compression_authority, false), // account_compression_program AccountMeta::new_readonly(default_pubkeys.account_compression_program, false), - // self_program (compressed token program) + // self_program (light token program) AccountMeta::new_readonly(default_pubkeys.self_program, false), ] }; - // Optional token pool PDA (for compression/decompression) + // Optional SPL interface PDA (for compression/decompression) if let Some(spl_interface_pda) = config.spl_interface_pda { metas.push(AccountMeta::new(spl_interface_pda, false)); } else if config.fee_payer.is_some() || config.with_anchor_none { diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/instruction.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/instruction.rs index f1f5dfc648..9f4d681127 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/instruction.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/instruction.rs @@ -12,19 +12,19 @@ use crate::{ error::{Result, TokenSdkError}, AnchorSerialize, }; -// CTokenAccount abstraction to bundle inputs and create outputs. +// Light-token account abstraction to bundle inputs and create outputs. // Users don't really need to interact with this struct directly. -// Counter point for an anchor like TokenAccount we need the CTokenAccount +// Counter point for an anchor like TokenAccount we need the light-token account // // Rename TokenAccountMeta -> TokenAccountMeta // // We should have a create instruction function that works onchain and offchain. // - account infos don't belong into the create instruction function. -// One difference between spl and compressed token program is that you don't want to make a separate cpi per transfer. +// One difference between spl and light token program is that you don't want to make a separate cpi per transfer. // -> transfer(from, to, amount) doesn't work well // - -// -> compress(token_account, Option) could be compressed token account +// -> compress(token_account, Option) could be light token account // -> decompress() // TODO: // - test decompress and compress in the same instruction @@ -39,7 +39,7 @@ pub struct TransferConfig { /// Create instruction function should only take Pubkeys as inputs not account infos. /// -/// Create the instruction for compressed token operations +/// Create the instruction for light token operations pub fn create_transfer_instruction_raw( mint: Pubkey, token_accounts: Vec, diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/account2.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/account2.rs index b1a1179d00..d7408f6bdf 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/account2.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/account2.rs @@ -307,7 +307,7 @@ impl CTokenAccount2 { pool_account_index: 0, pool_index: 0, bump: 0, - decimals: 0, // Not used for ctoken compression + decimals: 0, // Not used for light-token compression }); self.method_used = true; diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/compress_and_close.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/compress_and_close.rs index 8978d2703c..fee5f06b50 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/compress_and_close.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/compress_and_close.rs @@ -90,7 +90,7 @@ fn find_account_indices( destination_pubkey: &Pubkey, ) -> Result { let source_index = find_index(ctoken_account_key).ok_or_else(|| { - msg!("Source ctoken account not found in packed_accounts"); + msg!("Source light-token account not found in packed_accounts"); TokenSdkError::InvalidAccountData })?; @@ -129,7 +129,7 @@ fn find_account_indices( }) } -/// Compress and close compressed token accounts with pre-computed indices +/// Compress and close light token accounts with pre-computed indices /// /// # Arguments /// * `fee_payer` - The fee payer pubkey @@ -174,7 +174,7 @@ pub fn compress_and_close_token_accounts_with_indices<'info>( let amount = light_token_interface::state::Token::amount_from_slice(&account_data)?; - // Create CTokenAccount2 for CompressAndClose operation + // Create light-token account for CompressAndClose operation let mut token_account = CTokenAccount2::new_empty(idx.owner_index, idx.mint_index); // Set up compress_and_close with actual indices @@ -230,12 +230,12 @@ pub fn compress_and_close_token_accounts_with_indices<'info>( create_transfer2_instruction(inputs) } -/// Compress and close compressed token accounts +/// Compress and close light token accounts /// /// # Arguments /// * `fee_payer` - The fee payer pubkey /// * `output_queue_pubkey` - The output queue pubkey where compressed accounts will be stored -/// * `ctoken_solana_accounts` - Slice of ctoken Solana account infos to compress and close +/// * `ctoken_solana_accounts` - Slice of light-token account infos to compress and close /// * `packed_accounts` - Slice of all accounts that will be used in the instruction (tree accounts) /// /// # Returns @@ -262,11 +262,11 @@ pub fn compress_and_close_token_accounts<'info>( .map(|idx| (idx + 1) as u8) // Add 1 because output_queue will be at index 0 }; - // Process each ctoken Solana account and build indices + // Process each light-token account and build indices let mut indices_vec = Vec::with_capacity(ctoken_solana_accounts.len()); for ctoken_account_info in ctoken_solana_accounts.iter() { - // Deserialize the ctoken Solana account using light zero copy + // Deserialize the light-token account using light zero copy let account_data = ctoken_account_info .try_borrow_data() .map_err(|_| TokenSdkError::AccountBorrowFailed)?; @@ -313,7 +313,7 @@ pub fn compress_and_close_token_accounts<'info>( ) } -/// Compress and close ctoken accounts, and invoke cpi. +/// Compress and close light-token accounts, and invoke cpi. /// /// Wraps `compress_and_close_token_accounts`, builds the instruction, and /// calls `invoke_signed` with provided seeds. @@ -404,7 +404,7 @@ impl CompressAndCloseAccounts { impl AccountMetasVec for CompressAndCloseAccounts { /// Adds: /// 1. system accounts if not set - /// 2. compressed token program and ctoken cpi authority pda to pre accounts + /// 2. light token program and light-token CPI authority PDA to pre accounts fn get_account_metas_vec( &self, accounts: &mut PackedAccounts, diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/create_compressed_mint/account_metas.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/create_compressed_mint/account_metas.rs index e86ae2f27c..639d47ebf6 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/create_compressed_mint/account_metas.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/create_compressed_mint/account_metas.rs @@ -3,7 +3,7 @@ use solana_pubkey::Pubkey; use crate::utils::TokenDefaultAccounts; -/// Account metadata configuration for create cMint instruction +/// Account metadata configuration for create light mint instruction #[derive(Debug, Copy, Clone)] pub struct CreateMintMetaConfig { pub fee_payer: Option, @@ -43,7 +43,7 @@ impl CreateMintMetaConfig { } } -/// Get the standard account metas for a create cMint instruction +/// Get the standard account metas for a create light mint instruction pub fn get_create_compressed_mint_instruction_account_metas( config: CreateMintMetaConfig, ) -> Vec { diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/create_compressed_mint/instruction.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/create_compressed_mint/instruction.rs index 5e8e254928..380888d026 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/create_compressed_mint/instruction.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/create_compressed_mint/instruction.rs @@ -22,7 +22,7 @@ use crate::{ AnchorDeserialize, AnchorSerialize, }; -/// Input struct for creating a compressed mint instruction +/// Input struct for creating a light mint instruction #[derive(Debug, Clone, AnchorDeserialize, AnchorSerialize)] pub struct CreateMintInputs { pub decimals: u8, @@ -38,7 +38,7 @@ pub struct CreateMintInputs { pub version: u8, } -/// Creates a compressed mint instruction (wrapper around mint_action) +/// Creates a light mint instruction (wrapper around mint_action) pub fn create_compressed_mint_cpi( input: CreateMintInputs, cpi_context: Option, @@ -170,12 +170,12 @@ pub fn create_compressed_mint_cpi_write(input: CreateMintInputsCpiWrite) -> Resu }) } -/// Creates a compressed mint instruction with automatic mint address derivation +/// Creates a light mint instruction with automatic mint address derivation pub fn create_compressed_mint(input: CreateMintInputs) -> Result { create_compressed_mint_cpi(input, None, None) } -/// Derives the compressed mint address from the mint seed and address tree +/// Derives the light mint address from the mint seed and address tree pub fn derive_mint_compressed_address( mint_seed: &Pubkey, address_tree_pubkey: &Pubkey, diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/decompress_full.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/decompress_full.rs index 2cd8830ce8..28a8756b5a 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/decompress_full.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/decompress_full.rs @@ -37,8 +37,8 @@ use crate::{ #[derive(Debug, Clone, AnchorDeserialize, AnchorSerialize)] pub struct DecompressFullIndices { pub source: MultiInputTokenDataWithContext, // Complete compressed account data with merkle context - pub destination_index: u8, // Destination ctoken Solana account (must exist) - /// Whether this is an ATA decompression. For ATAs, the source.owner is the ATA address + pub destination_index: u8, // Destination light-token account (must exist) + /// Whether this is an associated token account decompression. For ATAs, the source.owner is the ATA address /// (not the wallet), so it should NOT be marked as a signer - the wallet signs the tx instead. pub is_ata: bool, /// TLV extensions for this compressed account (e.g., CompressedOnly extension). @@ -156,7 +156,7 @@ impl<'a> Unpack> for DecompressFullIndices { } } -/// Decompress full balance from compressed token accounts with pre-computed indices +/// Decompress full balance from compressed light token accounts with pre-computed indices /// /// # Arguments /// * `fee_payer` - The fee payer pubkey @@ -195,7 +195,7 @@ pub fn decompress_full_token_accounts_with_indices<'info>( // For decompress_full, we don't have an output tree since everything goes to the destination let mut token_account = CTokenAccount2::new(vec![idx.source])?; - // Set up decompress_full - decompress entire balance to destination ctoken account + // Set up decompress_full - decompress entire balance to destination light-token account token_account.decompress(idx.source.amount, idx.destination_index)?; token_accounts.push(token_account); @@ -267,10 +267,10 @@ pub fn decompress_full_token_accounts_with_indices<'info>( create_transfer2_instruction(inputs) } -/// Helper function to pack compressed token accounts into DecompressFullIndices. +/// Helper function to pack compressed light token accounts into DecompressFullIndices. /// Delegates to `DecompressFullInput::pack()`. /// -/// For non-ATA decompress: owner is marked as a signer. +/// For non-associated-token-account decompress: owner is marked as a signer. #[cfg(not(target_os = "solana"))] #[profile] pub fn pack_for_decompress_full( @@ -354,7 +354,7 @@ impl DecompressFullAccounts { impl AccountMetasVec for DecompressFullAccounts { /// Adds: /// 1. system accounts if not set - /// 2. compressed token program and ctoken cpi authority pda to pre accounts + /// 2. light token program and light-token CPI authority PDA to pre accounts fn get_account_metas_vec( &self, accounts: &mut PackedAccounts, diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_action/account_metas.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_action/account_metas.rs index e04b9eda11..9eea5a556e 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_action/account_metas.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_action/account_metas.rs @@ -14,7 +14,7 @@ pub struct MintActionMetaConfig { pub input_queue: Option, // Input queue for existing compressed mint operations pub tokens_out_queue: Option, // Output queue for new token accounts pub cpi_context: Option, - pub token_accounts: Vec, // For mint_to_ctoken actions + pub token_accounts: Vec, // For mint to light-token actions pub mint: Option, // Mint PDA account for DecompressMint action pub compressible_config: Option, // CompressibleConfig account (when creating Mint) pub rent_sponsor: Option, // Rent sponsor PDA (when creating Mint) @@ -22,7 +22,7 @@ pub struct MintActionMetaConfig { } impl MintActionMetaConfig { - /// Create a new MintActionMetaConfig for creating a new compressed mint. + /// Create a new MintActionMetaConfig for creating a new light mint. pub fn new_create_mint( fee_payer: Pubkey, authority: Pubkey, @@ -47,7 +47,7 @@ impl MintActionMetaConfig { } } - /// Create a new MintActionMetaConfig for operations on an existing compressed mint. + /// Create a new MintActionMetaConfig for operations on an existing light mint. #[inline(never)] pub fn new( fee_payer: Pubkey, @@ -211,7 +211,7 @@ impl MintActionMetaConfig { metas.push(AccountMeta::new(self.tree_pubkey, false)); - // input_queue is present when operating on an existing compressed mint + // input_queue is present when operating on an existing compressed light mint // (input_queue is set via new() for existing mints, None via new_create_mint() for new mints) if let Some(input_queue) = self.input_queue { metas.push(AccountMeta::new(input_queue, false)); diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_action/mod.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_action/mod.rs index f4fef20c60..959021013b 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_action/mod.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_action/mod.rs @@ -20,7 +20,7 @@ pub struct MintActionCpiWriteAccounts<'a, T: AccountInfoTrait + Clone> { pub cpi_authority_pda: &'a T, pub cpi_context: &'a T, pub cpi_signer: CpiSigner, - pub recipient_token_accounts: Vec<&'a T>, // For mint_to_ctoken actions + pub recipient_token_accounts: Vec<&'a T>, // For mint to light-token actions } impl MintActionCpiWriteAccounts<'_, T> { diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_to_compressed/account_metas.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_to_compressed/account_metas.rs index 948c45a1c8..7a16af7a77 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_to_compressed/account_metas.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_to_compressed/account_metas.rs @@ -21,7 +21,7 @@ pub struct MintToCompressedMetaConfig { } impl MintToCompressedMetaConfig { - /// Create a new MintToCompressedMetaConfig for standard compressed mint operations + /// Create a new MintToCompressedMetaConfig for standard light mint operations #[allow(clippy::too_many_arguments)] pub fn new( mint_authority: Pubkey, @@ -74,7 +74,7 @@ impl MintToCompressedMetaConfig { } } - /// Create a new MintToCompressedMetaConfig for decompressed mint operations + /// Create a new MintToCompressedMetaConfig for light mint account operations #[allow(clippy::too_many_arguments)] pub fn new_decompressed( mint_authority: Pubkey, @@ -164,7 +164,7 @@ pub fn get_mint_to_compressed_instruction_account_metas( metas.push(AccountMeta::new_readonly(mint_authority, true)); } - // Optional decompressed mint accounts + // Optional light mint account accounts if config.spl_mint_initialized { metas.push(AccountMeta::new(config.mint_pda.unwrap(), false)); // mint metas.push(AccountMeta::new(config.spl_interface_pda.unwrap(), false)); // spl_interface_pda diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/transfer2/account_metas.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/transfer2/account_metas.rs index 1f5b4c8599..67e6c1f7b5 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/transfer2/account_metas.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/transfer2/account_metas.rs @@ -5,7 +5,7 @@ use solana_pubkey::Pubkey; use crate::utils::TokenDefaultAccounts; -/// Account metadata configuration for compressed token multi-transfer instructions +/// Account metadata configuration for light token multi-transfer instructions #[derive(Debug, Default, Clone, PartialEq)] pub struct Transfer2AccountsMetaConfig { pub fee_payer: Option, @@ -46,7 +46,7 @@ impl Transfer2AccountsMetaConfig { } } -/// Get the standard account metas for a compressed token multi-transfer instruction +/// Get the standard account metas for a light token multi-transfer instruction pub fn get_transfer2_instruction_account_metas( config: Transfer2AccountsMetaConfig, ) -> Vec { diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/transfer2/instruction.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/transfer2/instruction.rs index bfb71b43c8..fba2821ac1 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/transfer2/instruction.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/transfer2/instruction.rs @@ -91,7 +91,7 @@ pub struct Transfer2Inputs { pub in_tlv: Option>>, } -/// Create the instruction for compressed token multi-transfer operations +/// Create the instruction for light token multi-transfer operations #[profile] pub fn create_transfer2_instruction(inputs: Transfer2Inputs) -> Result { let Transfer2Inputs { diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/update_compressed_mint/account_metas.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/update_compressed_mint/account_metas.rs index bc12c50295..62bf287882 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/update_compressed_mint/account_metas.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/update_compressed_mint/account_metas.rs @@ -3,7 +3,7 @@ use solana_pubkey::Pubkey; use crate::utils::TokenDefaultAccounts; -/// Configuration for generating account metas for update compressed mint instruction +/// Configuration for generating account metas for update light mint instruction #[derive(Debug, Clone)] pub struct UpdateMintMetaConfig { pub fee_payer: Option, @@ -14,7 +14,7 @@ pub struct UpdateMintMetaConfig { pub with_cpi_context: bool, } -/// Generates account metas for the update compressed mint instruction +/// Generates account metas for the update light mint instruction pub fn get_update_compressed_mint_instruction_account_metas( config: UpdateMintMetaConfig, ) -> Vec { diff --git a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/update_compressed_mint/instruction.rs b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/update_compressed_mint/instruction.rs index b330fa5b3e..0fca459fbf 100644 --- a/sdk-libs/compressed-token-sdk/src/compressed_token/v2/update_compressed_mint/instruction.rs +++ b/sdk-libs/compressed-token-sdk/src/compressed_token/v2/update_compressed_mint/instruction.rs @@ -20,7 +20,7 @@ use crate::{ pub const UPDATE_COMPRESSED_MINT_DISCRIMINATOR: u8 = 105; -/// Input struct for updating a compressed mint instruction +/// Input struct for updating a light mint instruction #[derive(Debug, Clone, AnchorDeserialize, AnchorSerialize)] pub struct UpdateMintInputs { pub compressed_mint_inputs: MintWithContext, @@ -35,7 +35,7 @@ pub struct UpdateMintInputs { pub out_output_queue: Pubkey, } -/// Creates an update compressed mint instruction with CPI context support (now uses mint_action) +/// Creates an update light mint instruction with CPI context support (now uses mint_action) pub fn update_compressed_mint_cpi( input: UpdateMintInputs, cpi_context: Option, @@ -86,12 +86,12 @@ pub fn update_compressed_mint_cpi( }) } -/// Creates an update compressed mint instruction without CPI context +/// Creates an update light mint instruction without CPI context pub fn update_compressed_mint(input: UpdateMintInputs) -> Result { update_compressed_mint_cpi(input, None) } -/// Input struct for creating an update compressed mint instruction with CPI context write +/// Input struct for creating an update light mint instruction with CPI context write #[derive(Debug, Clone)] pub struct UpdateMintInputsCpiWrite { pub compressed_mint_inputs: MintWithContext, @@ -103,7 +103,7 @@ pub struct UpdateMintInputsCpiWrite { pub cpi_context_pubkey: Pubkey, } -/// Creates an update compressed mint instruction for CPI context writes (now uses mint_action) +/// Creates an update light mint instruction for CPI context writes (now uses mint_action) pub fn create_update_compressed_mint_cpi_write( inputs: UpdateMintInputsCpiWrite, ) -> Result { diff --git a/sdk-libs/compressed-token-sdk/src/lib.rs b/sdk-libs/compressed-token-sdk/src/lib.rs index 8074910c65..ea18db0e27 100644 --- a/sdk-libs/compressed-token-sdk/src/lib.rs +++ b/sdk-libs/compressed-token-sdk/src/lib.rs @@ -1,11 +1,11 @@ -//! # Light Compressed Token SDK +//! # Light Token SDK //! -//! Low-level SDK for compressed token operations on Light Protocol. +//! Low-level SDK for light token operations on Light Protocol. //! -//! This crate provides the core building blocks for working with compressed token accounts, +//! This crate provides the core building blocks for working with light token accounts, //! including instruction builders for transfers, mints, and compress/decompress operations. //! -//! ## Compressed Token Accounts +//! ## Light Token Accounts //| - do not require a rent-exempt balance. //! - are on Solana mainnet. //! - are compressed accounts. @@ -15,14 +15,14 @@ //! //! ## Difference to Light-Token: //! light-token: Solana account that holds token balances of light-mints, SPL or Token 22 mints. -//! Compressed token: Compressed account storing token data. Rent-free, for storage and distribution. +//! Compressed light token: Compressed account storing token data. Rent-free, for storage and distribution. //! //! ## Features //! -//! - `v1` - Enable v1 compressed token support +//! - `v1` - Enable v1 light token support //! - `anchor` - Enable Anchor framework integration //! -//! For full examples, see the [Compressed Token Examples](https://github.com/Lightprotocol/examples-zk-compression). +//! For full examples, see the [Light Token Examples](https://github.com/Lightprotocol/examples-zk-compression). //! //! ## Operations reference //! @@ -37,7 +37,7 @@ //! | Compress SPL account | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/compress-spl-account.ts) | //! | Decompress | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/decompress.ts) | //! | Merge token accounts | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/merge-token-accounts.ts) | -//! | Create token pool | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/create-token-pool.ts) | +//! | Create SPL interface PDA | [create-compressed-token-accounts](https://www.zkcompression.com/compressed-tokens/guides/create-compressed-token-accounts) | [example](https://github.com/Lightprotocol/examples-zk-compression/blob/main/compressed-token-cookbook/actions/create-token-pool.ts) | //! //! ### Toolkit guides //! @@ -48,8 +48,8 @@ //! //! ## Modules //! -//! - [`compressed_token`] - Core compressed token types and instruction builders -//! - [`error`] - Error types for compressed token operations +//! - [`compressed_token`] - Core light token types and instruction builders +//! - [`error`] - Error types for light token operations //! - [`utils`] - Utility functions and default account configurations //! - [`constants`] - Program IDs and other constants //! - [`spl_interface`] - SPL interface PDA derivation utilities diff --git a/sdk-libs/compressed-token-sdk/src/spl_interface.rs b/sdk-libs/compressed-token-sdk/src/spl_interface.rs index 3f7b6a87ca..bae9b7b1e6 100644 --- a/sdk-libs/compressed-token-sdk/src/spl_interface.rs +++ b/sdk-libs/compressed-token-sdk/src/spl_interface.rs @@ -33,10 +33,10 @@ pub fn derive_spl_interface_pda(mint: &Pubkey, index: u8, restricted: bool) -> S } } -/// # Create SPL interface PDA (token pool) instruction builder +/// # Create SPL interface PDA instruction builder /// /// Creates or adds an spl interface pda for an SPL mint. -/// Spl interface pdas store spl tokens that are wrapped in ctoken or compressed token accounts. +/// SPL interface PDAs store SPL tokens that are wrapped in light-token accounts. /// /// ```rust /// # use solana_pubkey::Pubkey; diff --git a/sdk-libs/compressed-token-sdk/src/utils.rs b/sdk-libs/compressed-token-sdk/src/utils.rs index 18a9409418..b1aa62216f 100644 --- a/sdk-libs/compressed-token-sdk/src/utils.rs +++ b/sdk-libs/compressed-token-sdk/src/utils.rs @@ -76,7 +76,7 @@ pub struct AccountInfoToCompress<'info> { pub signer_seeds: Vec>, } -/// Standard pubkeys for compressed token instructions +/// Standard pubkeys for light token instructions #[derive(Debug, Copy, Clone)] pub struct TokenDefaultAccounts { pub light_system_program: Pubkey, diff --git a/sdk-libs/event/src/event.rs b/sdk-libs/event/src/event.rs index f9b87207f5..c0459bdef4 100644 --- a/sdk-libs/event/src/event.rs +++ b/sdk-libs/event/src/event.rs @@ -29,12 +29,12 @@ pub struct PublicTransactionEvent { pub compress_or_decompress_lamports: Option, pub pubkey_array: Vec, pub message: Option>, - /// ATA owner info for compressed ATAs (output_index -> wallet_owner_pubkey). + /// Associated token account owner info for light-token ATAs (output_index -> wallet_owner_pubkey). /// Only populated for compress_and_close operations where is_ata=true. pub ata_owners: Vec, } -/// ATA owner info extracted from compress_and_close operations. +/// Associated token account owner info extracted from compress_and_close operations. #[derive(Debug, Clone, Copy, BorshSerialize, BorshDeserialize, Default, PartialEq, Eq)] pub struct AssociatedTokenAccountOwnerInfo { /// Index into output_compressed_accounts diff --git a/sdk-libs/instruction-decoder/src/core.rs b/sdk-libs/instruction-decoder/src/core.rs index 40219c4a57..fb028c2330 100644 --- a/sdk-libs/instruction-decoder/src/core.rs +++ b/sdk-libs/instruction-decoder/src/core.rs @@ -65,7 +65,7 @@ pub trait InstructionDecoder: Send + Sync { /// Program ID this decoder handles. fn program_id(&self) -> Pubkey; - /// Human-readable program name (e.g., "Compressed Token Program"). + /// Human-readable program name (e.g., "Light Token Program"). fn program_name(&self) -> &'static str; /// Decode instruction data into a structured representation. diff --git a/sdk-libs/instruction-decoder/src/lib.rs b/sdk-libs/instruction-decoder/src/lib.rs index 63b51d9f9f..7bdfbbf967 100644 --- a/sdk-libs/instruction-decoder/src/lib.rs +++ b/sdk-libs/instruction-decoder/src/lib.rs @@ -5,7 +5,7 @@ //! This crate provides: //! - Core types for instruction decoding (`DecodedField`, `DecodedInstruction`, `InstructionDecoder` trait) //! - Decoder registry for managing multiple program decoders -//! - Built-in decoders for Light Protocol programs (System, Compressed Token, etc.) +//! - Built-in decoders for Light Protocol programs (System, Light Token, etc.) //! - Transaction logging configuration and formatting utilities //! //! | Export | Description | diff --git a/sdk-libs/instruction-decoder/src/programs/ctoken.rs b/sdk-libs/instruction-decoder/src/programs/ctoken.rs index 0736c66fcf..d6e6473c81 100644 --- a/sdk-libs/instruction-decoder/src/programs/ctoken.rs +++ b/sdk-libs/instruction-decoder/src/programs/ctoken.rs @@ -1,6 +1,6 @@ -//! Compressed Token (CToken) program instruction decoder. +//! Light Token program instruction decoder. //! -//! This module provides a macro-derived decoder for the Light Token (CToken) program, +//! This module provides a macro-derived decoder for the Light Token program, //! which uses non-sequential 1-byte discriminators for Pinocchio instructions. //! //! Note: This decoder only handles Pinocchio (1-byte) instructions. @@ -8,7 +8,7 @@ //! //! ## Instruction Data Formats //! -//! Most CToken instructions have optional max_top_up suffix: +//! Most Light Token instructions have optional max_top_up suffix: //! - Transfer, MintTo, Burn: 8 bytes (amount) or 10 bytes (amount + max_top_up) //! - TransferChecked, MintToChecked, BurnChecked: 9 bytes (amount + decimals) or 11 bytes (+ max_top_up) //! - Approve: 8 bytes (amount) or 10 bytes (amount + max_top_up) @@ -523,16 +523,16 @@ pub fn resolve_transfer2_account_names( /// Resolve MintAction account names dynamically based on instruction data. /// /// MintAction has a dynamic account layout that depends on: -/// - `create_mint`: whether creating a new compressed mint +/// - `create_mint`: whether creating a new light mint /// - `cpi_context`: whether using CPI context mode -/// - `mint` (None = decompressed): whether mint is decompressed to CMint +/// - `mint` (None = decompressed): whether mint is decompressed to light mint account /// - `actions`: may contain DecompressMint, CompressAndCloseMint, MintToCompressed /// /// Account layout (see plan for full details): /// 1. Fixed: light_system_program, [mint_signer if create_mint], authority /// 2. CPI Context Mode: fee_payer, cpi_authority_pda, cpi_context /// 3. Executing Mode: -/// - Optional: compressible_config, cmint, rent_sponsor +/// - Optional: compressible_config, light mint account, rent_sponsor /// - LightSystemAccounts (6 required) /// - Optional: cpi_context_account /// - Tree accounts @@ -624,7 +624,7 @@ pub fn resolve_mint_action_account_names( ); } - // Optional: cmint + // Optional: light mint account if needs_cmint_account { add_name("cmint", accounts, &mut idx, &mut known_pubkeys); } @@ -911,9 +911,9 @@ pub fn format_mint_action( output } -/// Compressed Token (CToken) program instructions. +/// Light Token program instructions. /// -/// The CToken program uses non-sequential 1-byte discriminators. +/// The Light Token program uses non-sequential 1-byte discriminators. /// Each variant has an explicit #[discriminator = N] attribute. /// /// Field definitions show the base required fields; max_top_up is optional. @@ -924,13 +924,13 @@ pub fn format_mint_action( discriminator_size = 1 )] pub enum CTokenInstruction { - /// Transfer compressed tokens (discriminator 3) + /// Transfer compressed light tokens (discriminator 3) /// Data: amount (u64) [+ max_top_up (u16)] #[discriminator = 3] #[instruction_decoder(account_names = ["source", "destination", "authority"])] Transfer { amount: u64 }, - /// Approve delegate for compressed tokens (discriminator 4) + /// Approve delegate for compressed light tokens (discriminator 4) /// Data: amount (u64) [+ max_top_up (u16)] #[discriminator = 4] #[instruction_decoder(account_names = ["source", "delegate", "owner"])] @@ -942,57 +942,57 @@ pub enum CTokenInstruction { #[instruction_decoder(account_names = ["source", "owner"])] Revoke, - /// Mint compressed tokens to an account (discriminator 7) + /// Mint compressed light tokens to an account (discriminator 7) /// Data: amount (u64) [+ max_top_up (u16)] #[discriminator = 7] #[instruction_decoder(account_names = ["cmint", "destination", "authority"])] MintTo { amount: u64 }, - /// Burn compressed tokens (discriminator 8) + /// Burn compressed light tokens (discriminator 8) /// Data: amount (u64) [+ max_top_up (u16)] #[discriminator = 8] #[instruction_decoder(account_names = ["source", "cmint", "authority"])] Burn { amount: u64 }, - /// Close a compressed token account (discriminator 9) + /// Close a light token account (discriminator 9) #[discriminator = 9] #[instruction_decoder(account_names = ["account", "destination", "authority"])] CloseTokenAccount, - /// Freeze a compressed token account (discriminator 10) + /// Freeze a light token account (discriminator 10) #[discriminator = 10] #[instruction_decoder(account_names = ["account", "mint", "authority"])] FreezeAccount, - /// Thaw a frozen compressed token account (discriminator 11) + /// Thaw a frozen light token account (discriminator 11) #[discriminator = 11] #[instruction_decoder(account_names = ["account", "mint", "authority"])] ThawAccount, - /// Transfer compressed tokens with decimals check (discriminator 12) + /// Transfer compressed light tokens with decimals check (discriminator 12) /// Data: amount (u64) + decimals (u8) [+ max_top_up (u16)] #[discriminator = 12] #[instruction_decoder(account_names = ["source", "mint", "destination", "authority"])] TransferChecked { amount: u64, decimals: u8 }, - /// Mint compressed tokens with decimals check (discriminator 14) + /// Mint compressed light tokens with decimals check (discriminator 14) /// Data: amount (u64) + decimals (u8) [+ max_top_up (u16)] #[discriminator = 14] #[instruction_decoder(account_names = ["cmint", "destination", "authority"])] MintToChecked { amount: u64, decimals: u8 }, - /// Burn compressed tokens with decimals check (discriminator 15) + /// Burn compressed light tokens with decimals check (discriminator 15) /// Data: amount (u64) + decimals (u8) [+ max_top_up (u16)] #[discriminator = 15] #[instruction_decoder(account_names = ["source", "cmint", "authority"])] BurnChecked { amount: u64, decimals: u8 }, - /// Create a new compressed token account (discriminator 18) + /// Create a new light token account (discriminator 18) #[discriminator = 18] #[instruction_decoder(account_names = ["token_account", "mint", "payer", "config", "system_program", "rent_payer"])] CreateTokenAccount, - /// Create an associated compressed token account (discriminator 100) + /// Create an associated light token account (discriminator 100) #[discriminator = 100] #[instruction_decoder(account_names = ["owner", "mint", "fee_payer", "ata", "system_program", "config", "rent_payer"])] CreateAssociatedTokenAccount, diff --git a/sdk-libs/instruction-decoder/src/programs/mod.rs b/sdk-libs/instruction-decoder/src/programs/mod.rs index b205fa17b9..1e3d044f12 100644 --- a/sdk-libs/instruction-decoder/src/programs/mod.rs +++ b/sdk-libs/instruction-decoder/src/programs/mod.rs @@ -2,7 +2,7 @@ //! //! This module contains instruction decoders for native Solana programs //! that use various discriminator sizes: -//! - 1-byte: SPL Token, Token 2022, Compute Budget, Light Token (CToken) +//! - 1-byte: SPL Token, Token 2022, Compute Budget, Light Token //! - 4-byte: System Program //! - 8-byte: Anchor programs (Light Registry, Account Compression, Light System) diff --git a/sdk-libs/macros/docs/accounts/architecture.md b/sdk-libs/macros/docs/accounts/architecture.md index bbe98c3531..257f9c9381 100644 --- a/sdk-libs/macros/docs/accounts/architecture.md +++ b/sdk-libs/macros/docs/accounts/architecture.md @@ -681,7 +681,7 @@ sdk-libs/macros/src/light_pdas/ ### Account Type Documentation - **`pda.md`** - Compressed PDA creation with `#[light_account(init)]` -- **`mint.md`** - Compressed mint creation with `#[light_account(init, mint::...)]` +- **`mint.md`** - Light Mint creation with `#[light_account(init, mint::...)]` - **`token.md`** - Token account creation with `#[light_account(init, token::...)]` - **`associated_token.md`** - ATA creation with `#[light_account(init, associated_token::...)]` diff --git a/sdk-libs/macros/docs/accounts/associated_token.md b/sdk-libs/macros/docs/accounts/associated_token.md index 1a129f0822..2a761cc1a7 100644 --- a/sdk-libs/macros/docs/accounts/associated_token.md +++ b/sdk-libs/macros/docs/accounts/associated_token.md @@ -20,7 +20,7 @@ | `associated_token::authority` | Yes | ATA owner field reference | | `associated_token::mint` | Yes | Token mint field reference | -**Note:** The ATA bump is derived on-chain by the cToken program. It is no longer +**Note:** The ATA bump is derived on-chain by the Light Token program. It is no longer passed in instruction data. ### Infrastructure (auto-detected by name) @@ -29,7 +29,7 @@ passed in instruction data. fee_payer # Pays tx fee light_token_config # Token program config light_token_rent_sponsor # Funds rent-free creation -light_token_program # CToken program +light_token_program # Light Token program system_program # System program ``` diff --git a/sdk-libs/macros/docs/accounts/mint.md b/sdk-libs/macros/docs/accounts/mint.md index a587581737..6d1d197dc5 100644 --- a/sdk-libs/macros/docs/accounts/mint.md +++ b/sdk-libs/macros/docs/accounts/mint.md @@ -1,4 +1,4 @@ -# Compressed Mint Lifecycle +# Light Mint Lifecycle ## Usage @@ -54,7 +54,7 @@ fee_payer # Pays tx fee light_token_config # Token program config light_token_rent_sponsor # Funds rent-free creation light_token_cpi_authority # CPI authority for signing -light_token_program # CToken program +light_token_program # Light Token program system_program # System program ``` @@ -179,7 +179,7 @@ State machine: **No Account -> Compressed+Decompressed -> Compressed <-> Decompr ## 1. Init Phase (Creation) -Creates **both** a compressed mint **and** a decompressed Mint Solana account in a single instruction. +Creates **both** a Light Mint **and** a decompressed Mint Solana account in a single instruction. ### Accounts Layout @@ -206,7 +206,7 @@ Creates **both** a compressed mint **and** a decompressed Mint Solana account in ### State Changes - **On-chain**: Mint PDA created with `CompressionInfo` -- **Off-chain**: Compressed mint registered with address +- **Off-chain**: Light Mint registered with address - **Mint metadata**: `mint_decompressed = false` initially ### CreateMintParams @@ -244,7 +244,7 @@ Compresses and closes the Mint Solana account. **Permissionless** when `is_compr ### State Changes - **On-chain**: Mint PDA closed, lamports returned to `rent_sponsor` -- **Off-chain**: Compressed mint state preserved +- **Off-chain**: Light Mint state preserved - **Mint metadata**: `mint_decompressed = false` ### CompressAndCloseMintAction @@ -256,7 +256,7 @@ pub struct CompressAndCloseMintAction { } ``` -**Idempotent mode**: Useful for foresters to handle already-compressed mints without failing. +**Idempotent mode**: Useful for foresters to handle already-compressed Light Mints without failing. --- @@ -289,14 +289,14 @@ Note: `mint_seed` is not included for decompress (only needed for create/init). | Check | Error | |-------|-------| -| Compressed mint proof valid | `SystemProgramError::ProofVerificationFailed` | -| Authority matches compressed mint authority | `TokenError::InvalidAccountData` | +| Light Mint proof valid | `SystemProgramError::ProofVerificationFailed` | +| Authority matches Light Mint authority | `TokenError::InvalidAccountData` | | `rent_payment >= 2` | `ProgramError::InvalidInstructionData` | ### State Changes - **On-chain**: Mint PDA created/updated -- **Off-chain**: Compressed mint updated with `mint_decompressed = true` +- **Off-chain**: Light Mint updated with `mint_decompressed = true` ### DecompressMintAction @@ -366,7 +366,7 @@ impl Mint { ### Mint Compressed 1. On-chain Mint PDA closed (data empty) -2. Compressed mint exists (query via RPC) +2. Light Mint exists (query via RPC) 3. `metadata.mint_decompressed == false` 4. `metadata.version == 3` diff --git a/sdk-libs/macros/src/lib.rs b/sdk-libs/macros/src/lib.rs index 745f2800bd..fc467cf21d 100644 --- a/sdk-libs/macros/src/lib.rs +++ b/sdk-libs/macros/src/lib.rs @@ -449,7 +449,7 @@ pub fn derive_light_rent_sponsor(input: TokenStream) -> TokenStream { /// This derive macro works alongside Anchor's `#[derive(Accounts)]` to add /// compression finalize logic for: /// - Accounts marked with `#[light_account(init)]` (PDAs) -/// - Accounts marked with `#[light_account(init, mint, ...)]` (compressed mints) +/// - Accounts marked with `#[light_account(init, mint, ...)]` (light mints) /// - Accounts marked with `#[light_account(token, ...)]` (rent-free token accounts) /// /// The trait is defined in `light_account::LightFinalize`. diff --git a/sdk-libs/macros/src/light_pdas/accounts/derive.rs b/sdk-libs/macros/src/light_pdas/accounts/derive.rs index fa94364e09..05c17d9303 100644 --- a/sdk-libs/macros/src/light_pdas/accounts/derive.rs +++ b/sdk-libs/macros/src/light_pdas/accounts/derive.rs @@ -10,7 +10,7 @@ //! //! Account types handled: //! - PDAs (compressed accounts) -//! - Mints (compressed mints - CREATE + DECOMPRESS atomically) +//! - Mints (light mints - CREATE + DECOMPRESS atomically) //! - Token accounts (vaults for transfers) //! - ATAs (associated token accounts) //! diff --git a/sdk-libs/macros/src/light_pdas/accounts/light_account.rs b/sdk-libs/macros/src/light_pdas/accounts/light_account.rs index f5c7e8c0bd..4b8c823b1d 100644 --- a/sdk-libs/macros/src/light_pdas/accounts/light_account.rs +++ b/sdk-libs/macros/src/light_pdas/accounts/light_account.rs @@ -61,7 +61,7 @@ pub(super) use crate::light_pdas::seeds::extract_account_inner_type; pub enum LightAccountType { #[default] Pda, // Default (no type specifier) - for PDAs - Mint, // `mint` keyword - for compressed mints + Mint, // `mint` keyword - for light mints Token, // `token` keyword - for token accounts AssociatedToken, // `associated_token` keyword - for ATAs } diff --git a/sdk-libs/macros/src/light_pdas/parsing/accounts_struct.rs b/sdk-libs/macros/src/light_pdas/parsing/accounts_struct.rs index 11fb1ea018..e711e4a908 100644 --- a/sdk-libs/macros/src/light_pdas/parsing/accounts_struct.rs +++ b/sdk-libs/macros/src/light_pdas/parsing/accounts_struct.rs @@ -29,7 +29,7 @@ pub struct ParsedAccountsStruct { pub generics: syn::Generics, /// Fields marked with `#[light_account(init)]` for compressed PDAs pub pda_fields: Vec, - /// Fields marked with `#[light_account(init, mint::...)]` for compressed mints + /// Fields marked with `#[light_account(init, mint::...)]` for light mints pub mint_fields: Vec, /// Fields marked with `#[light_account([init,] token::...)]` for token accounts pub token_fields: Vec, diff --git a/sdk-libs/macros/src/light_pdas/program/instructions.rs b/sdk-libs/macros/src/light_pdas/program/instructions.rs index 686ee2c2f7..5fce2064e3 100644 --- a/sdk-libs/macros/src/light_pdas/program/instructions.rs +++ b/sdk-libs/macros/src/light_pdas/program/instructions.rs @@ -768,7 +768,7 @@ pub(crate) fn generate_light_program_items_with_backend( items.push(pda_impl); } - // CToken seed provider impls (one per token variant) + // Light Token seed provider impls (one per token variant) if let Some(ref seeds) = token_seeds { if !seeds.is_empty() { let impl_code = diff --git a/sdk-libs/program-test/src/compressible.rs b/sdk-libs/program-test/src/compressible.rs index 00138b5d7b..c96b36209c 100644 --- a/sdk-libs/program-test/src/compressible.rs +++ b/sdk-libs/program-test/src/compressible.rs @@ -137,7 +137,7 @@ pub async fn claim_and_compress( .context .get_program_accounts(&Pubkey::from(LIGHT_TOKEN_PROGRAM_ID)); - // CToken base accounts are 165 bytes, filter above that to exclude empty/minimal accounts + // Light Token base accounts are 165 bytes, filter above that to exclude empty/minimal accounts for account in compressible_ctoken_accounts .iter() .filter(|e| e.1.data.len() >= 165 && e.1.lamports > 0) @@ -205,7 +205,7 @@ pub async fn claim_and_compress( None => { // Account is compressible (has rent deficit) if stored_account.account_type == ACCOUNT_TYPE_TOKEN_ACCOUNT { - // CToken accounts - separate by compression_only + // Light Token accounts - separate by compression_only if stored_account.compression_only { compress_accounts_compression_only.push(*pubkey); } else { @@ -237,7 +237,7 @@ pub async fn claim_and_compress( // This prevents TlvExtensionLengthMismatch errors when batching accounts together const BATCH_SIZE: usize = 10; - // Process compression_only=true CToken accounts + // Process compression_only=true Light Token accounts for chunk in compress_accounts_compression_only.chunks(BATCH_SIZE) { compress_and_close_forester(rpc, chunk, &forester_keypair, &payer, None).await?; for account_pubkey in chunk { @@ -245,7 +245,7 @@ pub async fn claim_and_compress( } } - // Process compression_only=false CToken accounts + // Process compression_only=false Light Token accounts for chunk in compress_accounts_normal.chunks(BATCH_SIZE) { compress_and_close_forester(rpc, chunk, &forester_keypair, &payer, None).await?; for account_pubkey in chunk { @@ -440,13 +440,13 @@ async fn compress_mint_forester( let compressed_mint_address = mint.metadata.compressed_address(); let rent_sponsor = Pubkey::from(mint.compression.rent_sponsor); - // Get the compressed mint account from indexer + // Get the light mint account from indexer let compressed_mint_account = rpc .get_compressed_account(compressed_mint_address, None) .await? .value .ok_or(RpcError::AccountDoesNotExist(format!( - "Compressed mint {:?}", + "Light mint {:?}", compressed_mint_address )))?; @@ -456,7 +456,7 @@ async fn compress_mint_forester( .await? .value; - // Build compressed mint inputs + // Build light mint inputs // IMPORTANT: Set mint to None when Mint is decompressed // This tells on-chain code to read mint data from Mint Solana account // (not from instruction data which would have stale compression_info) diff --git a/sdk-libs/program-test/src/forester/claim_forester.rs b/sdk-libs/program-test/src/forester/claim_forester.rs index bf9634ffe1..a027f5a3e2 100644 --- a/sdk-libs/program-test/src/forester/claim_forester.rs +++ b/sdk-libs/program-test/src/forester/claim_forester.rs @@ -16,7 +16,7 @@ use crate::registry_sdk::{ /// Claim rent from compressible token accounts via the registry program /// /// This function invokes the registry program's claim instruction, -/// which then CPIs to the compressed token program with the correct compression_authority PDA signer. +/// which then CPIs to the Light Token program with the correct compression_authority PDA signer. /// /// # Arguments /// * `rpc` - RPC client with indexer capabilities @@ -32,7 +32,7 @@ pub async fn claim_forester( authority: &Keypair, payer: &Keypair, ) -> Result { - // Compressed token program ID + // Light Token program ID let compressed_token_program_id = Pubkey::from_str_const("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m"); diff --git a/sdk-libs/program-test/src/forester/compress_and_close_forester.rs b/sdk-libs/program-test/src/forester/compress_and_close_forester.rs index 15ab7c5889..33a4f36ae2 100644 --- a/sdk-libs/program-test/src/forester/compress_and_close_forester.rs +++ b/sdk-libs/program-test/src/forester/compress_and_close_forester.rs @@ -19,7 +19,7 @@ use crate::registry_sdk::{ /// Compress and close token accounts via the registry program /// /// This function invokes the registry program's compress_and_close instruction, -/// which then CPIs to the compressed token program with the correct compression_authority PDA signer. +/// which then CPIs to the Light Token program with the correct compression_authority PDA signer. /// /// # Arguments /// * `rpc` - RPC client with indexer capabilities @@ -37,7 +37,7 @@ pub async fn compress_and_close_forester( payer: &Keypair, destination: Option, ) -> Result { - // Compressed token program ID + // Light Token program ID let compressed_token_program_id = Pubkey::from_str_const("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m"); @@ -76,7 +76,7 @@ pub async fn compress_and_close_forester( // Add output queue first packed_accounts.insert_or_get(output_queue); - // Parse the ctoken account to get required pubkeys + // Parse the light-token account to get required pubkeys use light_token_interface::state::Token; use light_zero_copy::traits::ZeroCopyAt; @@ -85,13 +85,13 @@ pub async fn compress_and_close_forester( let mut compression_authority_pubkey: Option = None; for solana_ctoken_account_pubkey in solana_ctoken_accounts { - // Get the ctoken account data + // Get the light-token account data let ctoken_solana_account = rpc .get_account(*solana_ctoken_account_pubkey) .await .map_err(|e| { RpcError::CustomError(format!( - "Failed to get ctoken account {}: {}", + "Failed to get light-token account {}: {}", solana_ctoken_account_pubkey, e )) })? @@ -105,7 +105,7 @@ pub async fn compress_and_close_forester( let (ctoken_account, _) = Token::zero_copy_at(ctoken_solana_account.data.as_slice()) .map_err(|e| { RpcError::CustomError(format!( - "Failed to parse ctoken account {}: {:?}", + "Failed to parse light-token account {}: {:?}", solana_ctoken_account_pubkey, e )) })?; diff --git a/sdk-libs/program-test/src/program_test/test_rpc.rs b/sdk-libs/program-test/src/program_test/test_rpc.rs index 7797873882..3cb45fa488 100644 --- a/sdk-libs/program-test/src/program_test/test_rpc.rs +++ b/sdk-libs/program-test/src/program_test/test_rpc.rs @@ -105,7 +105,7 @@ pub trait TestRpc: Rpc + Sized { fn warp_to_slot(&mut self, slot: Slot) -> Result<(), RpcError>; /// Warps current slot forward by slots. - /// Claims and compresses compressible ctoken accounts. + /// Claims and compresses compressible light-token accounts. async fn warp_slot_forward(&mut self, slot: Slot) -> Result<(), RpcError>; /// Warps forward by the specified number of epochs. @@ -146,7 +146,7 @@ impl TestRpc for LightProgramTest { } /// Warps current slot forward by slots. - /// Claims and compresses compressible ctoken accounts and program PDAs (auto compress). + /// Claims and compresses compressible light-token accounts and program PDAs (auto compress). async fn warp_slot_forward(&mut self, slot: Slot) -> Result<(), RpcError> { let mut current_slot = self.context.get_sysvar::().slot; current_slot += slot; diff --git a/sdk-libs/sdk-types/src/cpi_context_write.rs b/sdk-libs/sdk-types/src/cpi_context_write.rs index 0b34c60590..14a00fca6a 100644 --- a/sdk-libs/sdk-types/src/cpi_context_write.rs +++ b/sdk-libs/sdk-types/src/cpi_context_write.rs @@ -1,7 +1,7 @@ use light_account_checks::AccountInfoTrait; use crate::CpiSigner; -// TODO: move to ctoken types +// TODO: move to light-token types #[derive(Clone, Debug)] pub struct CpiContextWriteAccounts<'a, T: AccountInfoTrait + Clone> { pub fee_payer: &'a T, diff --git a/sdk-libs/sdk-types/src/interface/account/compression_info.rs b/sdk-libs/sdk-types/src/interface/account/compression_info.rs index caf30bc6a9..5137b139ea 100644 --- a/sdk-libs/sdk-types/src/interface/account/compression_info.rs +++ b/sdk-libs/sdk-types/src/interface/account/compression_info.rs @@ -120,7 +120,7 @@ pub trait CompressAs { /// SDK CompressionInfo - a compact 24-byte struct for custom zero-copy PDAs. /// /// This is the lightweight version of compression info used in the SDK. -/// CToken has its own compression handling via `light_compressible::CompressionInfo`. +/// Light Token has its own compression handling via `light_compressible::CompressionInfo`. /// /// # Memory Layout (24 bytes with #[repr(C)]) /// - `last_claimed_slot`: u64 @ offset 0 (8 bytes, 8-byte aligned) @@ -245,7 +245,7 @@ impl CompressionInfo { impl CompressionInfo { /// Calculate top-up lamports required for a write. /// - /// Logic (same as CTokens): + /// Logic (same as Light Tokens): /// - If account is compressible (can't pay current + next epoch): return lamports_per_write + deficit /// - If account has >= max_funded_epochs: return 0 (no top-up needed) /// - Otherwise: return lamports_per_write (maintenance mode) diff --git a/sdk-libs/sdk-types/src/interface/accounts/create_accounts.rs b/sdk-libs/sdk-types/src/interface/accounts/create_accounts.rs index f17ec8365a..ec2409761c 100644 --- a/sdk-libs/sdk-types/src/interface/accounts/create_accounts.rs +++ b/sdk-libs/sdk-types/src/interface/accounts/create_accounts.rs @@ -39,7 +39,7 @@ pub struct PdaInitParam<'a, AI: AccountInfoTrait> { pub account: &'a AI, } -/// Input for creating compressed mints. +/// Input for creating light mints. /// /// Uses owned arrays because `CreateMints` expects `&[AI]` slices, /// and Anchor requires `.to_account_info()` conversion. @@ -109,7 +109,7 @@ pub struct SharedAccounts<'a, AI: AccountInfoTrait> { /// # Const Generics /// /// - `PDAS`: Number of compressed PDAs to register. -/// - `MINTS`: Number of compressed mints to create via `CreateMints`. +/// - `MINTS`: Number of light mints to create via `CreateMints`. /// - `TOKENS`: Number of PDA token vaults to create via `CreateTokenAccountCpi`. /// - `ATAS`: Number of ATAs to create via `CreateTokenAtaCpi`. /// diff --git a/sdk-libs/sdk-types/src/interface/cpi/create_mints.rs b/sdk-libs/sdk-types/src/interface/cpi/create_mints.rs index 59c36d41d8..8ffa1c3468 100644 --- a/sdk-libs/sdk-types/src/interface/cpi/create_mints.rs +++ b/sdk-libs/sdk-types/src/interface/cpi/create_mints.rs @@ -1,4 +1,4 @@ -//! Generic CPI for creating multiple compressed mints. +//! Generic CPI for creating multiple light mints. //! //! This module provides framework-agnostic mint creation via `CreateMintsCpi`, //! generic over `AccountInfoTrait`. Account order matches the cToken program @@ -59,9 +59,9 @@ pub struct SingleMintParams<'a> { pub token_metadata: Option<&'a TokenMetadataInstructionData>, } -/// Parameters for creating one or more compressed mints with decompression. +/// Parameters for creating one or more light mints with decompression. /// -/// Creates N compressed mints and decompresses all to Solana Mint accounts. +/// Creates N light mints and decompresses all to light mint accounts. /// Uses CPI context pattern when N > 1 for efficiency. #[derive(Debug, Clone)] pub struct CreateMintsParams<'a> { @@ -159,7 +159,7 @@ pub struct CreateMintsStaticAccounts<'a, AI: AccountInfoTrait + Clone> { pub cpi_authority: &'a AI, } -/// CPI struct for creating multiple compressed mints. +/// CPI struct for creating multiple light mints. /// /// Generic over `AccountInfoTrait` to work with both solana and pinocchio backends. /// Uses named account fields for clarity and safety. @@ -837,7 +837,7 @@ pub fn find_mint_address(mint_seed: &[u8; 32]) -> ([u8; 32 ) } -/// Derive the compressed mint address from a mint seed and address tree pubkey. +/// Derive the light mint address from a mint seed and address tree pubkey. /// /// This computes `derive_address(find_mint_address(mint_seed).0, address_tree, LIGHT_TOKEN_PROGRAM_ID)`. pub fn derive_mint_compressed_address( @@ -877,7 +877,7 @@ pub fn get_output_queue_next_index( // High-level CreateMints API // ============================================================================ -/// High-level struct for creating compressed mints. +/// High-level struct for creating light mints. /// /// Consolidates proof parsing, tree account resolution, and CPI invocation into /// a single `.invoke()` call. This is the recommended API for creating mints. diff --git a/sdk-libs/sdk-types/src/interface/cpi/create_token_accounts.rs b/sdk-libs/sdk-types/src/interface/cpi/create_token_accounts.rs index 900bd3aad6..21e6785a7b 100644 --- a/sdk-libs/sdk-types/src/interface/cpi/create_token_accounts.rs +++ b/sdk-libs/sdk-types/src/interface/cpi/create_token_accounts.rs @@ -59,7 +59,7 @@ pub fn derive_associated_token_account( // CreateTokenAccountCpi // ============================================================================ -/// CPI builder for creating CToken accounts (vaults). +/// CPI builder for creating Light Token accounts (vaults). /// /// Generic over `AccountInfoTrait` for framework independence. /// @@ -109,7 +109,7 @@ impl<'a, AI: AccountInfoTrait + Clone> CreateTokenAccountCpi<'a, AI> { } } -/// Rent-free enabled CToken account creation CPI. +/// Rent-free enabled Light Token account creation CPI. pub struct CreateTokenAccountRentFreeCpi<'a, AI: AccountInfoTrait + Clone> { base: CreateTokenAccountCpi<'a, AI>, config: &'a AI, @@ -236,7 +236,7 @@ impl<'a, AI: AccountInfoTrait + Clone> CreateTokenAccountRentFreeCpi<'a, AI> { // CreateTokenAtaCpi // ============================================================================ -/// CPI builder for creating CToken ATAs. +/// CPI builder for creating Light Token associated token accounts. /// /// Generic over `AccountInfoTrait` for framework independence. /// @@ -315,7 +315,7 @@ impl<'a, AI: AccountInfoTrait + Clone> CreateTokenAtaCpiIdempotent<'a, AI> { } } -/// Rent-free enabled CToken ATA creation CPI. +/// Rent-free enabled Light Token associated token account creation CPI. pub struct CreateTokenAtaRentFreeCpi<'a, AI: AccountInfoTrait + Clone> { payer: &'a AI, owner: &'a AI, diff --git a/sdk-libs/sdk-types/src/interface/program/decompression/processor.rs b/sdk-libs/sdk-types/src/interface/program/decompression/processor.rs index 66cc8eb141..26eccf2b81 100644 --- a/sdk-libs/sdk-types/src/interface/program/decompression/processor.rs +++ b/sdk-libs/sdk-types/src/interface/program/decompression/processor.rs @@ -327,7 +327,7 @@ where cpi_config, ); - // Token (ctoken) accounts layout (only required when token accounts are present): + // Token (light-token) accounts layout (only required when token accounts are present): // [3] ctoken_rent_sponsor, [6] ctoken_compressible_config let (ctoken_rent_sponsor, ctoken_compressible_config) = if has_token_accounts { let rent_sponsor = remaining_accounts diff --git a/sdk-libs/sdk/src/lib.rs b/sdk-libs/sdk/src/lib.rs index 346b6b3023..b91a9cf02a 100644 --- a/sdk-libs/sdk/src/lib.rs +++ b/sdk-libs/sdk/src/lib.rs @@ -71,7 +71,7 @@ //! 3. `cpi-context` - Enables CPI context operations for batched compressed account operations. //! - available on devnet, localnet, and light-program-test. //! - Enables the use of one validity proof across multiple cpis from different programs in one instruction. -//! - For example spending compressed tokens (owned by the ctoken program) and updating a compressed pda (owned by a custom program) +//! - For example spending compressed tokens (owned by the Light Token program) and updating a compressed pda (owned by a custom program) //! with one validity proof. //! - An instruction should not use more than one validity proof. //! - Requires the v2 feature. diff --git a/sdk-libs/token-client/src/actions/create_mint.rs b/sdk-libs/token-client/src/actions/create_mint.rs index e71a85d1a4..ff241c90a3 100644 --- a/sdk-libs/token-client/src/actions/create_mint.rs +++ b/sdk-libs/token-client/src/actions/create_mint.rs @@ -36,7 +36,7 @@ pub struct TokenMetadata { /// Parameters for creating a new Light Token mint. /// -/// This creates both a compressed mint AND a decompressed Mint Solana account +/// This creates both a light mint AND a light mint account /// in a single instruction. /// /// # Example diff --git a/sdk-libs/token-pinocchio/src/instruction/approve.rs b/sdk-libs/token-pinocchio/src/instruction/approve.rs index af6f821271..d8370d5682 100644 --- a/sdk-libs/token-pinocchio/src/instruction/approve.rs +++ b/sdk-libs/token-pinocchio/src/instruction/approve.rs @@ -10,7 +10,7 @@ use pinocchio::{ use crate::constants::LIGHT_TOKEN_PROGRAM_ID; -/// Approve ctoken via CPI. +/// Approve light-token via CPI. /// /// # Example /// diff --git a/sdk-libs/token-pinocchio/src/instruction/burn.rs b/sdk-libs/token-pinocchio/src/instruction/burn.rs index 2bc9f423b0..be595bb07a 100644 --- a/sdk-libs/token-pinocchio/src/instruction/burn.rs +++ b/sdk-libs/token-pinocchio/src/instruction/burn.rs @@ -10,7 +10,7 @@ use pinocchio::{ use crate::constants::LIGHT_TOKEN_PROGRAM_ID; -/// Burn ctoken via CPI. +/// Burn light-token via CPI. /// /// # Example /// diff --git a/sdk-libs/token-pinocchio/src/instruction/burn_checked.rs b/sdk-libs/token-pinocchio/src/instruction/burn_checked.rs index 4793aaf1a8..8801c3684e 100644 --- a/sdk-libs/token-pinocchio/src/instruction/burn_checked.rs +++ b/sdk-libs/token-pinocchio/src/instruction/burn_checked.rs @@ -10,7 +10,7 @@ use pinocchio::{ use crate::constants::LIGHT_TOKEN_PROGRAM_ID; -/// Burn ctoken checked via CPI. +/// Burn light-token checked via CPI. /// /// # Example /// diff --git a/sdk-libs/token-pinocchio/src/instruction/close.rs b/sdk-libs/token-pinocchio/src/instruction/close.rs index 66922f9d22..3f829a639a 100644 --- a/sdk-libs/token-pinocchio/src/instruction/close.rs +++ b/sdk-libs/token-pinocchio/src/instruction/close.rs @@ -8,7 +8,7 @@ use pinocchio::{ pubkey::Pubkey, }; -/// Close ctoken account via CPI. +/// Close light-token account via CPI. /// /// # Example /// diff --git a/sdk-libs/token-pinocchio/src/instruction/create.rs b/sdk-libs/token-pinocchio/src/instruction/create.rs index 94a5430e4b..93a4e19351 100644 --- a/sdk-libs/token-pinocchio/src/instruction/create.rs +++ b/sdk-libs/token-pinocchio/src/instruction/create.rs @@ -1,4 +1,4 @@ -//! Create CToken account CPI builder for pinocchio. +//! Create Light Token account CPI builder for pinocchio. //! //! Re-exports the generic `CreateTokenAccountCpi` from `light_sdk_types` //! specialized for pinocchio's `AccountInfo`. diff --git a/sdk-libs/token-pinocchio/src/instruction/create_ata.rs b/sdk-libs/token-pinocchio/src/instruction/create_ata.rs index 1b4ba5d5cc..bf4e5d1464 100644 --- a/sdk-libs/token-pinocchio/src/instruction/create_ata.rs +++ b/sdk-libs/token-pinocchio/src/instruction/create_ata.rs @@ -1,4 +1,4 @@ -//! Create CToken ATA CPI builder for pinocchio. +//! Create light-token associated token account CPI builder for pinocchio. //! //! Re-exports the generic `CreateTokenAtaCpi` from `light_sdk_types` //! specialized for pinocchio's `AccountInfo`. diff --git a/sdk-libs/token-pinocchio/src/instruction/create_mint.rs b/sdk-libs/token-pinocchio/src/instruction/create_mint.rs index 6ec8281448..78ad5838c1 100644 --- a/sdk-libs/token-pinocchio/src/instruction/create_mint.rs +++ b/sdk-libs/token-pinocchio/src/instruction/create_mint.rs @@ -317,7 +317,7 @@ pub fn derive_compressed_address(mint: &[u8; 32]) -> [u8; 32] { ) } -/// Finds the compressed mint PDA address from a mint seed. +/// Finds the light mint PDA address from a mint seed. pub fn find_mint_address(mint_seed: &[u8; 32]) -> ([u8; 32], u8) { AccountInfo::find_program_address( &[COMPRESSED_MINT_SEED, mint_seed.as_ref()], diff --git a/sdk-libs/token-pinocchio/src/instruction/create_mints.rs b/sdk-libs/token-pinocchio/src/instruction/create_mints.rs index c246d49f3c..0a2f71ea62 100644 --- a/sdk-libs/token-pinocchio/src/instruction/create_mints.rs +++ b/sdk-libs/token-pinocchio/src/instruction/create_mints.rs @@ -71,7 +71,7 @@ pub use light_sdk_types::interface::cpi::create_mints::{ }; use pinocchio::account_info::AccountInfo; -/// High-level struct for creating compressed mints (pinocchio). +/// High-level struct for creating light mints (pinocchio). /// /// Type alias with pinocchio's `AccountInfo` already set. /// Consolidates proof parsing, tree account resolution, and CPI invocation. diff --git a/sdk-libs/token-pinocchio/src/instruction/freeze.rs b/sdk-libs/token-pinocchio/src/instruction/freeze.rs index 22b845d21e..ea44044b3a 100644 --- a/sdk-libs/token-pinocchio/src/instruction/freeze.rs +++ b/sdk-libs/token-pinocchio/src/instruction/freeze.rs @@ -10,7 +10,7 @@ use pinocchio::{ use crate::constants::LIGHT_TOKEN_PROGRAM_ID; -/// Freeze ctoken via CPI. +/// Freeze light-token account via CPI. /// /// # Example /// diff --git a/sdk-libs/token-pinocchio/src/instruction/mint_to.rs b/sdk-libs/token-pinocchio/src/instruction/mint_to.rs index 7ca415540a..4aaae3e142 100644 --- a/sdk-libs/token-pinocchio/src/instruction/mint_to.rs +++ b/sdk-libs/token-pinocchio/src/instruction/mint_to.rs @@ -10,7 +10,7 @@ use pinocchio::{ use crate::constants::LIGHT_TOKEN_PROGRAM_ID; -/// Mint to ctoken via CPI. +/// Mint to light-token account via CPI. /// /// # Example /// diff --git a/sdk-libs/token-pinocchio/src/instruction/mint_to_checked.rs b/sdk-libs/token-pinocchio/src/instruction/mint_to_checked.rs index 38e0dd8688..c18179f705 100644 --- a/sdk-libs/token-pinocchio/src/instruction/mint_to_checked.rs +++ b/sdk-libs/token-pinocchio/src/instruction/mint_to_checked.rs @@ -10,7 +10,7 @@ use pinocchio::{ use crate::constants::LIGHT_TOKEN_PROGRAM_ID; -/// Mint to ctoken checked via CPI. +/// Mint to light-token account checked via CPI. /// /// # Example /// diff --git a/sdk-libs/token-pinocchio/src/instruction/revoke.rs b/sdk-libs/token-pinocchio/src/instruction/revoke.rs index 1cbca61334..dd4e511b55 100644 --- a/sdk-libs/token-pinocchio/src/instruction/revoke.rs +++ b/sdk-libs/token-pinocchio/src/instruction/revoke.rs @@ -10,7 +10,7 @@ use pinocchio::{ use crate::constants::LIGHT_TOKEN_PROGRAM_ID; -/// Revoke ctoken via CPI. +/// Revoke light-token via CPI. /// /// # Example /// diff --git a/sdk-libs/token-pinocchio/src/instruction/thaw.rs b/sdk-libs/token-pinocchio/src/instruction/thaw.rs index 76d40d2b06..d8907a8e46 100644 --- a/sdk-libs/token-pinocchio/src/instruction/thaw.rs +++ b/sdk-libs/token-pinocchio/src/instruction/thaw.rs @@ -10,7 +10,7 @@ use pinocchio::{ use crate::constants::LIGHT_TOKEN_PROGRAM_ID; -/// Thaw ctoken via CPI. +/// Thaw light-token account via CPI. /// /// # Example /// diff --git a/sdk-libs/token-pinocchio/src/instruction/transfer.rs b/sdk-libs/token-pinocchio/src/instruction/transfer.rs index b27b3ff013..a55a3205aa 100644 --- a/sdk-libs/token-pinocchio/src/instruction/transfer.rs +++ b/sdk-libs/token-pinocchio/src/instruction/transfer.rs @@ -10,7 +10,7 @@ use pinocchio::{ use crate::constants::LIGHT_TOKEN_PROGRAM_ID; -/// Transfer ctoken via CPI. +/// Transfer light-token via CPI. /// /// # Example /// diff --git a/sdk-libs/token-pinocchio/src/instruction/transfer_checked.rs b/sdk-libs/token-pinocchio/src/instruction/transfer_checked.rs index f3b7e8f229..2fabe79959 100644 --- a/sdk-libs/token-pinocchio/src/instruction/transfer_checked.rs +++ b/sdk-libs/token-pinocchio/src/instruction/transfer_checked.rs @@ -10,7 +10,7 @@ use pinocchio::{ use crate::constants::LIGHT_TOKEN_PROGRAM_ID; -/// Transfer ctoken checked via CPI. +/// Transfer light-token checked via CPI. /// /// # Example /// diff --git a/sdk-libs/token-pinocchio/src/instruction/transfer_from_spl.rs b/sdk-libs/token-pinocchio/src/instruction/transfer_from_spl.rs index 3532fac001..66cb7a62c0 100644 --- a/sdk-libs/token-pinocchio/src/instruction/transfer_from_spl.rs +++ b/sdk-libs/token-pinocchio/src/instruction/transfer_from_spl.rs @@ -1,4 +1,4 @@ -//! Transfer from SPL token account to CToken account via CPI. +//! Transfer from SPL token account to Light Token account via CPI. use alloc::{vec, vec::Vec}; @@ -18,7 +18,7 @@ use pinocchio::{ /// Discriminator for Transfer2 instruction const TRANSFER2_DISCRIMINATOR: u8 = 101; -/// Transfer from SPL token account to CToken account via CPI. +/// Transfer from SPL token account to Light Token account via CPI. /// /// # Example /// ```rust,ignore @@ -43,7 +43,7 @@ pub struct TransferFromSplCpi<'info> { pub spl_interface_pda_bump: u8, pub decimals: u8, pub source_spl_token_account: &'info AccountInfo, - /// Destination ctoken account (writable) + /// Destination light-token account (writable) pub destination: &'info AccountInfo, pub authority: &'info AccountInfo, pub mint: &'info AccountInfo, @@ -82,8 +82,8 @@ impl<'info> TransferFromSplCpi<'info> { &self, ) -> Result<(Vec, Vec>, Vec<&AccountInfo>), ProgramError> { // Build compressions: - // 1. Wrap SPL tokens to Light Token pool - // 2. Unwrap from pool to destination ctoken account + // 1. Wrap SPL tokens via SPL interface PDA + // 2. Unwrap from pool to destination light-token account let wrap_from_spl = Compression::compress_spl( self.amount, 0, // mint index @@ -133,7 +133,7 @@ impl<'info> TransferFromSplCpi<'info> { // [1] fee_payer (signer, writable) // [2..] packed_accounts: // - [0] mint (readonly) - // - [1] destination ctoken account (writable) + // - [1] destination light-token account (writable) // - [2] authority (signer, readonly) // - [3] source SPL token account (writable) // - [4] SPL interface PDA (writable) diff --git a/sdk-libs/token-pinocchio/src/instruction/transfer_to_spl.rs b/sdk-libs/token-pinocchio/src/instruction/transfer_to_spl.rs index e3f2015cea..72679bf9a6 100644 --- a/sdk-libs/token-pinocchio/src/instruction/transfer_to_spl.rs +++ b/sdk-libs/token-pinocchio/src/instruction/transfer_to_spl.rs @@ -1,4 +1,4 @@ -//! Transfer from CToken account to SPL token account via CPI. +//! Transfer from Light Token account to SPL token account via CPI. use alloc::{vec, vec::Vec}; @@ -18,12 +18,12 @@ use pinocchio::{ /// Discriminator for Transfer2 instruction const TRANSFER2_DISCRIMINATOR: u8 = 101; -/// Transfer from CToken account to SPL token account via CPI. +/// Transfer from Light Token account to SPL token account via CPI. /// /// # Example /// ```rust,ignore /// TransferToSplCpi { -/// source: &source_ctoken, +/// source: &source_light_token, /// destination_spl_token_account: &destination_spl, /// amount: 100, /// authority: &authority, @@ -78,12 +78,12 @@ impl<'info> TransferToSplCpi<'info> { &self, ) -> Result<(Vec, Vec>, Vec<&AccountInfo>), ProgramError> { // Build compressions: - // 1. Compress from ctoken account to pool + // 1. Transfer from light-token account via SPL interface PDA // 2. Decompress from pool to SPL token account let compress_to_pool = Compression::compress( self.amount, 0, // mint index - 1, // source ctoken account index + 1, // source light-token account index 3, // authority index ); @@ -129,7 +129,7 @@ impl<'info> TransferToSplCpi<'info> { // [1] fee_payer (signer, writable) // [2..] packed_accounts: // - [0] mint (readonly) - // - [1] source ctoken account (writable) + // - [1] source light-token account (writable) // - [2] destination SPL token account (writable) // - [3] authority (signer, readonly) // - [4] SPL interface PDA (writable) diff --git a/sdk-libs/token-sdk/src/instruction/burn.rs b/sdk-libs/token-sdk/src/instruction/burn.rs index f7300e2867..f851faa828 100644 --- a/sdk-libs/token-sdk/src/instruction/burn.rs +++ b/sdk-libs/token-sdk/src/instruction/burn.rs @@ -5,7 +5,7 @@ use solana_instruction::{AccountMeta, Instruction}; use solana_program_error::ProgramError; use solana_pubkey::Pubkey; -/// # Burn tokens from a ctoken account: +/// # Burn tokens from a light-token account: /// ```rust /// # use solana_pubkey::Pubkey; /// # use light_token::instruction::Burn; @@ -38,7 +38,7 @@ pub struct Burn { pub fee_payer: Option, } -/// # Burn ctoken via CPI: +/// # Burn light-token via CPI: /// ```rust,no_run /// # use light_token::instruction::BurnCpi; /// # use solana_account_info::AccountInfo; diff --git a/sdk-libs/token-sdk/src/instruction/burn_checked.rs b/sdk-libs/token-sdk/src/instruction/burn_checked.rs index d4f5163764..71d56f2018 100644 --- a/sdk-libs/token-sdk/src/instruction/burn_checked.rs +++ b/sdk-libs/token-sdk/src/instruction/burn_checked.rs @@ -5,7 +5,7 @@ use solana_instruction::{AccountMeta, Instruction}; use solana_program_error::ProgramError; use solana_pubkey::Pubkey; -/// # Burn tokens from a ctoken account with decimals validation: +/// # Burn tokens from a light-token account with decimals validation: /// ```rust /// # use solana_pubkey::Pubkey; /// # use light_token::instruction::BurnChecked; @@ -41,7 +41,7 @@ pub struct BurnChecked { pub fee_payer: Option, } -/// # Burn ctoken via CPI with decimals validation: +/// # Burn light-token via CPI with decimals validation: /// ```rust,no_run /// # use light_token::instruction::BurnCheckedCpi; /// # use solana_account_info::AccountInfo; diff --git a/sdk-libs/token-sdk/src/instruction/close.rs b/sdk-libs/token-sdk/src/instruction/close.rs index 361e399302..eefc358192 100644 --- a/sdk-libs/token-sdk/src/instruction/close.rs +++ b/sdk-libs/token-sdk/src/instruction/close.rs @@ -6,7 +6,7 @@ use solana_pubkey::Pubkey; use crate::constants::RENT_SPONSOR_V1 as RENT_SPONSOR; -/// # Create a close ctoken account instruction: +/// # Create a close light-token account instruction: /// ```rust /// # use solana_pubkey::Pubkey; /// # use light_token::instruction::{CloseAccount, LIGHT_TOKEN_PROGRAM_ID}; @@ -61,7 +61,7 @@ impl CloseAccount { } } -/// # Close a ctoken account via CPI: +/// # Close a light-token account via CPI: /// ```rust,no_run /// # use light_token::instruction::CloseAccountCpi; /// # use solana_account_info::AccountInfo; diff --git a/sdk-libs/token-sdk/src/instruction/compressible.rs b/sdk-libs/token-sdk/src/instruction/compressible.rs index 11c5a9cb33..d396e9134b 100644 --- a/sdk-libs/token-sdk/src/instruction/compressible.rs +++ b/sdk-libs/token-sdk/src/instruction/compressible.rs @@ -4,7 +4,7 @@ use solana_pubkey::Pubkey; use crate::constants::{LIGHT_TOKEN_CONFIG, RENT_SPONSOR_V1 as RENT_SPONSOR}; -/// Parameters for creating compressible ctoken accounts. +/// Parameters for creating compressible light-token accounts. /// /// Compressible accounts have sponsored rent and can be compressed to compressed /// token accounts when their lamports balance is insufficient. @@ -27,7 +27,7 @@ pub struct CompressibleParams { pub pre_pay_num_epochs: u8, /// Number of lamports transferred on a write operation (eg transfer) when account rent is insufficient to cover the next 2 rent-epochs. /// Default: 766 lamports for 3 hours rent. - /// These lamports keep the ctoken account perpetually funded when used. + /// These lamports keep the light-token account perpetually funded when used. pub lamports_per_write: Option, pub compress_to_account_pubkey: Option, pub compressible_config: Pubkey, @@ -75,7 +75,7 @@ impl CompressibleParams { } } -/// Parameters for creating compressible ctoken accounts via CPI. +/// Parameters for creating compressible light-token accounts via CPI. /// /// # Example /// ```rust,no_run diff --git a/sdk-libs/token-sdk/src/instruction/create.rs b/sdk-libs/token-sdk/src/instruction/create.rs index 91e240e9b3..c2c8c2cc4b 100644 --- a/sdk-libs/token-sdk/src/instruction/create.rs +++ b/sdk-libs/token-sdk/src/instruction/create.rs @@ -11,7 +11,7 @@ use solana_pubkey::Pubkey; use crate::instruction::{compressible::CompressibleParamsCpi, CompressibleParams}; -/// # Create a create ctoken account instruction: +/// # Create a light-token account instruction: /// ```rust /// # use solana_pubkey::Pubkey; /// # use light_token::instruction::CreateTokenAccount; @@ -84,7 +84,7 @@ impl CreateTokenAccount { } } -/// CPI builder for creating CToken accounts (vaults). +/// CPI builder for creating Light Token accounts (vaults). /// /// # Example - Rent-free vault with PDA signing /// ```rust,ignore @@ -163,7 +163,7 @@ impl<'info> CreateTokenAccountCpi<'info> { } } -/// Rent-free enabled CToken account creation CPI. +/// Rent-free enabled Light Token account creation CPI. pub struct CreateTokenAccountRentFreeCpi<'info> { base: CreateTokenAccountCpi<'info>, config: AccountInfo<'info>, diff --git a/sdk-libs/token-sdk/src/instruction/create_associated_token_account.rs b/sdk-libs/token-sdk/src/instruction/create_associated_token_account.rs index 26161f4869..2d32c4aee8 100644 --- a/sdk-libs/token-sdk/src/instruction/create_associated_token_account.rs +++ b/sdk-libs/token-sdk/src/instruction/create_associated_token_account.rs @@ -30,7 +30,7 @@ pub struct CreateCompressibleAssociatedTokenAccountInputs { pub pre_pay_num_epochs: u8, /// Initial lamports to top up for rent payments (optional) pub lamports_per_write: Option, - /// Version of the compressed token account when ctoken account is + /// Version of the compressed token account when light-token account is /// compressed and closed. (The version specifies the hashing scheme.) pub token_account_version: TokenDataVersion, } @@ -181,7 +181,7 @@ pub fn derive_associated_token_account(owner: &Pubkey, mint: &Pubkey) -> Pubkey .0 } -/// CPI wrapper to create a compressible c-token associated token account. +/// CPI wrapper to create a compressible light-token associated token account. #[allow(clippy::too_many_arguments)] pub fn create_associated_token_account_cpi<'info>( payer: AccountInfo<'info>, @@ -220,7 +220,7 @@ pub fn create_associated_token_account_cpi<'info>( ) } -/// CPI wrapper to create a compressible c-token associated token account +/// CPI wrapper to create a compressible light-token associated token account /// idempotently. #[allow(clippy::too_many_arguments)] pub fn create_associated_token_account_idempotent_cpi<'info>( diff --git a/sdk-libs/token-sdk/src/instruction/create_ata.rs b/sdk-libs/token-sdk/src/instruction/create_ata.rs index a76b21a150..6bccc0ff68 100644 --- a/sdk-libs/token-sdk/src/instruction/create_ata.rs +++ b/sdk-libs/token-sdk/src/instruction/create_ata.rs @@ -26,7 +26,7 @@ pub fn derive_associated_token_account(owner: &Pubkey, mint: &Pubkey) -> Pubkey .0 } -/// # Create an associated ctoken account instruction: +/// # Create an associated light-token account instruction: /// ```rust /// # use solana_pubkey::Pubkey; /// # use light_token::instruction::CreateAssociatedTokenAccount; @@ -112,7 +112,7 @@ impl CreateAssociatedTokenAccount { } } -/// CPI builder for creating CToken ATAs. +/// CPI builder for creating Light Token associated token accounts. /// /// # Example - Rent-free ATA (idempotent) /// ```rust,ignore @@ -225,7 +225,7 @@ impl<'info> CreateTokenAtaCpiIdempotent<'info> { } } -/// Rent-free enabled CToken ATA creation CPI. +/// Rent-free enabled Light Token associated token account creation CPI. pub struct CreateTokenAtaRentFreeCpi<'info> { payer: AccountInfo<'info>, owner: AccountInfo<'info>, diff --git a/sdk-libs/token-sdk/src/instruction/decompress.rs b/sdk-libs/token-sdk/src/instruction/decompress.rs index b2c7a3c83c..d4ba2f912d 100644 --- a/sdk-libs/token-sdk/src/instruction/decompress.rs +++ b/sdk-libs/token-sdk/src/instruction/decompress.rs @@ -18,7 +18,7 @@ use solana_pubkey::Pubkey; use crate::utils::get_associated_token_address_and_bump; -/// # Decompress compressed tokens to a cToken account +/// # Decompress compressed tokens to a light-token account /// /// ```rust /// # use solana_pubkey::Pubkey; diff --git a/sdk-libs/token-sdk/src/instruction/decompress_mint.rs b/sdk-libs/token-sdk/src/instruction/decompress_mint.rs index da399c800c..7c1afc39c7 100644 --- a/sdk-libs/token-sdk/src/instruction/decompress_mint.rs +++ b/sdk-libs/token-sdk/src/instruction/decompress_mint.rs @@ -263,9 +263,9 @@ pub struct DecompressCMintWithCpiContext { pub cpi_context_pubkey: Pubkey, /// CPI context flags pub cpi_context: CpiContext, - /// Compressible config account (ctoken's config) + /// Compressible config account (Light Token program config) pub compressible_config: Pubkey, - /// Rent sponsor account (ctoken's rent sponsor) + /// Rent sponsor account (Light Token program rent sponsor) pub rent_sponsor: Pubkey, } @@ -396,7 +396,7 @@ impl<'info> DecompressCMintCpiWithContext<'info> { self.mint.clone(), self.rent_sponsor.clone(), self.payer.clone(), - // Use ctoken's CPI authority for the CPI, not the calling program's authority + // Use the Light Token program's CPI authority for the CPI, not the calling program's authority self.light_token_cpi_authority.clone(), self.system_accounts.registered_program_pda.clone(), self.system_accounts.account_compression_authority.clone(), diff --git a/sdk-libs/token-sdk/src/instruction/mint_to.rs b/sdk-libs/token-sdk/src/instruction/mint_to.rs index ef6480017f..b09905273c 100644 --- a/sdk-libs/token-sdk/src/instruction/mint_to.rs +++ b/sdk-libs/token-sdk/src/instruction/mint_to.rs @@ -5,7 +5,7 @@ use solana_instruction::{AccountMeta, Instruction}; use solana_program_error::ProgramError; use solana_pubkey::Pubkey; -/// # Mint tokens to a ctoken account (simple 3-account instruction): +/// # Mint tokens to a light-token account (simple 3-account instruction): /// ```rust /// # use solana_pubkey::Pubkey; /// # use light_token::instruction::MintTo; @@ -38,7 +38,7 @@ pub struct MintTo { pub fee_payer: Option, } -/// # Mint to ctoken via CPI: +/// # Mint to light-token via CPI: /// ```rust,no_run /// # use light_token::instruction::MintToCpi; /// # use solana_account_info::AccountInfo; diff --git a/sdk-libs/token-sdk/src/instruction/mint_to_checked.rs b/sdk-libs/token-sdk/src/instruction/mint_to_checked.rs index 775d506314..c48cf0575c 100644 --- a/sdk-libs/token-sdk/src/instruction/mint_to_checked.rs +++ b/sdk-libs/token-sdk/src/instruction/mint_to_checked.rs @@ -5,7 +5,7 @@ use solana_instruction::{AccountMeta, Instruction}; use solana_program_error::ProgramError; use solana_pubkey::Pubkey; -/// # Mint tokens to a ctoken account with decimals validation: +/// # Mint tokens to a light-token account with decimals validation: /// ```rust /// # use solana_pubkey::Pubkey; /// # use light_token::instruction::MintToChecked; @@ -41,7 +41,7 @@ pub struct MintToChecked { pub fee_payer: Option, } -/// # Mint to ctoken via CPI with decimals validation: +/// # Mint to light-token via CPI with decimals validation: /// ```rust,no_run /// # use light_token::instruction::MintToCheckedCpi; /// # use solana_account_info::AccountInfo; diff --git a/sdk-libs/token-sdk/src/instruction/transfer.rs b/sdk-libs/token-sdk/src/instruction/transfer.rs index 90985229a2..5e1a8dbfa3 100644 --- a/sdk-libs/token-sdk/src/instruction/transfer.rs +++ b/sdk-libs/token-sdk/src/instruction/transfer.rs @@ -5,7 +5,7 @@ use solana_instruction::{AccountMeta, Instruction}; use solana_program_error::ProgramError; use solana_pubkey::Pubkey; -/// # Create a transfer ctoken instruction: +/// # Create a light-token transfer instruction: /// ```rust /// # use solana_pubkey::Pubkey; /// # use light_token::instruction::Transfer; @@ -35,7 +35,7 @@ pub struct Transfer { pub fee_payer: Option, } -/// # Transfer ctoken via CPI: +/// # Transfer light-token via CPI: /// ```rust,no_run /// # use light_token::instruction::TransferCpi; /// # use solana_account_info::AccountInfo; diff --git a/sdk-libs/token-sdk/src/instruction/transfer_checked.rs b/sdk-libs/token-sdk/src/instruction/transfer_checked.rs index 0a8b088f38..b5018240cd 100644 --- a/sdk-libs/token-sdk/src/instruction/transfer_checked.rs +++ b/sdk-libs/token-sdk/src/instruction/transfer_checked.rs @@ -5,7 +5,7 @@ use solana_instruction::{AccountMeta, Instruction}; use solana_program_error::ProgramError; use solana_pubkey::Pubkey; -/// # Create a transfer ctoken checked instruction: +/// # Create a light-token transfer-checked instruction: /// ```rust /// # use solana_pubkey::Pubkey; /// # use light_token::instruction::TransferChecked; @@ -39,7 +39,7 @@ pub struct TransferChecked { pub fee_payer: Option, } -/// # Transfer ctoken checked via CPI: +/// # Transfer light-token checked via CPI: /// ```rust,no_run /// # use light_token::instruction::TransferCheckedCpi; /// # use solana_account_info::AccountInfo; diff --git a/sdk-libs/token-sdk/src/instruction/transfer_from_spl.rs b/sdk-libs/token-sdk/src/instruction/transfer_from_spl.rs index 48c48b527c..d94db5d203 100644 --- a/sdk-libs/token-sdk/src/instruction/transfer_from_spl.rs +++ b/sdk-libs/token-sdk/src/instruction/transfer_from_spl.rs @@ -42,7 +42,7 @@ pub struct TransferFromSpl { pub spl_interface_pda_bump: u8, pub decimals: u8, pub source_spl_token_account: Pubkey, - /// Destination ctoken account (writable) + /// Destination light-token account (writable) pub destination: Pubkey, pub authority: Pubkey, pub mint: Pubkey, @@ -51,7 +51,7 @@ pub struct TransferFromSpl { pub spl_token_program: Pubkey, } -/// # Transfer SPL to ctoken via CPI: +/// # Transfer SPL to light-token via CPI: /// ```rust,no_run /// # use light_token::instruction::TransferFromSplCpi; /// # use solana_account_info::AccountInfo; @@ -86,7 +86,7 @@ pub struct TransferFromSplCpi<'info> { pub spl_interface_pda_bump: u8, pub decimals: u8, pub source_spl_token_account: AccountInfo<'info>, - /// Destination ctoken account (writable) + /// Destination light-token account (writable) pub destination: AccountInfo<'info>, pub authority: AccountInfo<'info>, pub mint: AccountInfo<'info>, @@ -110,7 +110,7 @@ impl<'info> TransferFromSplCpi<'info> { self.compressed_token_program_authority, // CPI authority PDA (first) self.payer, // Fee payer (second) self.mint, // Index 0: Mint - self.destination, // Index 1: Destination ctoken account + self.destination, // Index 1: Destination light-token account self.authority, // Index 2: Authority (signer) self.source_spl_token_account, // Index 3: Source SPL token account self.spl_interface_pda, // Index 4: SPL interface PDA @@ -127,7 +127,7 @@ impl<'info> TransferFromSplCpi<'info> { self.compressed_token_program_authority, // CPI authority PDA (first) self.payer, // Fee payer (second) self.mint, // Index 0: Mint - self.destination, // Index 1: Destination ctoken account + self.destination, // Index 1: Destination light-token account self.authority, // Index 2: Authority (signer) self.source_spl_token_account, // Index 3: Source SPL token account self.spl_interface_pda, // Index 4: SPL interface PDA @@ -160,7 +160,7 @@ impl TransferFromSpl { let packed_accounts = vec![ // Mint (index 0) AccountMeta::new_readonly(self.mint, false), - // Destination ctoken account (index 1) - writable + // Destination light-token account (index 1) - writable AccountMeta::new(self.destination, false), // Authority for compression (index 2) - signer AccountMeta::new_readonly(self.authority, true), diff --git a/sdk-libs/token-sdk/src/instruction/transfer_to_spl.rs b/sdk-libs/token-sdk/src/instruction/transfer_to_spl.rs index 9ce9d445d7..c6feb0df5d 100644 --- a/sdk-libs/token-sdk/src/instruction/transfer_to_spl.rs +++ b/sdk-libs/token-sdk/src/instruction/transfer_to_spl.rs @@ -13,7 +13,7 @@ use solana_instruction::{AccountMeta, Instruction}; use solana_program_error::ProgramError; use solana_pubkey::Pubkey; -/// # Create a transfer ctoken to SPL instruction: +/// # Create a light-token to SPL transfer instruction: /// ```rust /// # use solana_pubkey::Pubkey; /// # use light_token::instruction::TransferToSpl; @@ -51,7 +51,7 @@ pub struct TransferToSpl { pub spl_token_program: Pubkey, } -/// # Transfer ctoken to SPL via CPI: +/// # Transfer light-token to SPL via CPI: /// ```rust,no_run /// # use light_token::instruction::TransferToSplCpi; /// # use solana_account_info::AccountInfo; @@ -105,7 +105,7 @@ impl<'info> TransferToSplCpi<'info> { self.compressed_token_program_authority, // CPI authority PDA (first) self.payer, // Fee payer (second) self.mint, // Index 0: Mint - self.source, // Index 1: Source ctoken account + self.source, // Index 1: Source light-token account self.destination_spl_token_account, // Index 2: Destination SPL token account self.authority, // Index 3: Authority (signer) self.spl_interface_pda, // Index 4: SPL interface PDA @@ -121,7 +121,7 @@ impl<'info> TransferToSplCpi<'info> { self.compressed_token_program_authority, // CPI authority PDA (first) self.payer, // Fee payer (second) self.mint, // Index 0: Mint - self.source, // Index 1: Source ctoken account + self.source, // Index 1: Source light-token account self.destination_spl_token_account, // Index 2: Destination SPL token account self.authority, // Index 3: Authority (signer) self.spl_interface_pda, // Index 4: SPL interface PDA @@ -154,7 +154,7 @@ impl TransferToSpl { let packed_accounts = vec![ // Mint (index 0) AccountMeta::new_readonly(self.mint, false), - // Source ctoken account (index 1) - writable + // Source light-token account (index 1) - writable AccountMeta::new(self.source, false), // Destination SPL token account (index 2) - writable AccountMeta::new(self.destination_spl_token_account, false), @@ -166,14 +166,14 @@ impl TransferToSpl { AccountMeta::new_readonly(self.spl_token_program, false), ]; - // First operation: compress from ctoken account to pool using compress_spl + // First operation: compress from light-token account via SPL interface PDA let compress_to_pool = CTokenAccount2 { inputs: vec![], output: MultiTokenTransferOutputData::default(), compression: Some(Compression::compress( self.amount, 0, // mint index - 1, // source ctoken account index + 1, // source light-token account index 3, // authority index )), delegate_is_set: false, diff --git a/sdk-libs/token-types/src/account_infos/mint_to_compressed.rs b/sdk-libs/token-types/src/account_infos/mint_to_compressed.rs index 7a4314380d..a9891685a6 100644 --- a/sdk-libs/token-types/src/account_infos/mint_to_compressed.rs +++ b/sdk-libs/token-types/src/account_infos/mint_to_compressed.rs @@ -7,7 +7,7 @@ use crate::error::{LightTokenSdkTypeError, Result}; pub struct DecompressedMintConfig { /// SPL mint account pub mint_pda: T, - /// Token pool PDA + /// SPL interface PDA pub token_pool_pda: T, /// Token program (typically spl_token_2022::ID) pub token_program: T, diff --git a/sdk-libs/token-types/src/account_infos/transfer.rs b/sdk-libs/token-types/src/account_infos/transfer.rs index 9cff48627e..bd068ea71a 100644 --- a/sdk-libs/token-types/src/account_infos/transfer.rs +++ b/sdk-libs/token-types/src/account_infos/transfer.rs @@ -212,7 +212,7 @@ impl<'a, T: AccountInfoTrait + Clone> TransferAccountInfos<'a, T> { pub fn system_accounts_len(&self) -> usize { let mut len = 12; // Base system accounts length if !self.config.is_compress_or_decompress() { - // Token pool pda & compression sender or decompression recipient + // SPL interface PDA & compression sender or decompression recipient len -= 3; } if !self.config.cpi_context { diff --git a/sdk-libs/token-types/src/error.rs b/sdk-libs/token-types/src/error.rs index 0e8fba928d..7a5e00a2dd 100644 --- a/sdk-libs/token-types/src/error.rs +++ b/sdk-libs/token-types/src/error.rs @@ -14,7 +14,7 @@ pub enum LightTokenSdkTypeError { SolPoolPdaUndefined, #[error("Mint is undefined for batch compress")] MintUndefinedForBatchCompress, - #[error("Token pool PDA is undefined for compressed")] + #[error("SPL interface PDA is undefined for compressed")] TokenPoolUndefinedForCompressed, #[error("Token program is undefined for compressed")] TokenProgramUndefinedForCompressed, diff --git a/sdk-libs/token-types/src/lib.rs b/sdk-libs/token-types/src/lib.rs index b0c16f53ea..e271434a65 100644 --- a/sdk-libs/token-types/src/lib.rs +++ b/sdk-libs/token-types/src/lib.rs @@ -1,10 +1,10 @@ //! # light-token-types //! -//! Instruction data and account metadata types for compressed tokens. +//! Instruction data and account metadata types for light tokens. //! //! | Type | Description | //! |------|-------------| -//! | [`TokenAccountMeta`](instruction::TokenAccountMeta) | Compressed token account metadata | +//! | [`TokenAccountMeta`](instruction::TokenAccountMeta) | Light token account metadata | //! | [`BatchCompressInstructionData`](instruction::BatchCompressInstructionData) | Batch compress instruction data | //! | [`CompressedTokenInstructionDataApprove`](instruction::CompressedTokenInstructionDataApprove) | Approve/delegation instruction data | //! | [`PackedMerkleContext`](instruction::PackedMerkleContext) | Merkle tree context for proofs | diff --git a/sdk-tests/CLAUDE.md b/sdk-tests/CLAUDE.md index 63f7a284b6..4c7f119257 100644 --- a/sdk-tests/CLAUDE.md +++ b/sdk-tests/CLAUDE.md @@ -69,7 +69,7 @@ Tests for Light SDK V2 with Pinocchio framework. ```bash cargo test-sbf -p sdk-token-test ``` -Tests for compressed token SDK operations (mint, transfer, burn, etc.). +Tests for light token SDK operations (mint, transfer, burn, etc.). ### Client Tests ```bash diff --git a/sdk-tests/anchor-semi-manual-test/tests/shared/mod.rs b/sdk-tests/anchor-semi-manual-test/tests/shared/mod.rs index 293c26399c..99b3cfebd2 100644 --- a/sdk-tests/anchor-semi-manual-test/tests/shared/mod.rs +++ b/sdk-tests/anchor-semi-manual-test/tests/shared/mod.rs @@ -55,7 +55,7 @@ pub async fn setup_test_env() -> TestEnv { } } -/// Creates a compressed mint using the ctoken SDK. +/// Creates a light mint using the light-token SDK. /// Returns (mint_pda, mint_seed_keypair). pub async fn setup_create_mint( rpc: &mut (impl Rpc + Indexer), diff --git a/sdk-tests/anchor-semi-manual-test/tests/test_create_all.rs b/sdk-tests/anchor-semi-manual-test/tests/test_create_all.rs index 3f5028ec3f..6246c46d54 100644 --- a/sdk-tests/anchor-semi-manual-test/tests/test_create_all.rs +++ b/sdk-tests/anchor-semi-manual-test/tests/test_create_all.rs @@ -320,7 +320,7 @@ async fn test_create_all_derive() { }); let vault_compressed = vault_iface .compressed() - .expect("cold vault must have compressed data"); + .expect("cold vault must have compressed light-token data"); let vault_interface = AccountInterface { key: vault_iface.key, account: vault_iface.account.clone(), diff --git a/sdk-tests/anchor-semi-manual-test/tests/test_create_ata.rs b/sdk-tests/anchor-semi-manual-test/tests/test_create_ata.rs index c58819dff9..39d7b50893 100644 --- a/sdk-tests/anchor-semi-manual-test/tests/test_create_ata.rs +++ b/sdk-tests/anchor-semi-manual-test/tests/test_create_ata.rs @@ -95,7 +95,7 @@ async fn test_create_ata_derive() { use anchor_semi_manual_test::LightAccountVariant; use light_client::interface::AccountInterface; - // Mint must be decompressed first since ATA depends on it + // Mint must be decompressed first since associated token account depends on it let mint_iface = rpc .get_mint_interface(&mint, None) .await @@ -111,7 +111,7 @@ async fn test_create_ata_derive() { .expect("failed to get ATA interface") .value .expect("ATA interface should exist"); - assert!(ata_interface.is_cold(), "ATA should be cold"); + assert!(ata_interface.is_cold(), "Associated token account should be cold"); // Mint must come before ATA since ATA depends on mint being decompressed let specs: Vec> = vec![ diff --git a/sdk-tests/client-test/tests/light_client.rs b/sdk-tests/client-test/tests/light_client.rs index c8d1bb28bc..0d9375b7fb 100644 --- a/sdk-tests/client-test/tests/light_client.rs +++ b/sdk-tests/client-test/tests/light_client.rs @@ -691,7 +691,7 @@ fn create_two_mints(rpc: &LightClient, payer_pubkey: Pubkey, mint_1: &Keypair, m 2, ) .unwrap(); - // Create token pool for compression + // Create SPL interface PDA for compression let create_pool_ix = create_create_token_pool_instruction(&payer_pubkey, &mint_1.pubkey(), false); let create_pool_ix_2 = diff --git a/sdk-tests/client-test/tests/light_program_test.rs b/sdk-tests/client-test/tests/light_program_test.rs index 3bc531baf0..92f4293a99 100644 --- a/sdk-tests/client-test/tests/light_program_test.rs +++ b/sdk-tests/client-test/tests/light_program_test.rs @@ -571,7 +571,7 @@ async fn create_two_mints( 2, ) .unwrap(); - // Create token pool for compression + // Create SPL interface PDA for compression let create_pool_ix = create_create_token_pool_instruction(&payer_pubkey, &mint_1.pubkey(), false); let create_pool_ix_2 = diff --git a/sdk-tests/csdk-anchor-full-derived-test/tests/amm_test.rs b/sdk-tests/csdk-anchor-full-derived-test/tests/amm_test.rs index 050531f970..a02e9f968d 100644 --- a/sdk-tests/csdk-anchor-full-derived-test/tests/amm_test.rs +++ b/sdk-tests/csdk-anchor-full-derived-test/tests/amm_test.rs @@ -110,7 +110,7 @@ async fn setup() -> AmmTestContext { .await .unwrap(); - // Create two light mints (cmints) for token_0 and token_1 + // Create two Light Mints for token_0 and token_1 // Using shared::setup_create_mint which creates both compressed mint and on-chain Mint account let (mint_a, _compression_addr_a, ata_pubkeys_a, _mint_seed_a) = shared::setup_create_mint( &mut rpc, diff --git a/sdk-tests/csdk-anchor-full-derived-test/tests/mint/metadata_test.rs b/sdk-tests/csdk-anchor-full-derived-test/tests/mint/metadata_test.rs index bbedbd1998..b2f4b2b18f 100644 --- a/sdk-tests/csdk-anchor-full-derived-test/tests/mint/metadata_test.rs +++ b/sdk-tests/csdk-anchor-full-derived-test/tests/mint/metadata_test.rs @@ -217,10 +217,10 @@ async fn test_create_mint_with_metadata() { rpc.warp_slot_forward(SLOTS_PER_EPOCH * 30).await.unwrap(); // After warp: mint should be closed on-chain - shared::assert_onchain_closed(&mut rpc, &cmint_pda, "cmint").await; + shared::assert_onchain_closed(&mut rpc, &cmint_pda, "light_mint").await; // Compressed mint should exist with non-empty data (now compressed) - shared::assert_compressed_exists_with_data(&mut rpc, mint_compressed_address, "cmint").await; + shared::assert_compressed_exists_with_data(&mut rpc, mint_compressed_address, "light_mint").await; // PHASE 3: Decompress mint and verify metadata is preserved diff --git a/sdk-tests/pinocchio-light-program-test/tests/shared/mod.rs b/sdk-tests/pinocchio-light-program-test/tests/shared/mod.rs index c855d4289a..a0d2a221c5 100644 --- a/sdk-tests/pinocchio-light-program-test/tests/shared/mod.rs +++ b/sdk-tests/pinocchio-light-program-test/tests/shared/mod.rs @@ -57,7 +57,7 @@ pub async fn setup_test_env() -> TestEnv { } } -/// Creates a compressed mint using the ctoken SDK. +/// Creates a light mint using the light-token SDK. /// Returns (mint_pda, mint_seed_keypair). pub async fn setup_create_mint( rpc: &mut (impl Rpc + Indexer), diff --git a/sdk-tests/pinocchio-light-program-test/tests/stress_test.rs b/sdk-tests/pinocchio-light-program-test/tests/stress_test.rs index 42e41ece33..3f72f090a1 100644 --- a/sdk-tests/pinocchio-light-program-test/tests/stress_test.rs +++ b/sdk-tests/pinocchio-light-program-test/tests/stress_test.rs @@ -1,7 +1,7 @@ /// Stress test: 20-iteration compression/decompression cycles for all account types. /// /// Each iteration randomly selects a subset of accounts to decompress, leaving the rest -/// compressed. Tests that hot/cold accounts coexist correctly across repeated cycles. +/// compressed. Tests that hot/cold light-token accounts coexist correctly across repeated cycles. mod shared; use light_account::LightDiscriminator; @@ -33,7 +33,7 @@ use solana_keypair::Keypair; use solana_pubkey::Pubkey; use solana_signer::Signer; -/// Which accounts are hot (decompressed / on-chain) this iteration. +/// Which accounts are hot (decompressed to light-token accounts) this iteration. #[derive(Debug, Clone)] struct HotSet { record: bool, diff --git a/sdk-tests/pinocchio-manual-test/src/all/accounts.rs b/sdk-tests/pinocchio-manual-test/src/all/accounts.rs index 3018df4509..21d3294745 100644 --- a/sdk-tests/pinocchio-manual-test/src/all/accounts.rs +++ b/sdk-tests/pinocchio-manual-test/src/all/accounts.rs @@ -37,7 +37,7 @@ pub struct CreateAllParams { /// CPI context indices: /// - PDA 0: Borsh PDA (MinimalRecord) - index 0 /// - PDA 1: ZeroCopy PDA (ZeroCopyRecord) - index 1 -/// - Mint 0: Compressed mint - index 2 (offset by NUM_LIGHT_PDAS=2) +/// - Mint 0: Light Mint - index 2 (offset by NUM_LIGHT_PDAS=2) pub struct CreateAllAccounts<'a> { pub payer: &'a AccountInfo, pub authority: &'a AccountInfo, diff --git a/sdk-tests/pinocchio-manual-test/src/all/mod.rs b/sdk-tests/pinocchio-manual-test/src/all/mod.rs index 6117f64308..17b3b1feee 100644 --- a/sdk-tests/pinocchio-manual-test/src/all/mod.rs +++ b/sdk-tests/pinocchio-manual-test/src/all/mod.rs @@ -3,7 +3,7 @@ //! This module demonstrates creating ALL account types in a single instruction: //! - Borsh PDA (MinimalRecord) //! - ZeroCopy PDA (ZeroCopyRecord) -//! - Compressed Mint +//! - Light Mint //! - Token Vault //! - Associated Token Account (ATA) //! diff --git a/sdk-tests/pinocchio-manual-test/src/two_mints/mod.rs b/sdk-tests/pinocchio-manual-test/src/two_mints/mod.rs index 2876d485c8..f6c187b9da 100644 --- a/sdk-tests/pinocchio-manual-test/src/two_mints/mod.rs +++ b/sdk-tests/pinocchio-manual-test/src/two_mints/mod.rs @@ -1,4 +1,4 @@ -//! Two mints instruction - creates two compressed mints using derived PDAs. +//! Two mints instruction - creates two Light Mints using derived PDAs. pub mod accounts; mod derived; diff --git a/sdk-tests/pinocchio-manual-test/tests/account_loader.rs b/sdk-tests/pinocchio-manual-test/tests/account_loader.rs index e9418a57df..7aaf18cded 100644 --- a/sdk-tests/pinocchio-manual-test/tests/account_loader.rs +++ b/sdk-tests/pinocchio-manual-test/tests/account_loader.rs @@ -123,7 +123,7 @@ async fn test_zero_copy_create_compress_decompress() { .expect("account interface should exist"); assert!( account_interface.is_cold(), - "Account should be cold (compressed)" + "Account should be cold (compressed light-token)" ); // Build variant using IntoVariant - verify seeds match the compressed data diff --git a/sdk-tests/pinocchio-manual-test/tests/all.rs b/sdk-tests/pinocchio-manual-test/tests/all.rs index f49f1be613..724eb7ff8d 100644 --- a/sdk-tests/pinocchio-manual-test/tests/all.rs +++ b/sdk-tests/pinocchio-manual-test/tests/all.rs @@ -3,7 +3,7 @@ //! Creates: //! - Borsh PDA (MinimalRecord) //! - ZeroCopy PDA (ZeroCopyRecord) -//! - Compressed Mint +//! - Light Mint //! - Token Vault //! - Associated Token Account (ATA) diff --git a/sdk-tests/pinocchio-manual-test/tests/two_mints.rs b/sdk-tests/pinocchio-manual-test/tests/two_mints.rs index ffb9831932..726ecb4106 100644 --- a/sdk-tests/pinocchio-manual-test/tests/two_mints.rs +++ b/sdk-tests/pinocchio-manual-test/tests/two_mints.rs @@ -18,7 +18,7 @@ use solana_sdk::{ signature::{Keypair, Signer}, }; -/// Test creating two compressed mints using derived PDA mint signers. +/// Test creating two Light Mints using derived PDA mint signers. #[tokio::test] async fn test_create_derived_mints() { let (mut rpc, payer, _) = shared::setup_test_env().await; diff --git a/sdk-tests/sdk-light-token-pinocchio/README.md b/sdk-tests/sdk-light-token-pinocchio/README.md index c8534c461d..e20960f50b 100644 --- a/sdk-tests/sdk-light-token-pinocchio/README.md +++ b/sdk-tests/sdk-light-token-pinocchio/README.md @@ -1,6 +1,6 @@ -# Native CToken Examples +# Native Light Token Examples -This program demonstrates how to use compressed tokens (ctokens) from Light Protocol in a native Solana program (no Anchor framework). +This program demonstrates how to use light tokens from Light Protocol in a native Solana program (no Anchor framework). ## Overview @@ -15,9 +15,9 @@ The program showcases **8 different instructions** that cover the core compresse 7. **transfer_interface_invoke** - Transfer compressed tokens (regular authority) 8. **transfer_interface_invoke_signed** - Transfer from PDA-owned account -## Implementation Pattern: Builder Pattern from `ctoken` Module +## Implementation Pattern: Builder Pattern from `light-token` Module -This implementation uses the **builder pattern** from the `light-token::ctoken` module. This pattern provides a clean, ergonomic API for CPI operations. +This implementation uses the **builder pattern** from the `light-token` module. This pattern provides a clean, ergonomic API for CPI operations. ### Why Use the Builder Pattern? @@ -66,7 +66,7 @@ transfer_accounts.invoke_signed(&[signer_seeds])?; ### ✅ Fully Implemented (8/8 Instructions) -All instructions use the **builder pattern** from `light-token::ctoken`: +All instructions use the **builder pattern** from `light-token`: - **create_cmint** (Instruction 0): Create compressed mint using `CreateCMintCpi::invoke()` - **mint_to_ctoken** (Instruction 1): Mint tokens to compressed accounts using `MintToCTokenCpi::invoke()` @@ -82,7 +82,7 @@ All instructions compile successfully and demonstrate the clean builder pattern ## Project Structure ``` -ctoken/native/ +light-token/native/ ├── Cargo.toml # Path dependencies to light-protocol2/sdk-libs ├── Xargo.toml # Solana BPF build configuration ├── src/ @@ -94,7 +94,7 @@ ctoken/native/ All dependencies use **path references** to `/Users/ananas/dev/light-protocol2/sdk-libs/`: -- `light-token` → Main SDK with ctoken builder pattern +- `light-token` → Main SDK with light-token builder pattern - `light-token-types` → Type definitions - `light-sdk` → Core SDK - `light-sdk-types` → Common types @@ -144,7 +144,7 @@ This is useful for: ### Builder Pattern Benefits -The `Cpi` structs from the `ctoken` module provide: +The `Cpi` structs from the `light-token` module provide: 1. **invoke()** - For regular CPI calls where the program acts as authority 2. **invoke_signed()** - For PDA-signed CPI calls @@ -167,5 +167,5 @@ To complete this example program: ## References - [Light Protocol Documentation](https://www.lightprotocol.com/developers) -- [Compressed Token SDK Source](/Users/ananas/dev/light-protocol2/sdk-libs/compressed-token-sdk) -- [CToken Module](/Users/ananas/dev/light-protocol2/sdk-libs/compressed-token-sdk/src/ctoken) +- [Light Token SDK Source](/Users/ananas/dev/light-protocol2/sdk-libs/compressed-token-sdk) +- [Light Token Module](/Users/ananas/dev/light-protocol2/sdk-libs/compressed-token-sdk/src/ctoken) diff --git a/sdk-tests/sdk-light-token-pinocchio/tests/test_create_mint.rs b/sdk-tests/sdk-light-token-pinocchio/tests/test_create_mint.rs index df4203d5dd..54c4eb5654 100644 --- a/sdk-tests/sdk-light-token-pinocchio/tests/test_create_mint.rs +++ b/sdk-tests/sdk-light-token-pinocchio/tests/test_create_mint.rs @@ -1,4 +1,4 @@ -// Tests for CreateMintCpi (CreateCmint instruction) +// Tests for CreateMintCpi (CreateMint instruction) mod shared; diff --git a/sdk-tests/sdk-light-token-test/README.md b/sdk-tests/sdk-light-token-test/README.md index c8534c461d..e20960f50b 100644 --- a/sdk-tests/sdk-light-token-test/README.md +++ b/sdk-tests/sdk-light-token-test/README.md @@ -1,6 +1,6 @@ -# Native CToken Examples +# Native Light Token Examples -This program demonstrates how to use compressed tokens (ctokens) from Light Protocol in a native Solana program (no Anchor framework). +This program demonstrates how to use light tokens from Light Protocol in a native Solana program (no Anchor framework). ## Overview @@ -15,9 +15,9 @@ The program showcases **8 different instructions** that cover the core compresse 7. **transfer_interface_invoke** - Transfer compressed tokens (regular authority) 8. **transfer_interface_invoke_signed** - Transfer from PDA-owned account -## Implementation Pattern: Builder Pattern from `ctoken` Module +## Implementation Pattern: Builder Pattern from `light-token` Module -This implementation uses the **builder pattern** from the `light-token::ctoken` module. This pattern provides a clean, ergonomic API for CPI operations. +This implementation uses the **builder pattern** from the `light-token` module. This pattern provides a clean, ergonomic API for CPI operations. ### Why Use the Builder Pattern? @@ -66,7 +66,7 @@ transfer_accounts.invoke_signed(&[signer_seeds])?; ### ✅ Fully Implemented (8/8 Instructions) -All instructions use the **builder pattern** from `light-token::ctoken`: +All instructions use the **builder pattern** from `light-token`: - **create_cmint** (Instruction 0): Create compressed mint using `CreateCMintCpi::invoke()` - **mint_to_ctoken** (Instruction 1): Mint tokens to compressed accounts using `MintToCTokenCpi::invoke()` @@ -82,7 +82,7 @@ All instructions compile successfully and demonstrate the clean builder pattern ## Project Structure ``` -ctoken/native/ +light-token/native/ ├── Cargo.toml # Path dependencies to light-protocol2/sdk-libs ├── Xargo.toml # Solana BPF build configuration ├── src/ @@ -94,7 +94,7 @@ ctoken/native/ All dependencies use **path references** to `/Users/ananas/dev/light-protocol2/sdk-libs/`: -- `light-token` → Main SDK with ctoken builder pattern +- `light-token` → Main SDK with light-token builder pattern - `light-token-types` → Type definitions - `light-sdk` → Core SDK - `light-sdk-types` → Common types @@ -144,7 +144,7 @@ This is useful for: ### Builder Pattern Benefits -The `Cpi` structs from the `ctoken` module provide: +The `Cpi` structs from the `light-token` module provide: 1. **invoke()** - For regular CPI calls where the program acts as authority 2. **invoke_signed()** - For PDA-signed CPI calls @@ -167,5 +167,5 @@ To complete this example program: ## References - [Light Protocol Documentation](https://www.lightprotocol.com/developers) -- [Compressed Token SDK Source](/Users/ananas/dev/light-protocol2/sdk-libs/compressed-token-sdk) -- [CToken Module](/Users/ananas/dev/light-protocol2/sdk-libs/compressed-token-sdk/src/ctoken) +- [Light Token SDK Source](/Users/ananas/dev/light-protocol2/sdk-libs/compressed-token-sdk) +- [Light Token Module](/Users/ananas/dev/light-protocol2/sdk-libs/compressed-token-sdk/src/ctoken) diff --git a/sdk-tests/sdk-light-token-test/tests/scenario_spl.rs b/sdk-tests/sdk-light-token-test/tests/scenario_spl.rs index 9efa3e2eda..5ac4f26e67 100644 --- a/sdk-tests/sdk-light-token-test/tests/scenario_spl.rs +++ b/sdk-tests/sdk-light-token-test/tests/scenario_spl.rs @@ -13,7 +13,7 @@ // 10. Advance epochs to trigger compression // 11. Verify cToken account is compressed and closed // 12. Recreate cToken ATA -// 13. Decompress compressed tokens back to cToken account +// 13. Decompress compressed light tokens to light-token account // 14. Verify cToken account has tokens again use anchor_spl::token::{spl_token, Mint}; diff --git a/sdk-tests/sdk-light-token-test/tests/shared.rs b/sdk-tests/sdk-light-token-test/tests/shared.rs index 79f591ffa3..a3bc2f8847 100644 --- a/sdk-tests/sdk-light-token-test/tests/shared.rs +++ b/sdk-tests/sdk-light-token-test/tests/shared.rs @@ -203,7 +203,7 @@ pub async fn setup_create_mint_with_freeze_authority( ); let instruction = create_mint_builder.instruction().unwrap(); - // Send transaction (CreateMint now creates both compressed mint AND Mint Solana account) + // Send transaction (CreateMint now creates both light mint AND light mint account) rpc.create_and_send_transaction(&[instruction], &payer.pubkey(), &[payer, &mint_seed]) .await .unwrap(); diff --git a/sdk-tests/sdk-light-token-test/tests/test_create_mint.rs b/sdk-tests/sdk-light-token-test/tests/test_create_mint.rs index ea63f9b1d9..c5253c5ecb 100644 --- a/sdk-tests/sdk-light-token-test/tests/test_create_mint.rs +++ b/sdk-tests/sdk-light-token-test/tests/test_create_mint.rs @@ -23,7 +23,7 @@ use solana_sdk::{ signer::Signer, }; -/// Test creating a compressed mint using CreateMintCpi::invoke() +/// Test creating a light mint using CreateMintCpi::invoke() #[tokio::test] async fn test_create_compressed_mint() { let mut rpc = LightProgramTest::new(ProgramTestConfig::new_v2( @@ -144,7 +144,7 @@ async fn test_create_compressed_mint() { .await .unwrap(); - // Verify the Mint Solana account was created (CreateMint now decompresses automatically) + // Verify the light mint account was created (CreateMint now decompresses automatically) let mint_account = rpc.get_account(mint_pda).await.unwrap(); assert!(mint_account.is_some(), "Mint Solana account should exist"); } diff --git a/sdk-tests/sdk-light-token-test/tests/test_transfer_checked.rs b/sdk-tests/sdk-light-token-test/tests/test_transfer_checked.rs index 9730f0eecb..3ebaeee9b7 100644 --- a/sdk-tests/sdk-light-token-test/tests/test_transfer_checked.rs +++ b/sdk-tests/sdk-light-token-test/tests/test_transfer_checked.rs @@ -66,7 +66,7 @@ async fn test_ctoken_transfer_checked_spl_mint() { .await .unwrap(); - // Create token pool for SPL interface + // Create SPL interface PDA let create_pool_ix = CreateSplInterfacePda::new(payer.pubkey(), mint, anchor_spl::token::ID, false) .instruction(); diff --git a/sdk-tests/sdk-light-token-test/tests/test_transfer_interface.rs b/sdk-tests/sdk-light-token-test/tests/test_transfer_interface.rs index 7347ddf7f7..af8783cca2 100644 --- a/sdk-tests/sdk-light-token-test/tests/test_transfer_interface.rs +++ b/sdk-tests/sdk-light-token-test/tests/test_transfer_interface.rs @@ -76,7 +76,7 @@ async fn test_transfer_interface_spl_to_ctoken_invoke() { .unwrap(); let ctoken_account = derive_token_ata(&recipient.pubkey(), &mint); - // Get token pool PDA + // Get SPL interface PDA let (spl_interface_pda, spl_interface_pda_bump) = find_spl_interface_pda_with_index(&mint, 0, false); let compressed_token_program_id = diff --git a/sdk-tests/single-account-loader-test/tests/test.rs b/sdk-tests/single-account-loader-test/tests/test.rs index 49e51e544c..8b49c2b40e 100644 --- a/sdk-tests/single-account-loader-test/tests/test.rs +++ b/sdk-tests/single-account-loader-test/tests/test.rs @@ -247,7 +247,7 @@ async fn test_zero_copy_record_full_lifecycle() { .expect("account interface should exist"); assert!( account_interface.is_cold(), - "Account should be cold (compressed)" + "Account should be cold (compressed light-token)" ); // Build variant using IntoVariant - verify seeds match the compressed data diff --git a/sdk-tests/single-ata-test/tests/test.rs b/sdk-tests/single-ata-test/tests/test.rs index 0196b17a23..3ba27c164d 100644 --- a/sdk-tests/single-ata-test/tests/test.rs +++ b/sdk-tests/single-ata-test/tests/test.rs @@ -14,7 +14,7 @@ use solana_keypair::Keypair; use solana_pubkey::Pubkey; use solana_signer::Signer; -/// Setup helper: Creates a compressed mint directly using the ctoken SDK. +/// Setup helper: Creates a light mint directly using the light-token SDK. /// Returns (mint_pda, mint_seed_keypair) async fn setup_create_mint( rpc: &mut (impl Rpc + Indexer),