Skip to content

Commit

Permalink
fix(snapshot): check creator at position is verified
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelvanderwaal committed Apr 26, 2022
1 parent 469c70f commit 5edfbbf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "metaboss"
version = "0.6.0"
version = "0.6.1"
edition = "2021"
description="The Metaplex NFT-standard Swiss Army Knife tool."
repository="https://github.com/samuelvanderwaal/metaboss"
Expand Down
4 changes: 2 additions & 2 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ pub struct SolanaConfig {
pub commitment: String,
}

pub fn first_creator_is_verified(creators_opt: &Option<Vec<Creator>>) -> bool {
pub fn creator_is_verified(creators_opt: &Option<Vec<Creator>>, position: usize) -> bool {
// Only add mints with a verified creator.
if let Some(creators) = creators_opt {
if creators[0].verified {
if creators[position].verified {
return true;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use std::{

use crate::derive::derive_cmv2_pda;
use crate::limiter::create_rate_limiter;
use crate::parse::{first_creator_is_verified, is_only_one_option};
use crate::parse::{creator_is_verified, is_only_one_option};
use crate::spinner::*;
use crate::{constants::*, decode::get_metadata_pda};

Expand Down Expand Up @@ -107,7 +107,7 @@ pub fn snapshot_mints(
}
};

if first_creator_is_verified(&metadata.data.creators) {
if creator_is_verified(&metadata.data.creators, position) {
mint_accounts.push(metadata.mint.to_string());
}
}
Expand Down Expand Up @@ -188,7 +188,7 @@ pub fn snapshot_holders(
};

// Check that first creator is verified
if !first_creator_is_verified(&metadata.data.creators) {
if !creator_is_verified(&metadata.data.creators, position) {
return;
}

Expand Down

0 comments on commit 5edfbbf

Please sign in to comment.