Skip to content

Commit

Permalink
update gumdrop for bubblegum version parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah Gundotra committed Jun 1, 2022
1 parent c3f0708 commit 78c0098
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
12 changes: 0 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ members = [
"plerkle",
"nft_api",
"nft_ingester",
<<<<<<< HEAD
=======
"programs/bubblegum",
"programs/gumdrop",
"programs/gummyroll",
"programs/gummyroll_crud",
>>>>>>> c8404ec (add gumdrop for batchminting)
"messenger"
]
exclude = [
Expand Down
12 changes: 12 additions & 0 deletions contracts/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
members = [
"programs/gummyroll",
"programs/gummyroll_crud",
"programs/bubblegum"
"programs/bubblegum",
"programs/gumdrop"
]
1 change: 1 addition & 0 deletions contracts/programs/bubblegum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ pub mod bubblegum {
);
emit!(leaf.to_event());
nonce.count = nonce.count.saturating_add(1);
msg!("yeehaw");
append_leaf(
&merkle_slab.key(),
*ctx.bumps.get("authority").unwrap(),
Expand Down
4 changes: 2 additions & 2 deletions contracts/programs/gumdrop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ cpi = ["no-entrypoint"]
default = []

[dependencies]
anchor-lang = { path="../../deps/anchor/lang" }
anchor-spl = { path="../../deps/anchor/spl" }
anchor-lang = { path="../../../deps/anchor/lang" }
anchor-spl = { path="../../../deps/anchor/spl" }
solana-program = "1.10.10"
spl-token = "3.3.0"
spl-associated-token-account = { version = "=1.0.5", features = [ "no-entrypoint" ] }
Expand Down
12 changes: 9 additions & 3 deletions contracts/programs/gumdrop/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,10 @@ pub mod gumdrop {
);

// This user is whitelisted to mint at most `amount` NFTs from the candy machine
require!(claim_count.count < (amount as u64), GumdropError::DropAlreadyClaimed);
require!(
claim_count.count < (amount as u64),
GumdropError::DropAlreadyClaimed
);

// Mark it claimed
claim_count.count = claim_count
Expand All @@ -723,6 +726,7 @@ pub mod gumdrop {
&ctx.accounts.bubblegum_tree_authority,
&ctx.accounts.bubblegum_program,
&ctx.accounts.gummyroll_program,
0,
nft_metadata,
)?;

Expand Down Expand Up @@ -852,7 +856,7 @@ fn create_new_compressed_tree<'info>(
// merkle slab
merkle_slab.clone(),
];

msg!("Invoking cpi to bubblegum");
invoke_signed(
&Instruction {
Expand All @@ -878,6 +882,7 @@ fn issue_compressed_nft<'info>(
merkle_tree_auth: &AccountInfo<'info>,
bubblegum_program: &AccountInfo<'info>,
gummyroll_program: &AccountInfo<'info>,
version: u8,
metadata_data: Vec<u8>,
) -> Result<()> {
verify_bubblegum(&bubblegum_program.key())?;
Expand All @@ -888,6 +893,7 @@ fn issue_compressed_nft<'info>(
// Prepend mint discriminant to metadata
// TODO(ngundotra): global::mint_compressed_nft ix
let mut ix_data = vec![51, 57, 225, 47, 182, 146, 137, 166];
ix_data.push(version);
ix_data.extend(metadata_data.iter());

let distributor_seeds = [
Expand Down Expand Up @@ -1812,4 +1818,4 @@ pub struct CandyMachineData {
pub price: u64,
pub items_available: u64,
pub go_live_date: Option<i64>,
}
}

0 comments on commit 78c0098

Please sign in to comment.