repo_id
stringclasses
279 values
file_path
stringlengths
43
179
content
stringlengths
1
4.18M
__index_level_0__
int64
0
0
solana_public_repos/Lightprotocol/light-protocol/programs/system/src
solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke_cpi/verify_signer.rs
use account_compression::{ utils::{check_discrimininator::check_discriminator, constants::CPI_AUTHORITY_PDA_SEED}, AddressMerkleTreeAccount, StateMerkleTreeAccount, }; use anchor_lang::prelude::*; use light_concurrent_merkle_tree::zero_copy::ConcurrentMerkleTreeZeroCopy; use light_hasher::Poseidon; use light_he...
0
solana_public_repos/Lightprotocol/light-protocol/programs/system/src
solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke_cpi/mod.rs
pub mod instruction; pub use instruction::*; pub mod account; pub mod initialize; pub mod process_cpi_context; pub mod processor; pub mod verify_signer;
0
solana_public_repos/Lightprotocol/light-protocol/programs/system/src
solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke_cpi/account.rs
use aligned_sized::aligned_sized; use anchor_lang::prelude::*; use crate::InstructionDataInvokeCpi; /// Collects instruction data without executing a compressed transaction. /// Signer checks are performed on instruction data. /// Collected instruction data is combined with the instruction data of the executing cpi, ...
0
solana_public_repos/Lightprotocol/light-protocol/programs/system/src
solana_public_repos/Lightprotocol/light-protocol/programs/system/src/invoke_cpi/instruction.rs
use account_compression::{program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED}; use anchor_lang::{ prelude::*, solana_program::pubkey::Pubkey, system_program::System, AnchorDeserialize, AnchorSerialize, }; use super::account::CpiContextAccount; use crate::{ invoke::{processor::CompressedP...
0
solana_public_repos/Lightprotocol/light-protocol/programs
solana_public_repos/Lightprotocol/light-protocol/programs/registry/Cargo.toml
[package] name = "light-registry" version = "1.2.0" description = "Light core protocol logic" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "light_registry" [features] no-entrypoint = [] no-idl = [] no-log-ix-name = [...
0
solana_public_repos/Lightprotocol/light-protocol/programs
solana_public_repos/Lightprotocol/light-protocol/programs/registry/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/constants.rs
use anchor_lang::prelude::*; #[constant] pub const FORESTER_SEED: &[u8] = b"forester"; #[constant] pub const FORESTER_EPOCH_SEED: &[u8] = b"forester_epoch"; #[constant] pub const PROTOCOL_CONFIG_PDA_SEED: &[u8] = b"authority";
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/sdk.rs
#![cfg(not(target_os = "solana"))] use crate::{ protocol_config::state::ProtocolConfig, utils::{ get_cpi_authority_pda, get_epoch_pda_address, get_forester_epoch_pda_from_authority, get_forester_epoch_pda_from_derivation, get_forester_pda, get_protocol_config_pda_address, }, ForesterConf...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/lib.rs
#![allow(clippy::too_many_arguments)] use account_compression::utils::constants::CPI_AUTHORITY_PDA_SEED; use account_compression::{AddressMerkleTreeConfig, AddressQueueConfig}; use account_compression::{NullifierQueueConfig, StateMerkleTreeConfig}; use anchor_lang::prelude::*; pub mod account_compression_cpi; pub mod ...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/errors.rs
use anchor_lang::prelude::*; #[error_code] pub enum RegistryError { #[msg("InvalidForester")] InvalidForester, NotInReportWorkPhase, StakeAccountAlreadySynced, EpochEnded, ForesterNotEligible, NotInRegistrationPeriod, WeightInsuffient, ForesterAlreadyRegistered, InvalidEpochAcco...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/utils.rs
use anchor_lang::solana_program::pubkey::Pubkey; use crate::constants::{FORESTER_EPOCH_SEED, FORESTER_SEED, PROTOCOL_CONFIG_PDA_SEED}; pub fn get_protocol_config_pda_address() -> (Pubkey, u8) { Pubkey::find_program_address(&[PROTOCOL_CONFIG_PDA_SEED], &crate::ID) } pub fn get_cpi_authority_pda() -> (Pubkey, u8) ...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/protocol_config/initialize.rs
use crate::{ constants::PROTOCOL_CONFIG_PDA_SEED, program::LightRegistry, protocol_config::state::ProtocolConfigPda, }; use anchor_lang::prelude::*; #[derive(Accounts)] #[instruction(bump: u8)] pub struct InitializeProtocolConfig<'info> { #[account(mut)] pub fee_payer: Signer<'info>, pub authority:...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/protocol_config/update.rs
use anchor_lang::prelude::*; use crate::errors::RegistryError; use super::state::{ProtocolConfig, ProtocolConfigPda}; #[derive(Accounts)] pub struct UpdateProtocolConfig<'info> { pub fee_payer: Signer<'info>, pub authority: Signer<'info>, /// CHECK: authority is protocol config authority. #[account(m...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/protocol_config/mod.rs
pub mod initialize; pub mod state; pub mod update;
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/protocol_config/state.rs
use crate::errors::RegistryError; use aligned_sized::aligned_sized; use anchor_lang::prelude::*; #[aligned_sized(anchor)] #[derive(Debug)] #[account] pub struct ProtocolConfigPda { pub authority: Pubkey, pub bump: u8, pub config: ProtocolConfig, } /// Epoch Phases: /// 1. Registration /// 2. Active /// 3....
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/epoch/report_work.rs
use crate::errors::RegistryError; use super::register_epoch::{EpochPda, ForesterEpochPda}; use anchor_lang::prelude::*; /// Report work: /// - work is reported so that relative performance of foresters can be assessed /// 1. Check that we are in the report work phase /// 2. Check that forester has registered for the e...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/epoch/finalize_registration.rs
use anchor_lang::prelude::*; use crate::{EpochPda, ForesterEpochPda}; #[derive(Accounts)] pub struct FinalizeRegistration<'info> { pub authority: Signer<'info>, #[account(mut,has_one = authority)] pub forester_epoch_pda: Account<'info, ForesterEpochPda>, /// CHECK: instruction checks that the epoch is...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/epoch/mod.rs
pub mod finalize_registration; pub mod register_epoch; pub mod report_work;
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/epoch/register_epoch.rs
use crate::constants::FORESTER_EPOCH_SEED; use crate::errors::RegistryError; use crate::protocol_config::state::{ProtocolConfig, ProtocolConfigPda}; use crate::selection::forester::{ForesterConfig, ForesterPda}; use aligned_sized::aligned_sized; use anchor_lang::prelude::*; use anchor_lang::solana_program::pubkey::Pubk...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/account_compression_cpi/rollover_state_tree.rs
use account_compression::{ program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED, AddressMerkleTreeAccount, StateMerkleTreeAccount, }; use anchor_lang::prelude::*; use light_system_program::program::LightSystemProgram; use crate::{epoch::register_epoch::ForesterEpochPda, protocol_config::state:...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/account_compression_cpi/register_program.rs
use account_compression::{ program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED, GroupAuthority, }; use anchor_lang::prelude::*; use crate::protocol_config::state::ProtocolConfigPda; #[derive(Accounts)] pub struct RegisterProgram<'info> { /// CHECK: only the protocol authority can register ne...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/account_compression_cpi/initialize_tree_and_queue.rs
use account_compression::{ program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED, AddressMerkleTreeConfig, AddressQueueConfig, NullifierQueueConfig, StateMerkleTreeConfig, }; use anchor_lang::prelude::*; use light_system_program::program::LightSystemProgram; use crate::{ errors::RegistryErr...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/account_compression_cpi/nullify.rs
use account_compression::{ program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED, StateMerkleTreeAccount, }; use anchor_lang::prelude::*; use crate::epoch::register_epoch::ForesterEpochPda; #[derive(Accounts)] pub struct NullifyLeaves<'info> { /// CHECK: only eligible foresters can nullify lea...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/account_compression_cpi/sdk.rs
#![cfg(not(target_os = "solana"))] use crate::utils::{ get_cpi_authority_pda, get_forester_epoch_pda_from_authority, get_protocol_config_pda_address, }; use account_compression::utils::constants::NOOP_PUBKEY; use account_compression::{ AddressMerkleTreeConfig, AddressQueueConfig, NullifierQueueConfig, StateMerk...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/account_compression_cpi/mod.rs
pub mod initialize_tree_and_queue; pub mod nullify; pub mod register_program; pub mod rollover_state_tree; pub mod sdk; pub mod update_address_tree;
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/account_compression_cpi/update_address_tree.rs
use account_compression::{ program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED, AddressMerkleTreeAccount, }; use anchor_lang::prelude::*; use crate::epoch::register_epoch::ForesterEpochPda; #[derive(Accounts)] pub struct UpdateAddressMerkleTree<'info> { /// CHECK: only eligible foresters can...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/selection/forester.rs
use anchor_lang::prelude::*; use anchor_lang::solana_program::pubkey::Pubkey; use crate::constants::FORESTER_SEED; use crate::protocol_config::state::ProtocolConfigPda; use aligned_sized::aligned_sized; #[aligned_sized(anchor)] #[account] #[derive(Debug, Default, Copy, PartialEq, Eq)] pub struct ForesterPda { pub...
0
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src
solana_public_repos/Lightprotocol/light-protocol/programs/registry/src/selection/mod.rs
pub mod forester;
0
solana_public_repos/Lightprotocol/light-protocol/programs
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/Cargo.toml
[package] name = "light-compressed-token" version = "1.2.0" description = "Generalized token compression on Solana" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "light_compressed_token" [features] no-entrypoint = [] ...
0
solana_public_repos/Lightprotocol/light-protocol/programs
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/README.md
# Compressed Token Program A token program on the Solana blockchain using ZK Compression. This program provides an interface and implementation that third parties can utilize to create and use compressed tokens on Solana. Documentation is available at https://zkcompression.com Source code: https://github.com/Lightp...
0
solana_public_repos/Lightprotocol/light-protocol/programs
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/constants.rs
// 2 in little endian pub const TOKEN_COMPRESSED_ACCOUNT_DISCRIMINATOR: [u8; 8] = [2, 0, 0, 0, 0, 0, 0, 0]; pub const BUMP_CPI_AUTHORITY: u8 = 254; pub const NOT_FROZEN: bool = false;
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/token_data.rs
use std::vec; use anchor_lang::{ prelude::borsh, solana_program::pubkey::Pubkey, AnchorDeserialize, AnchorSerialize, }; use light_hasher::{errors::HasherError, DataHasher}; use light_utils::hash_to_bn254_field_size_be; #[derive(Clone, Copy, Debug, PartialEq, Eq, AnchorSerialize, AnchorDeserialize)] #[repr(u8)] pu...
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/lib.rs
use anchor_lang::prelude::*; pub mod constants; pub mod process_compress_spl_token_account; pub mod process_mint; pub mod process_transfer; use process_compress_spl_token_account::process_compress_spl_token_account; pub mod spl_compression; pub use process_mint::*; pub mod token_data; pub use token_data::TokenData; pu...
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/process_compress_spl_token_account.rs
use super::TransferInstruction; use crate::{ process_transfer::{ process_transfer, CompressedTokenInstructionDataTransfer, PackedTokenTransferOutputData, }, ErrorCode, }; use anchor_lang::prelude::*; use light_system_program::sdk::CompressedCpiContext; pub fn process_compress_spl_token_account<'inf...
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/process_mint.rs
use account_compression::{program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED}; use anchor_lang::prelude::*; use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; use light_system_program::{program::LightSystemProgram, OutputCompressedAccountWithPackedContext}; use crate::{program::L...
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/process_transfer.rs
use crate::{ constants::{BUMP_CPI_AUTHORITY, NOT_FROZEN, TOKEN_COMPRESSED_ACCOUNT_DISCRIMINATOR}, spl_compression::process_compression_or_decompression, token_data::{AccountState, TokenData}, ErrorCode, TransferInstruction, }; use account_compression::utils::constants::CPI_AUTHORITY_PDA_SEED; use anchor...
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/delegation.rs
use anchor_lang::prelude::*; use light_system_program::{ invoke::processor::CompressedProof, sdk::{compressed_account::PackedCompressedAccountWithMerkleContext, CompressedCpiContext}, OutputCompressedAccountWithPackedContext, }; use light_utils::hash_to_bn254_field_size_be; use crate::{ constants::NOT_...
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/spl_compression.rs
#![allow(deprecated)] use anchor_lang::{prelude::*, solana_program::account_info::AccountInfo}; use anchor_spl::token_interface; use crate::{ process_transfer::get_cpi_signer_seeds, CompressedTokenInstructionDataTransfer, TransferInstruction, POOL_SEED, }; pub fn process_compression_or_decompression( inpu...
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/burn.rs
use anchor_lang::prelude::*; use anchor_spl::token::TokenAccount; use light_system_program::{ invoke::processor::CompressedProof, sdk::{compressed_account::PackedCompressedAccountWithMerkleContext, CompressedCpiContext}, OutputCompressedAccountWithPackedContext, }; use light_utils::hash_to_bn254_field_size_...
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/freeze.rs
use anchor_lang::prelude::*; use light_hasher::DataHasher; use light_hasher::Poseidon; use light_system_program::{ invoke::processor::CompressedProof, sdk::{ compressed_account::{ CompressedAccount, CompressedAccountData, PackedCompressedAccountWithMerkleContext, }, Compresse...
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/instructions/generic.rs
use account_compression::{program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED}; use anchor_lang::prelude::*; use light_system_program::{ program::LightSystemProgram, sdk::accounts::{InvokeAccounts, SignerAccounts}, }; use crate::program::LightCompressedToken; #[derive(Accounts)] pub struct G...
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/instructions/mod.rs
pub mod burn; pub mod create_token_pool; pub mod freeze; pub mod generic; pub mod transfer; pub use burn::*; pub use create_token_pool::*; pub use freeze::*; pub use generic::*; pub use transfer::*;
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/instructions/create_token_pool.rs
use account_compression::utils::constants::CPI_AUTHORITY_PDA_SEED; use anchor_lang::prelude::*; use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; use spl_token_2022::{ extension::{BaseStateWithExtensions, ExtensionType, PodStateWithExtensions}, pod::PodMint, }; pub const POOL_SEED: &[u8] =...
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/instructions/burn.rs
use account_compression::{program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED}; use anchor_lang::prelude::*; use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; use light_system_program::{ program::LightSystemProgram, sdk::accounts::{InvokeAccounts, SignerAccounts}, }; use ...
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/instructions/freeze.rs
use account_compression::{program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED}; use anchor_lang::prelude::*; use anchor_spl::token_interface::Mint; use light_system_program::{ program::LightSystemProgram, sdk::accounts::{InvokeAccounts, SignerAccounts}, }; use crate::program::LightCompressedT...
0
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src
solana_public_repos/Lightprotocol/light-protocol/programs/compressed-token/src/instructions/transfer.rs
use account_compression::{program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED}; use anchor_lang::prelude::*; use anchor_spl::token_interface::{TokenAccount, TokenInterface}; use light_system_program::{ self, program::LightSystemProgram, sdk::accounts::{InvokeAccounts, SignerAccounts}, }; ...
0
solana_public_repos/Lightprotocol/light-protocol/programs
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/Cargo.toml
[package] name = "account-compression" version = "1.2.0" description = "Solana account compression program" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "account_compression" [features] no-entrypoint = [] no-idl = []...
0
solana_public_repos/Lightprotocol/light-protocol/programs
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/sdk.rs
#![cfg(not(target_os = "solana"))] use anchor_lang::{system_program, InstructionData, ToAccountMetas}; use solana_sdk::{ instruction::{AccountMeta, Instruction}, pubkey::Pubkey, }; use crate::{ instruction::{ InitializeAddressMerkleTreeAndQueue, InitializeStateMerkleTreeAndNullifierQueue, }, ...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/lib.rs
#![allow(clippy::too_many_arguments)] #![allow(unexpected_cfgs)] pub mod errors; pub mod instructions; pub use instructions::*; pub mod state; pub use state::*; pub mod processor; pub mod utils; pub use processor::*; pub mod sdk; use anchor_lang::prelude::*; declare_id!("compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq"); ...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/errors.rs
use anchor_lang::prelude::*; #[error_code] pub enum AccountCompressionErrorCode { #[msg("Integer overflow")] IntegerOverflow, #[msg("InvalidAuthority")] InvalidAuthority, #[msg( "Leaves <> remaining accounts mismatch. The number of remaining accounts must match the number of leaves." )]...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/instructions/nullify_leaves.rs
use crate::{ emit_indexer_event, errors::AccountCompressionErrorCode, state::{ queue::{queue_from_bytes_zero_copy_mut, QueueAccount}, StateMerkleTreeAccount, }, state_merkle_tree_from_bytes_zero_copy_mut, utils::check_signer_is_registered_or_authority::{ check_signer_is_r...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/instructions/register_program.rs
use aligned_sized::aligned_sized; use anchor_lang::prelude::*; use crate::{errors::AccountCompressionErrorCode, GroupAuthority}; #[derive(Debug)] #[account] #[aligned_sized(anchor)] pub struct RegisteredProgram { pub registered_program_id: Pubkey, pub group_authority_pda: Pubkey, } #[derive(Accounts)] pub st...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/instructions/insert_into_queues.rs
use crate::{ check_queue_type, errors::AccountCompressionErrorCode, state::queue::{queue_from_bytes_zero_copy_mut, QueueAccount}, state_merkle_tree_from_bytes_zero_copy, utils::{ check_signer_is_registered_or_authority::check_signer_is_registered_or_authority, queue::{QueueBundle, Qu...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/instructions/deregister_program.rs
use anchor_lang::prelude::*; use crate::{errors::AccountCompressionErrorCode, GroupAuthority, RegisteredProgram}; #[derive(Accounts)] pub struct DeregisterProgram<'info> { /// CHECK: Signer is checked according to authority pda in instruction. #[account(mut, constraint= authority.key() == group_authority_pda....
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/instructions/rollover_state_merkle_tree_and_queue.rs
use crate::{ processor::{ initialize_concurrent_merkle_tree::process_initialize_state_merkle_tree, initialize_nullifier_queue::process_initialize_nullifier_queue, }, state::{ queue::{queue_from_bytes_zero_copy_mut, QueueAccount}, StateMerkleTreeAccount, }, state_merkl...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/instructions/update_group_authority.rs
use crate::GroupAuthority; use anchor_lang::{prelude::*, solana_program::pubkey::Pubkey}; #[derive(Accounts)] pub struct UpdateGroupAuthority<'info> { pub authority: Signer<'info>, #[account( mut, constraint = group_authority.authority == *authority.key, )] pub group_authority: Account<'...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/instructions/rollover_address_merkle_tree_and_queue.rs
use crate::{ address_merkle_tree_from_bytes_zero_copy, initialize_address_merkle_tree::process_initialize_address_merkle_tree, initialize_address_queue::process_initialize_address_queue, state::{queue_from_bytes_zero_copy_mut, QueueAccount}, utils::{ check_account::check_account_balance_is_r...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/instructions/mod.rs
pub mod initialize_address_merkle_tree_and_queue; pub use initialize_address_merkle_tree_and_queue::*; pub mod update_address_merkle_tree; pub use update_address_merkle_tree::*; pub mod insert_into_queues; pub use insert_into_queues::*; pub mod initialize_state_merkle_tree_and_nullifier_queue; pub use initialize_sta...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/instructions/append_leaves.rs
use crate::{ errors::AccountCompressionErrorCode, state::StateMerkleTreeAccount, state_merkle_tree_from_bytes_zero_copy_mut, utils::{ check_signer_is_registered_or_authority::{ check_signer_is_registered_or_authority, GroupAccess, GroupAccounts, }, transfer_lamports::...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/instructions/update_address_merkle_tree.rs
use anchor_lang::prelude::*; use light_concurrent_merkle_tree::event::{IndexedMerkleTreeEvent, MerkleTreeEvent}; use light_indexed_merkle_tree::array::IndexedElement; use num_bigint::BigUint; use crate::{ address_merkle_tree_from_bytes_zero_copy_mut, emit_indexer_event, errors::AccountCompressionErrorCode, ...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/instructions/initialize_state_merkle_tree_and_nullifier_queue.rs
use crate::{ errors::AccountCompressionErrorCode, initialize_concurrent_merkle_tree::process_initialize_state_merkle_tree, initialize_nullifier_queue::process_initialize_nullifier_queue, state::{QueueAccount, StateMerkleTreeAccount}, utils::{ check_account::check_account_balance_is_rent_exem...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/instructions/initialize_group_authority.rs
use anchor_lang::{prelude::*, solana_program::pubkey::Pubkey}; use crate::{state::GroupAuthority, utils::constants::GROUP_AUTHORITY_SEED}; #[derive(Accounts)] pub struct InitializeGroupAuthority<'info> { #[account(mut)] pub authority: Signer<'info>, /// Seed public key used to derive the group authority. ...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/instructions/initialize_address_merkle_tree_and_queue.rs
use anchor_lang::prelude::*; use crate::{ errors::AccountCompressionErrorCode, initialize_address_merkle_tree::process_initialize_address_merkle_tree, initialize_address_queue::process_initialize_address_queue, state::QueueAccount, utils::{ check_account::check_account_balance_is_rent_exemp...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/processor/initialize_concurrent_merkle_tree.rs
use anchor_lang::prelude::*; use light_utils::fee::compute_rollover_fee; use crate::{ initialize_address_queue::check_rollover_fee_sufficient, state::StateMerkleTreeAccount, state_merkle_tree_from_bytes_zero_copy_init, AccessMetadata, RolloverMetadata, }; #[allow(unused_variables)] pub fn process_initialize_s...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/processor/initialize_nullifier_queue.rs
use crate::{ queue_from_bytes_zero_copy_init, AccessMetadata, QueueAccount, QueueType, RolloverMetadata, }; use anchor_lang::{prelude::*, solana_program::pubkey::Pubkey}; pub fn process_initialize_nullifier_queue<'a, 'b, 'c: 'info, 'info>( nullifier_queue_account_info: AccountInfo<'info>, nullifier_queue_a...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/processor/mod.rs
pub mod initialize_address_merkle_tree; pub mod initialize_address_queue; pub mod initialize_concurrent_merkle_tree; pub mod initialize_nullifier_queue;
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/processor/initialize_address_merkle_tree.rs
use crate::{ address_merkle_tree_from_bytes_zero_copy_init, state::AddressMerkleTreeAccount, AccessMetadata, RolloverMetadata, }; pub use anchor_lang::prelude::*; pub fn process_initialize_address_merkle_tree( address_merkle_tree_loader: &AccountLoader<'_, AddressMerkleTreeAccount>, index: u64, own...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/processor/initialize_address_queue.rs
use anchor_lang::prelude::*; use light_utils::fee::compute_rollover_fee; use crate::{ state::{queue_from_bytes_zero_copy_init, QueueAccount}, AccessMetadata, QueueType, RolloverMetadata, }; pub fn process_initialize_address_queue<'info>( queue_account_info: &AccountInfo<'info>, queue_loader: &AccountL...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/utils/check_account.rs
use crate::errors::AccountCompressionErrorCode; use anchor_lang::prelude::*; use anchor_lang::solana_program::{account_info::AccountInfo, msg, rent::Rent}; /// Checks that the account balance is equal to rent exemption. pub fn check_account_balance_is_rent_exempt( account_info: &AccountInfo, expected_size: usi...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/utils/check_signer_is_registered_or_authority.rs
use crate::{errors::AccountCompressionErrorCode, RegisteredProgram}; use anchor_lang::{prelude::*, solana_program::pubkey::Pubkey}; use super::constants::CPI_AUTHORITY_PDA_SEED; pub trait GroupAccess { fn get_owner(&self) -> &Pubkey; fn get_program_owner(&self) -> &Pubkey; } pub trait GroupAccounts<'info> { ...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/utils/constants.rs
// This file stores constants which do not have to be configured. use anchor_lang::constant; #[constant] pub const CPI_AUTHORITY_PDA_SEED: &[u8] = b"cpi_authority"; #[constant] pub const GROUP_AUTHORITY_SEED: &[u8] = b"group_authority"; #[constant] pub const STATE_MERKLE_TREE_HEIGHT: u64 = 26; #[constant] pub const ...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/utils/queue.rs
use std::collections::HashMap; use anchor_lang::prelude::{AccountInfo, Pubkey}; /// Mapping of address queue public keys to a bundle containing: /// /// * The queue. /// * Associated Merkle tree. /// * Addresses to insert. pub type QueueMap<'info> = HashMap<Pubkey, QueueBundle<'info>>; /// A bundle containing: /// /...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/utils/check_discrimininator.rs
use anchor_lang::{error::ErrorCode, Owner, Result, ZeroCopy}; pub fn check_discriminator<T: ZeroCopy + Owner + std::fmt::Debug>(data: &[u8]) -> Result<()> { let disc_bytes: [u8; 8] = data[0..8].try_into().unwrap(); if disc_bytes != T::discriminator() { return Err(ErrorCode::AccountDiscriminatorMismatch...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/utils/mod.rs
pub mod check_account; pub mod check_discrimininator; pub mod check_signer_is_registered_or_authority; pub mod constants; pub mod queue; pub mod transfer_lamports;
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/utils/transfer_lamports.rs
use crate::errors::AccountCompressionErrorCode; use anchor_lang::prelude::*; pub fn transfer_lamports<'info>( from: &AccountInfo<'info>, to: &AccountInfo<'info>, lamports: u64, ) -> Result<()> { let compressed_sol_pda_lamports = from.lamports(); **from.as_ref().try_borrow_mut_lamports()? = ...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/state/access.rs
use anchor_lang::prelude::*; #[account(zero_copy)] #[derive(AnchorDeserialize, Debug, PartialEq, Default)] pub struct AccessMetadata { /// Owner of the Merkle tree. pub owner: Pubkey, /// Program owner of the Merkle tree. This will be used for program owned Merkle trees. pub program_owner: Pubkey, ...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/state/group_authority.rs
use aligned_sized::aligned_sized; use anchor_lang::{prelude::*, solana_program::pubkey::Pubkey}; #[account] #[aligned_sized(anchor)] #[derive(Debug)] pub struct GroupAuthority { pub authority: Pubkey, pub seed: Pubkey, }
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/state/address.rs
use std::mem; use crate::{ utils::check_signer_is_registered_or_authority::GroupAccess, AccessMetadata, MerkleTreeMetadata, RolloverMetadata, }; use aligned_sized::aligned_sized; use anchor_lang::prelude::*; use light_hasher::Poseidon; use light_indexed_merkle_tree::{ zero_copy::{IndexedMerkleTreeZeroCopy,...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/state/queue.rs
use crate::InsertIntoQueues; use crate::{errors::AccountCompressionErrorCode, AccessMetadata, RolloverMetadata}; use crate::{ utils::check_signer_is_registered_or_authority::{GroupAccess, GroupAccounts}, RegisteredProgram, }; use aligned_sized::aligned_sized; use anchor_lang::prelude::*; use light_hash_set::{ze...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/state/rollover.rs
use anchor_lang::prelude::*; #[account(zero_copy)] #[derive(AnchorDeserialize, Debug, PartialEq, Default)] pub struct RolloverMetadata { /// Unique index. pub index: u64, /// This fee is used for rent for the next account. /// It accumulates in the account so that once the corresponding Merkle tree acc...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/state/public_state_merkle_tree.rs
use std::mem; use aligned_sized::aligned_sized; use anchor_lang::prelude::*; use light_concurrent_merkle_tree::{ zero_copy::{ConcurrentMerkleTreeZeroCopy, ConcurrentMerkleTreeZeroCopyMut}, ConcurrentMerkleTree, }; use light_hasher::Poseidon; use crate::{AccessMetadata, MerkleTreeMetadata, RolloverMetadata}; ...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/state/change_log_event.rs
use anchor_lang::{ prelude::*, solana_program::{instruction::Instruction, program::invoke}, }; use crate::{errors::AccountCompressionErrorCode, utils::constants::NOOP_PUBKEY}; #[inline(never)] pub fn emit_indexer_event(data: Vec<u8>, noop_program: &AccountInfo) -> Result<()> { if noop_program.key() != Pub...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/state/mod.rs
pub mod access; pub use access::*; pub mod address; pub use address::*; pub mod merkle_tree; pub use merkle_tree::*; pub mod public_state_merkle_tree; pub use public_state_merkle_tree::*; pub mod change_log_event; pub use change_log_event::*; pub mod queue; pub use queue::*; pub mod rollover; pub use rollover::*;...
0
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src
solana_public_repos/Lightprotocol/light-protocol/programs/account-compression/src/state/merkle_tree.rs
use anchor_lang::prelude::*; use crate::{errors::AccountCompressionErrorCode, AccessMetadata, RolloverMetadata}; #[account(zero_copy)] #[derive(AnchorDeserialize, Debug, PartialEq, Default)] pub struct MerkleTreeMetadata { pub access_metadata: AccessMetadata, pub rollover_metadata: RolloverMetadata, // Qu...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test/Cargo.toml
[package] name = "system-cpi-test" version = "1.1.0" description = "Test program using generalized account compression" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "system_cpi_test" [features] no-entrypoint = [] no-...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test/tests/test.rs
#![cfg(feature = "test-sbf")] use anchor_lang::AnchorDeserialize; use light_compressed_token::process_transfer::InputTokenDataWithContext; use light_compressed_token::token_data::AccountState; use light_hasher::{Hasher, Poseidon}; use light_program_test::test_env::{setup_test_programs_with_accounts, EnvAccounts}; use ...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test/tests/test_program_owned_trees.rs
#![cfg(feature = "test-sbf")] use account_compression::sdk::create_insert_leaves_instruction; use account_compression::utils::constants::{CPI_AUTHORITY_PDA_SEED, STATE_NULLIFIER_QUEUE_VALUES}; use account_compression::{ AddressMerkleTreeConfig, AddressQueueConfig, NullifierQueueConfig, QueueAccount, StateMerkl...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test/src/invalidate_not_owned_account.rs
use account_compression::{program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED}; use anchor_lang::prelude::*; use light_compressed_token::{ delegation::{CompressedTokenInstructionDataApprove, CompressedTokenInstructionDataRevoke}, freeze::{CompressedTokenInstructionDataFreeze, CompressedTokenIn...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test/src/sdk.rs
#![cfg(not(target_os = "solana"))] use std::collections::HashMap; use account_compression::{ utils::constants::CPI_AUTHORITY_PDA_SEED, AddressMerkleTreeConfig, AddressQueueConfig, NullifierQueueConfig, StateMerkleTreeConfig, }; use anchor_lang::{InstructionData, ToAccountMetas}; use light_compressed_token::{ ...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test/src/lib.rs
#![allow(clippy::too_many_arguments)] use account_compression::program::AccountCompression; use account_compression::utils::constants::CPI_AUTHORITY_PDA_SEED; use anchor_lang::prelude::*; use anchor_lang::solana_program::pubkey::Pubkey; use light_system_program::invoke::processor::CompressedProof; pub mod create_pda; p...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-cpi-test/src/create_pda.rs
use account_compression::{program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED}; use anchor_lang::prelude::*; use light_hasher::{errors::HasherError, DataHasher, Poseidon}; use light_system_program::{ invoke::processor::CompressedProof, program::LightSystemProgram, sdk::{ address::d...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-test/Cargo.toml
[package] name = "system-test" version = "1.1.0" description = "Created with Anchor" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "system_test" [features] no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] test-sbf = [] custom-heap = [] default = ["custom-heap"] [dependencies]...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-test/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-test/tests/test.rs
#![cfg(feature = "test-sbf")] use account_compression::errors::AccountCompressionErrorCode; use anchor_lang::error::ErrorCode; use anchor_lang::{AnchorSerialize, InstructionData, ToAccountMetas}; use light_hasher::Poseidon; use light_program_test::test_env::{ initialize_accounts, setup_test_programs, setup_test_pro...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/system-test/src/lib.rs
// placeholder
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/account-compression-test/Cargo.toml
[package] name = "account-compression-test" version = "1.1.0" description = "Created with Anchor" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "account_compression_test" [features] no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] test-sbf = [] custom-heap = [] default = ["cus...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/account-compression-test/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0