Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/.ghaignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
# uses generated client from shank, can't rewrite to solana-bankrun
tools/shank-and-solita/native

# not building
compression/cutils/anchor
compression/cnft-vault/anchor



# build failed - program outdated
tokens/token-extensions/metadata/anchor

# dependency issues
tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor
tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor
6 changes: 3 additions & 3 deletions compression/cnft-vault/anchor/Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ solana_version = "3.1.8"
resolution = true
skip-lint = false

[programs.devnet]
[programs.localnet]
cnft_vault = "Fd4iwpPWaCU8BNwGQGtvvrcvG4Tfizq3RgLm8YLBJX6D"

# [registry] section removed — no longer used in Anchor 1.0

[provider]
cluster = "devnet"
cluster = "localnet"
wallet = "~/.config/solana/id.json"

[scripts]
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
test = "cargo test"
13 changes: 12 additions & 1 deletion compression/cnft-vault/anchor/programs/cnft-vault/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,18 @@ anchor-lang = "1.0.0"
# which is incompatible with Anchor 1.0's solana 3.x types. CPI calls are built manually
# using raw invoke_signed() with hardcoded program IDs and discriminators.
borsh = "1"
ahash = "=0.8.7"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }

[dev-dependencies]
litesvm = "0.11.0"
solana-instruction = "3.0.0"
solana-keypair = "3.0.1"
solana-pubkey = "3.0.0"
solana-transaction = "3.0.0"
solana-account = "3.0.0"
solana-native-token = "3.0.0"
solana-signer = "3.0.0"
solana-message = "3.0.0"
solana-keccak-hasher = "3.0.0"
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use anchor_lang::prelude::*;
use anchor_lang::solana_program::{
instruction::AccountMeta,
program::invoke_signed,
};
use anchor_lang::solana_program::{instruction::AccountMeta, program::invoke_signed};

use crate::{build_transfer_instruction, TransferArgs, SPLCompression, MPL_BUBBLEGUM_ID};
use crate::{build_transfer_instruction, SPLCompression, TransferArgs, MPL_BUBBLEGUM_ID};

#[derive(Accounts)]
pub struct Withdraw<'info> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use anchor_lang::prelude::*;
use anchor_lang::solana_program::{
instruction::AccountMeta,
program::invoke_signed,
};
use anchor_lang::solana_program::{instruction::AccountMeta, program::invoke_signed};

use crate::{build_transfer_instruction, TransferArgs, SPLCompression, MPL_BUBBLEGUM_ID};
use crate::{build_transfer_instruction, SPLCompression, TransferArgs, MPL_BUBBLEGUM_ID};

#[derive(Accounts)]
pub struct WithdrawTwo<'info> {
Expand Down
13 changes: 7 additions & 6 deletions compression/cnft-vault/anchor/programs/cnft-vault/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::diverging_sub_expression)]

use anchor_lang::prelude::*;
use anchor_lang::solana_program::instruction::{AccountMeta, Instruction};
use borsh::BorshSerialize;
Expand All @@ -9,16 +11,14 @@ declare_id!("Fd4iwpPWaCU8BNwGQGtvvrcvG4Tfizq3RgLm8YLBJX6D");

/// mpl-bubblegum program ID (BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY)
const MPL_BUBBLEGUM_ID: Pubkey = Pubkey::new_from_array([
0x98, 0x8b, 0x80, 0xeb, 0x79, 0x35, 0x28, 0x69, 0xb2, 0x24, 0x74, 0x5f, 0x59, 0xdd, 0xbf,
0x8a, 0x26, 0x58, 0xca, 0x13, 0xdc, 0x68, 0x81, 0x21, 0x26, 0x35, 0x1c, 0xae, 0x07, 0xc1,
0xa5, 0xa5,
0x98, 0x8b, 0x80, 0xeb, 0x79, 0x35, 0x28, 0x69, 0xb2, 0x24, 0x74, 0x5f, 0x59, 0xdd, 0xbf, 0x8a,
0x26, 0x58, 0xca, 0x13, 0xdc, 0x68, 0x81, 0x21, 0x26, 0x35, 0x1c, 0xae, 0x07, 0xc1, 0xa5, 0xa5,
]);

/// SPL Account Compression program ID (cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK)
const SPL_ACCOUNT_COMPRESSION_ID: Pubkey = Pubkey::new_from_array([
0x09, 0x2a, 0x13, 0xee, 0x95, 0xc4, 0x1c, 0xba, 0x08, 0xa6, 0x7f, 0x5a, 0xc6, 0x7e, 0x8d,
0xf7, 0xe1, 0xda, 0x11, 0x62, 0x5e, 0x1d, 0x64, 0x13, 0x7f, 0x8f, 0x4f, 0x23, 0x83, 0x03,
0x7f, 0x14,
0x09, 0x2a, 0x13, 0xee, 0x95, 0xc4, 0x1c, 0xba, 0x08, 0xa6, 0x7f, 0x5a, 0xc6, 0x7e, 0x8d, 0xf7,
0xe1, 0xda, 0x11, 0x62, 0x5e, 0x1d, 0x64, 0x13, 0x7f, 0x8f, 0x4f, 0x23, 0x83, 0x03, 0x7f, 0x14,
]);

/// Transfer instruction discriminator from mpl-bubblegum
Expand All @@ -45,6 +45,7 @@ impl anchor_lang::Id for SPLCompression {

/// Build a mpl-bubblegum Transfer instruction from pubkeys and args.
/// This avoids using mpl-bubblegum's CPI wrapper which requires solana-program 2.x AccountInfo.
#[allow(clippy::too_many_arguments)]
pub fn build_transfer_instruction(
tree_config: Pubkey,
leaf_owner: Pubkey,
Expand Down
Loading
Loading