Skip to content

Commit

Permalink
add cmv2 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelvanderwaal committed Jan 4, 2022
1 parent 10bc681 commit e3bd886
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 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 = "wtf-is"
version = "0.2.1"
version = "0.2.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
31 changes: 30 additions & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub static FAIR_LAUNCH: phf::Map<&'static str, &'static str> = phf_map! {};
pub static METAPLEX: phf::Map<&'static str, &'static str> = phf_map! {};

pub static NFT_CANDY_MACHINE: phf::Map<&'static str, &'static str> = phf_map! {
"12C" => "IncorrectOwner: Account does not have correct owner!",
"12C" => "IncorrectOwner: Account does not have correct owner!",
"12D" => "Uninitialized: Account is not initialized!",
"12E" => "MintMismatch: Mint Mismatch!",
"12F" => "IndexGreaterThanLength: Index greater than length!",
Expand All @@ -64,6 +64,35 @@ pub static NFT_CANDY_MACHINE: phf::Map<&'static str, &'static str> = phf_map! {
"139" => "ConfigLineMismatch: Number of config lines must be at least number of items available",
};

pub static NFT_CANDY_MACHINE_V2: phf::Map<&'static str, &'static str> = phf_map! {

"12C" => "IncorrectOwner: Account does not have correct owner!",
"12D" => "Uninitialized: Account is not initialized!",
"12E" => "MintMismatch: Mint Mismatch!",
"12F" => "IndexGreaterThanLength: Index greater than length!",
"130" => "NumericalOverflowError: Numerical overflow error!",
"131" => "TooManyCreators: Can only provide up to 4 creators to candy machine (because candy machine is one)!",
"132" => "UuidMustBeExactly6Length: Uuid must be exactly of 6 length",
"133" => "NotEnoughTokens: Not enough tokens to pay for this minting",
"134" => "NotEnoughSOL: Not enough SOL to pay for this minting",
"135" => "TokenTransferFailed: Token transfer failed",
"136" => "CandyMachineEmpty: Candy machine is empty!",
"137" => "CandyMachineNotLive: Candy machine is not live!",
"138" => "HiddenSettingsConfigsDoNotHaveConfigLines: Configs that are using hidden uris do not have config lines, they have a single hash representing hashed order",
"139" => "CannotChangeNumberOfLines: Cannot change number of lines unless is a hidden config",
"13A" => "DerivedKeyInvalid: Derived key invalid",
"13B" => "PublicKeyMismatch: Public key mismatch",
"13C" => "NoWhitelistToken: No whitelist token present",
"13D" => "TokenBurnFailed: Token burn failed",
"13E" => "GatewayAppMissing: Missing gateway app when required",
"13F" => "GatewayTokenMissing: Missing gateway token when required",
"140" => "GatewayTokenExpireTimeInvalid: Invalid gateway token expire time",
"141" => "NetworkExpireFeatureMissing: Missing gateway network expire feature when required",
"142" => "CannotFindUsableConfigLine: Unable to find an unused config line near your random number index",
"143" => "InvalidString: Invalid string",
"144" => "SuspiciousTransaction: Suspicious transaction detected",
};

pub static TOKEN_METADATA: phf::Map<&'static str, &'static str> = phf_map! {
"0" => "InstructionUnpackError: Failed to unpack instruction data",
"1" => "InstructionPackError: Failed to pack instruction data",
Expand Down
10 changes: 9 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ pub fn find_errors(hex_code: &str) -> Vec<FoundError> {

match errors::NFT_CANDY_MACHINE.get(hex_code).cloned() {
Some(e) => found_errors.push(FoundError {
domain: "NFT Candy Machine".to_string(),
domain: "NFT Candy Machine V1".to_string(),
message: e.to_string(),
}),
None => (),
}

match errors::NFT_CANDY_MACHINE_V2.get(hex_code).cloned() {
Some(e) => found_errors.push(FoundError {
domain: "NFT Candy Machine V2".to_string(),
message: e.to_string(),
}),
None => (),
Expand Down

0 comments on commit e3bd886

Please sign in to comment.