repo_id
stringclasses
563 values
file_path
stringlengths
40
166
content
stringlengths
1
2.94M
__index_level_0__
int64
0
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
solana_public_repos/Lightprotocol/light-protocol/test-programs/account-compression-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/account-compression-test/tests/group_authority_tests.rs
#![cfg(feature = "test-sbf")] use account_compression::errors::AccountCompressionErrorCode; use account_compression::{ self, utils::constants::GROUP_AUTHORITY_SEED, GroupAuthority, RegisteredProgram, ID, }; use anchor_lang::{system_program, InstructionData, ToAccountMetas}; use light_program_test::test_env::{get_g...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/account-compression-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/account-compression-test/tests/merkle_tree_tests.rs
#![cfg(feature = "test-sbf")] use std::{collections::HashMap, mem}; use account_compression::{ self, errors::AccountCompressionErrorCode, queue_from_bytes_copy, sdk::{create_initialize_merkle_tree_instruction, create_insert_leaves_instruction}, state::{queue_from_bytes_zero_copy_mut, QueueAccount},...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/account-compression-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/account-compression-test/tests/address_merkle_tree_tests.rs
#![cfg(feature = "test-sbf")] use std::mem; use account_compression::{ errors::AccountCompressionErrorCode, state::QueueAccount, utils::constants::{ADDRESS_MERKLE_TREE_CANOPY_DEPTH, ADDRESS_MERKLE_TREE_HEIGHT}, AddressMerkleTreeAccount, AddressMerkleTreeConfig, AddressQueueConfig, ID, SAFETY_MARGIN, }...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/account-compression-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/account-compression-test/src/lib.rs
// placeholder
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/registry-test/Cargo.toml
[package] name = "registry-test" version = "1.1.0" description = "Created with Anchor" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "registry_test" [features] no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] test-sbf = [] custom-heap = [] default = ["custom-heap"] [dependenc...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/registry-test/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/registry-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/registry-test/tests/tests.rs
#![cfg(feature = "test-sbf")] use account_compression::{ AddressMerkleTreeConfig, AddressQueueConfig, NullifierQueueConfig, StateMerkleTreeConfig, }; use anchor_lang::{InstructionData, ToAccountMetas}; use forester_utils::forester_epoch::get_epoch_phases; use light_program_test::test_env::{ create_address_merk...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/registry-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/registry-test/src/lib.rs
// placeholder
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/e2e-test/Cargo.toml
[package] name = "e2e-test" version = "1.1.0" description = "Created with Anchor" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "e2e_test" [features] no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] test-sbf = [] custom-heap = [] default = ["custom-heap"] [dependencies] ancho...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/e2e-test/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/e2e-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/e2e-test/tests/test.rs
#![cfg(feature = "test-sbf")] use light_program_test::test_env::setup_test_programs_with_accounts_with_protocol_config; use light_program_test::test_rpc::ProgramTestRpcConnection; use light_registry::protocol_config::state::ProtocolConfig; use light_test_utils::e2e_test_env::{E2ETestEnv, GeneralActionConfig, KeypairAc...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/e2e-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/e2e-test/src/lib.rs
// placeholder
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/sdk-test-program/.prettierignore
.anchor .DS_Store target node_modules dist build test-ledger
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/sdk-test-program/Anchor.toml
[toolchain] [features] seeds = false skip-lint = false [programs.localnet] sdk_test = "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt" [registry] url = "https://api.apr.dev" [provider] cluster = "Localnet" wallet = "~/.config/solana/id.json" [scripts] test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/sdk-test-program/package.json
{ "scripts": { "lint:fix": "prettier \"*/**/*{.js,.ts}\" -w", "lint": "prettier \"*/**/*{.js,.ts}\" --check", "test": "cargo test-sbf -p sdk-test -- --test-threads 1" }, "dependencies": { "@coral-xyz/anchor": "^0.29.0" }, "devDependencies": { "@lightprotocol/zk-compression-cli": "workspac...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/sdk-test-program/tsconfig.json
{ "compilerOptions": { "types": ["mocha", "chai"], "typeRoots": ["./node_modules/@types"], "lib": ["es2015"], "module": "commonjs", "target": "es6", "esModuleInterop": true } }
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/sdk-test-program/programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/sdk-test-program/programs/sdk-test/Cargo.toml
[package] name = "sdk-test" version = "0.7.0" description = "Test program for Light SDK and Light Macros" edition = "2021" rust-version = "1.75.0" license = "Apache-2.0" [lib] crate-type = ["cdylib", "lib"] name = "sdk_test" [features] no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] defaul...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/sdk-test-program/programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/sdk-test-program/programs/sdk-test/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/sdk-test-program/programs/sdk-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/sdk-test-program/programs/sdk-test/tests/test.rs
#![cfg(feature = "test-sbf")] use anchor_lang::{AnchorDeserialize, InstructionData, ToAccountMetas}; use light_client::indexer::{AddressMerkleTreeAccounts, Indexer, StateMerkleTreeAccounts}; use light_client::rpc::merkle_tree::MerkleTreeExt; use light_program_test::test_env::{setup_test_programs_with_accounts_v2, EnvA...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/sdk-test-program/programs/sdk-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/sdk-test-program/programs/sdk-test/src/lib.rs
use anchor_lang::prelude::*; use light_hasher::Discriminator; use light_sdk::{ account::LightAccount, address::derive_address, error::LightSdkError, instruction_data::LightInstructionData, light_account, light_system_accounts, program_merkle_context::unpack_address_merkle_context, verify::verify_light_accou...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/compressed-token-test/Cargo.toml
[package] name = "compressed-token-test" version = "1.1.0" description = "Created with Anchor" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "compressed_token_test" [features] no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] test-sbf = [] custom-heap = [] default = ["custom-he...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs
solana_public_repos/Lightprotocol/light-protocol/test-programs/compressed-token-test/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/compressed-token-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/compressed-token-test/tests/test.rs
#![cfg(feature = "test-sbf")] use anchor_lang::{ system_program, AnchorDeserialize, AnchorSerialize, InstructionData, ToAccountMetas, }; use anchor_spl::token::{Mint, TokenAccount}; use anchor_spl::token_2022::spl_token_2022; use anchor_spl::token_2022::spl_token_2022::extension::ExtensionType; use light_compresse...
0
solana_public_repos/Lightprotocol/light-protocol/test-programs/compressed-token-test
solana_public_repos/Lightprotocol/light-protocol/test-programs/compressed-token-test/src/lib.rs
// placeholder
0
solana_public_repos/Lightprotocol/light-protocol
solana_public_repos/Lightprotocol/light-protocol/heap/Cargo.toml
[package] name = "light-heap" version = "1.1.0" description = "Custom heap allocator used in Light Protocol" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" [dependencies] anchor-lang = { workspace = true }
0
solana_public_repos/Lightprotocol/light-protocol/heap
solana_public_repos/Lightprotocol/light-protocol/heap/src/lib.rs
use std::{alloc::Layout, mem::size_of, ptr::null_mut}; pub mod bench; #[cfg(target_os = "solana")] use anchor_lang::{ prelude::*, solana_program::entrypoint::{HEAP_LENGTH, HEAP_START_ADDRESS}, }; #[cfg(target_os = "solana")] #[global_allocator] pub static GLOBAL_ALLOCATOR: BumpAllocator = BumpAllocator { ...
0
solana_public_repos/Lightprotocol/light-protocol/heap
solana_public_repos/Lightprotocol/light-protocol/heap/src/bench.rs
#[macro_export] macro_rules! bench_sbf_start { ($custom_msg:literal) => { // Conditionally compile only if on Solana OS and feature "bench-sbf" is enabled #[cfg(all(target_os = "solana", feature = "bench-sbf"))] { // Log the total heap with a custom message indicating the start ...
0
solana_public_repos/Lightprotocol/light-protocol
solana_public_repos/Lightprotocol/light-protocol/light-program-test/Cargo.toml
[package] name = "light-program-test" version = "0.1.0" edition = "2021" [features] default = [] devenv = [] [dependencies] light-client = { workspace = true } light-prover-client = { workspace = true } light-sdk = { workspace = true } light-indexed-merkle-tree = { workspace = true } light-merkle-tree-reference = { w...
0
solana_public_repos/Lightprotocol/light-protocol/light-program-test
solana_public_repos/Lightprotocol/light-protocol/light-program-test/src/test_env.rs
use crate::env_accounts; use crate::test_rpc::ProgramTestRpcConnection; use account_compression::sdk::create_initialize_address_merkle_tree_and_queue_instruction; use account_compression::utils::constants::GROUP_AUTHORITY_SEED; use account_compression::{ sdk::create_initialize_merkle_tree_instruction, GroupAuthorit...
0
solana_public_repos/Lightprotocol/light-protocol/light-program-test
solana_public_repos/Lightprotocol/light-protocol/light-program-test/src/lib.rs
pub mod env_accounts; pub mod test_env; pub mod test_indexer; pub mod test_rpc;
0
solana_public_repos/Lightprotocol/light-protocol/light-program-test
solana_public_repos/Lightprotocol/light-protocol/light-program-test/src/env_accounts.rs
// This file is generated by getAccountState.sh. Do not edit it manually. use solana_sdk::account::Account; use solana_sdk::pubkey::Pubkey; use std::str::FromStr; pub fn get_registered_program_pda() -> Account { Account { lamports: 1392000u64, data: vec![ 31u8, 251u8, 180u8, 235u8, 3u8,...
0
solana_public_repos/Lightprotocol/light-protocol/light-program-test
solana_public_repos/Lightprotocol/light-protocol/light-program-test/src/test_rpc.rs
use std::fmt::{Debug, Formatter}; use async_trait::async_trait; use borsh::BorshDeserialize; use solana_banks_client::BanksClientError; use solana_program_test::ProgramTestContext; use solana_sdk::{ account::{Account, AccountSharedData}, clock::Slot, commitment_config::CommitmentConfig, epoch_info::Epo...
0
solana_public_repos/Lightprotocol/light-protocol/light-program-test
solana_public_repos/Lightprotocol/light-protocol/light-program-test/src/test_indexer.rs
use borsh::BorshDeserialize; use light_client::{ indexer::{ AddressMerkleTreeAccounts, AddressMerkleTreeBundle, Indexer, StateMerkleTreeAccounts, StateMerkleTreeBundle, }, rpc::{merkle_tree::MerkleTreeExt, RpcConnection}, transaction_params::FeeConfig, }; use light_hasher::Poseidon; use ...
0
solana_public_repos/Lightprotocol/light-protocol
solana_public_repos/Lightprotocol/light-protocol/sdk/Cargo.toml
[package] name = "light-sdk" version = "0.11.0" description = "Rust SDK for ZK Compression on Solana" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" edition = "2021" [lib] crate-type = ["cdylib", "lib"] name = "light_sdk" [features] no-entrypoint = [] no-idl = [] no-log-ix-name ...
0
solana_public_repos/Lightprotocol/light-protocol
solana_public_repos/Lightprotocol/light-protocol/sdk/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/account_meta.rs
//! Types used use anchor_lang::{AnchorDeserialize, AnchorSerialize}; use solana_program::pubkey::Pubkey; use crate::{ compressed_account::CompressedAccountWithMerkleContext, error::LightSdkError, merkle_context::{ pack_address_merkle_context, pack_merkle_context, AddressMerkleContext, Pac...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/account_info.rs
use std::{cell::RefCell, rc::Rc}; use anchor_lang::prelude::Result; use solana_program::pubkey::Pubkey; use crate::{ account_meta::LightAccountMeta, address::PackedNewAddressParams, compressed_account::{ CompressedAccount, CompressedAccountData, OutputCompressedAccountWithPackedContext, Pa...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/constants.rs
use light_macros::pubkey; use solana_program::pubkey::Pubkey; /// Seed of the CPI authority. pub const CPI_AUTHORITY_PDA_SEED: &[u8] = b"cpi_authority"; /// ID of the account-compression program. pub const PROGRAM_ID_ACCOUNT_COMPRESSION: Pubkey = pubkey!("compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq"); pub const P...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/legacy.rs
#![cfg(feature = "legacy")] //! Legacy types re-imported from programs which should be removed as soon as //! possible. pub use light_system_program::{ invoke::processor::CompressedProof, sdk::{ compressed_account::{ CompressedAccount, CompressedAccountData, CompressedAccountWithMerkleCont...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/error.rs
use anchor_lang::prelude::error_code; #[error_code] pub enum LightSdkError { #[msg("Constraint violation")] ConstraintViolation, #[msg("Invalid light-system-program ID")] InvalidLightSystemProgram, #[msg("Expected accounts in the instruction")] ExpectedAccounts, #[msg("Expected address Merk...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/token.rs
use anchor_lang::{AnchorDeserialize, AnchorSerialize}; use solana_program::pubkey::Pubkey; use crate::compressed_account::CompressedAccountWithMerkleContext; #[derive(Clone, Copy, Debug, PartialEq, Eq, AnchorDeserialize, AnchorSerialize)] #[repr(u8)] pub enum AccountState { Initialized, Frozen, } #[derive(De...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/lib.rs
pub use light_macros::*; pub use light_sdk_macros::*; pub mod account; pub mod account_info; pub mod account_meta; pub mod address; pub mod compressed_account; pub mod constants; pub use constants::*; pub mod context; pub mod error; pub mod event; pub mod instruction_data; pub mod legacy; pub mod merkle_context; pub m...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/merkle_context.rs
use std::collections::HashMap; use anchor_lang::prelude::{AccountMeta, AnchorDeserialize, AnchorSerialize, Pubkey}; /// Collection of remaining accounts which are sent to the program. #[derive(Default)] pub struct RemainingAccounts { next_index: u8, map: HashMap<Pubkey, u8>, } impl RemainingAccounts { //...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/address.rs
use anchor_lang::{solana_program::pubkey::Pubkey, AnchorDeserialize, AnchorSerialize}; use light_utils::{hash_to_bn254_field_size_be, hashv_to_bn254_field_size_be}; use solana_program::account_info::AccountInfo; use crate::merkle_context::{AddressMerkleContext, RemainingAccounts}; #[derive(Debug, PartialEq, Default, ...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/instruction_data.rs
use std::io::{self, Cursor}; use borsh::{BorshDeserialize, BorshSerialize}; use crate::{account_meta::LightAccountMeta, proof::ProofRpcResult}; pub struct LightInstructionData { pub proof: Option<ProofRpcResult>, pub accounts: Option<Vec<LightAccountMeta>>, } impl LightInstructionData { pub fn deseriali...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/event.rs
use anchor_lang::{AnchorDeserialize, AnchorSerialize}; use solana_program::pubkey::Pubkey; use crate::compressed_account::OutputCompressedAccountWithPackedContext; #[derive(Debug, Clone, AnchorDeserialize, AnchorSerialize, Default, PartialEq)] pub struct MerkleTreeSequenceNumber { pub pubkey: Pubkey, pub seq:...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/program_merkle_context.rs
use anchor_lang::{prelude::AccountInfo, Key}; use crate::merkle_context::{AddressMerkleContext, PackedAddressMerkleContext}; pub fn pack_address_merkle_contexts( address_merkle_contexts: &[AddressMerkleContext], remaining_accounts: &[AccountInfo], ) -> Vec<PackedAddressMerkleContext> { address_merkle_cont...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/account.rs
use std::ops::{Deref, DerefMut}; use anchor_lang::prelude::{AnchorDeserialize, AnchorSerialize, Result}; use light_hasher::{DataHasher, Discriminator, Poseidon}; use solana_program::{program_error::ProgramError, pubkey::Pubkey}; use crate::{ account_info::LightAccountInfo, account_meta::LightAccountMeta, ...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/state.rs
use anchor_lang::{AnchorDeserialize, AnchorSerialize}; use solana_program::pubkey::Pubkey; #[derive(AnchorDeserialize, AnchorSerialize, Debug, PartialEq, Default)] pub struct MerkleTreeMetadata { pub access_metadata: AccessMetadata, pub rollover_metadata: RolloverMetadata, // Queue associated with this Mer...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/verify.rs
use anchor_lang::{prelude::*, Bumps}; use light_hasher::{DataHasher, Discriminator}; use solana_program::{instruction::Instruction, program::invoke_signed}; use crate::{ account::LightAccount, address::PackedNewAddressParams, compressed_account::{ OutputCompressedAccountWithPackedContext, PackedCom...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/compressed_account.rs
use anchor_lang::prelude::{AnchorDeserialize, AnchorSerialize, ProgramError, Pubkey, Result}; use light_hasher::{DataHasher, Discriminator, Hasher, Poseidon}; use light_utils::hash_to_bn254_field_size_be; use crate::merkle_context::{ pack_merkle_context, MerkleContext, PackedMerkleContext, RemainingAccounts, }; #...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/traits.rs
// Ported from light-system-program, adjusted for caller programs. use anchor_lang::prelude::*; pub trait InvokeAccounts<'info> { fn get_registered_program_pda(&self) -> &AccountInfo<'info>; fn get_noop_program(&self) -> &AccountInfo<'info>; fn get_account_compression_authority(&self) -> &AccountInfo<'info...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/proof.rs
use anchor_lang::{AnchorDeserialize, AnchorSerialize}; use light_indexed_merkle_tree::array::IndexedElement; use num_bigint::BigUint; use solana_program::pubkey::Pubkey; #[derive(Debug, Clone)] pub struct MerkleProof { pub hash: [u8; 32], pub leaf_index: u64, pub merkle_tree: Pubkey, pub proof: Vec<[u8...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/transfer.rs
use anchor_lang::Result; use crate::{account_info::LightAccountInfo, error::LightSdkError}; /// Transfers a specified amount of lamports from one account to another. /// /// Attempts to transfer `lamports` from the `from` account to the `to` /// account. It will update the lamport balances of both accounts if the ///...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/utils.rs
use anchor_lang::solana_program::pubkey::Pubkey; use crate::{ address::PackedNewAddressParams, compressed_account::{ OutputCompressedAccountWithPackedContext, PackedCompressedAccountWithMerkleContext, }, proof::CompressedProof, verify::{CompressedCpiContext, InstructionDataInvokeCpi}, P...
0
solana_public_repos/Lightprotocol/light-protocol/sdk
solana_public_repos/Lightprotocol/light-protocol/sdk/src/context.rs
use std::ops::{Deref, DerefMut}; use anchor_lang::{context::Context, Bumps, Result}; use crate::{ account::LightAccounts, account_info::LightAccountInfo, traits::{ InvokeAccounts, InvokeCpiAccounts, InvokeCpiContextAccount, LightSystemAccount, SignerAccounts, }, }; /// Provides non-ar...
0
solana_public_repos/Lightprotocol/light-protocol/examples
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/.prettierignore
.anchor .DS_Store target node_modules dist build test-ledger
0
solana_public_repos/Lightprotocol/light-protocol/examples
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/Anchor.toml
[toolchain] [features] seeds = false skip-lint = false [programs.localnet] name_service = "7yucc7fL3JGbyMwg4neUaenNSdySS39hbAk89Ao3t1Hz" [registry] url = "https://api.apr.dev" [provider] cluster = "Localnet" wallet = "~/.config/solana/id.json" [scripts] test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests...
0
solana_public_repos/Lightprotocol/light-protocol/examples
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/package.json
{ "scripts": { "lint:fix": "prettier \"*/**/*{.js,.ts}\" -w", "lint": "prettier \"*/**/*{.js,.ts}\" --check", "test": "cargo test-sbf -p name-service -- --test-threads 1" }, "dependencies": { "@coral-xyz/anchor": "^0.29.0" }, "devDependencies": { "@lightprotocol/zk-compression-cli": "work...
0
solana_public_repos/Lightprotocol/light-protocol/examples
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/tsconfig.json
{ "compilerOptions": { "types": ["mocha", "chai"], "typeRoots": ["./node_modules/@types"], "lib": ["es2015"], "module": "commonjs", "target": "es6", "esModuleInterop": true } }
0
solana_public_repos/Lightprotocol/light-protocol/examples/name-service
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/migrations/deploy.ts
// Migrations are an early feature. Currently, they're nothing more than this // single deploy script that's invoked from the CLI, injecting a provider // configured from the workspace's Anchor.toml. const anchor = require("@coral-xyz/anchor"); module.exports = async function (provider) { // Configure client to use...
0
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs/name-service-without-macros/Cargo.toml
[package] name = "name-service-without-macros" version = "0.7.0" description = "Created with Anchor" edition = "2021" rust-version = "1.75.0" license = "Apache-2.0" [lib] crate-type = ["cdylib", "lib"] name = "name_service_without_macros" [features] no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entry...
0
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs/name-service-without-macros/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs/name-service-without-macros
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs/name-service-without-macros/tests/test.rs
#![cfg(feature = "test-sbf")] use std::net::{Ipv4Addr, Ipv6Addr}; use anchor_lang::{AnchorDeserialize, InstructionData, ToAccountMetas}; use light_client::indexer::{AddressMerkleTreeAccounts, Indexer, StateMerkleTreeAccounts}; use light_client::rpc::merkle_tree::MerkleTreeExt; use light_program_test::test_env::{setup...
0
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs/name-service-without-macros
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs/name-service-without-macros/src/lib.rs
use std::net::{Ipv4Addr, Ipv6Addr}; use anchor_lang::prelude::*; use borsh::{BorshDeserialize, BorshSerialize}; use light_hasher::bytes::AsByteVec; use light_sdk::{ account::LightAccount, instruction_data::LightInstructionData, light_system_accounts, verify::verify_light_accounts, LightDiscriminator, LightHash...
0
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs/name-service/Cargo.toml
[package] name = "name-service" version = "0.7.0" description = "Created with Anchor" edition = "2021" rust-version = "1.75.0" license = "Apache-2.0" [lib] crate-type = ["cdylib", "lib"] name = "name_service" [features] no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] default = ["idl-build"...
0
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs/name-service/Xargo.toml
[target.bpfel-unknown-unknown.dependencies.std] features = []
0
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs/name-service
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs/name-service/tests/test.rs
#![cfg(feature = "test-sbf")] use std::net::{Ipv4Addr, Ipv6Addr}; use anchor_lang::{AnchorDeserialize, InstructionData, ToAccountMetas}; use light_client::indexer::{AddressMerkleTreeAccounts, Indexer, StateMerkleTreeAccounts}; use light_client::rpc::merkle_tree::MerkleTreeExt; use light_program_test::test_env::{setup...
0
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs/name-service
solana_public_repos/Lightprotocol/light-protocol/examples/name-service/programs/name-service/src/lib.rs
use std::net::{Ipv4Addr, Ipv6Addr}; use anchor_lang::prelude::*; use borsh::{BorshDeserialize, BorshSerialize}; use light_hasher::bytes::AsByteVec; use light_sdk::{ account::LightAccount, light_account, light_accounts, light_program, merkle_context::PackedAddressMerkleContext, }; declare_id!("7yucc7fL3JGbyMwg...
0
solana_public_repos/Lightprotocol/light-protocol/examples/browser
solana_public_repos/Lightprotocol/light-protocol/examples/browser/nextjs/next.config.mjs
/** @type {import('next').NextConfig} */ const nextConfig = { webpack: (config, { isServer }) => { // Fix for Node.js modules in Webpack 5+ if (!isServer) { config.resolve.fallback = { ...config.resolve.fallback, fs: false, path: false, ...
0
solana_public_repos/Lightprotocol/light-protocol/examples/browser
solana_public_repos/Lightprotocol/light-protocol/examples/browser/nextjs/package.json
{ "name": "nextjs", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev -p 1234", "build": "next build", "build:browser": "next build", "start": "next start -p 1234", "test-validator": "./../../../cli/test_bin/run test-validator", "lint": "n...
0
solana_public_repos/Lightprotocol/light-protocol/examples/browser
solana_public_repos/Lightprotocol/light-protocol/examples/browser/nextjs/.prettierrc
{ "semi": true, "trailingComma": "all", "singleQuote": true, "printWidth": 80, "useTabs": false, "tabWidth": 4, "bracketSpacing": true, "arrowParens": "avoid" }
0
solana_public_repos/Lightprotocol/light-protocol/examples/browser
solana_public_repos/Lightprotocol/light-protocol/examples/browser/nextjs/tsconfig.json
{ "compilerOptions": { "lib": [ "dom", "dom.iterable", "esnext" ], "allowJs": true, "skipLibCheck": true, "strict": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModule...
0