diff --git a/.github/actions/build-program/action.yml b/.github/actions/build-program/action.yml index f6982fdc33..c9ed4b6020 100644 --- a/.github/actions/build-program/action.yml +++ b/.github/actions/build-program/action.yml @@ -17,7 +17,7 @@ runs: working-directory: ./${{ inputs.name }}/program run: | mkdir -p ../../test-programs - solana program dump -u https://api.mainnet-beta.solana.com metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s ../../test-programs/mpl_token_metadata.so + solana program dump -u https://api.devnet.solana.com metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s ../../test-programs/mpl_token_metadata.so solana program dump -u https://api.mainnet-beta.solana.com auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg ../../test-programs/mpl_token_auth_rules.so solana program dump -u https://api.mainnet-beta.solana.com Roostrnex2Z9Y2XZC49sFAdZARP8E4iFpEnZC5QJWdz ../../test-programs/rooster.so cargo +${{ env.RUST_TOOLCHAIN }} build-bpf --version diff --git a/.github/actions/program/action.yml b/.github/actions/program/action.yml index c3226d4764..3ee02ac801 100644 --- a/.github/actions/program/action.yml +++ b/.github/actions/program/action.yml @@ -28,5 +28,5 @@ runs: working-directory: ./${{ inputs.name }}/program run: | mkdir -p ../../test-programs - solana program dump -u https://api.mainnet-beta.solana.com metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s ../../test-programs/mpl_token_metadata.so + solana program dump -u https://api.devnet.solana.com metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s ../../test-programs/mpl_token_metadata.so shell: bash diff --git a/auction-house/program/Cargo.lock b/auction-house/program/Cargo.lock index 3cea7bae08..4896a466bd 100644 --- a/auction-house/program/Cargo.lock +++ b/auction-house/program/Cargo.lock @@ -103,7 +103,7 @@ checksum = "cf7d535e1381be3de2c0716c0a1c1e32ad9df1042cddcf7bc18d743569e53319" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "regex", "syn 1.0.107", @@ -118,7 +118,7 @@ dependencies = [ "anchor-syn", "anyhow", "bs58 0.4.0", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "rustversion", "syn 1.0.107", @@ -131,7 +131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1be64a48e395fe00b8217287f226078be2cf32dae42fdf8a885b997945c3d28" dependencies = [ "anchor-syn", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "syn 1.0.107", ] @@ -142,7 +142,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38ea6713d1938c0da03656ff8a693b17dc0396da66d1ba320557f07e86eca0d4" dependencies = [ "anchor-syn", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -155,7 +155,7 @@ checksum = "d401f11efb3644285685f8339829a9786d43ed7490bb1699f33c478d04d5a582" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -169,7 +169,7 @@ dependencies = [ "anchor-syn", "anyhow", "heck 0.3.3", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -182,7 +182,7 @@ checksum = "6ad769993b5266714e8939e47fbdede90e5c030333c7522d99a4d4748cf26712" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -195,7 +195,7 @@ checksum = "4e677fae4a016a554acdd0e3b7f178d3acafaa7e7ffac6b8690cf4e171f1c116" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -225,7 +225,7 @@ checksum = "340beef6809d1c3fcc7ae219153d981e95a8a277ff31985bd7050e32645dc9a8" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -275,7 +275,7 @@ dependencies = [ "anyhow", "bs58 0.3.1", "heck 0.3.3", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "proc-macro2-diagnostics", "quote 1.0.23", "serde", @@ -340,7 +340,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "synstructure", @@ -352,7 +352,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -392,7 +392,7 @@ version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -520,7 +520,7 @@ dependencies = [ "borsh-derive-internal", "borsh-schema-derive-internal", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "syn 1.0.107", ] @@ -530,7 +530,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -541,7 +541,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -610,7 +610,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aca418a974d83d40a0c1f0c5cba6ff4bc28d8df099109ca459a2118d40b6322" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -1077,7 +1077,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -1153,7 +1153,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c07b7cc9cd8c08d10db74fca3b20949b9b6199725c04a0cce6d543496098fcac" dependencies = [ "enum-ordinalize", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -1194,7 +1194,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -1207,7 +1207,7 @@ checksum = "2170fc0efee383079a8bdd05d6ea2a184d2a0f07a1c1dcabdb2fd5e9f24bc36c" dependencies = [ "num-bigint 0.4.3", "num-traits", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "rustc_version", "syn 1.0.107", @@ -1220,7 +1220,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eb359f1476bf611266ac1f5355bc14aeca37b299d0ebccc038ee7058891c9cb" dependencies = [ "once_cell", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -1372,7 +1372,7 @@ version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -2015,7 +2015,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -2246,7 +2246,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -2331,7 +2331,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ "proc-macro-crate 1.1.3", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -2421,7 +2421,7 @@ checksum = "4a0d9d1a6191c4f391f87219d1ea42b23f09ee84d64763cd05ee6ea88d9f384d" dependencies = [ "Inflector", "proc-macro-error", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -2537,7 +2537,7 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -2621,7 +2621,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "version_check", @@ -2633,7 +2633,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "version_check", ] @@ -2649,9 +2649,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] @@ -2662,7 +2662,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "version_check", @@ -2746,7 +2746,7 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", ] [[package]] @@ -3123,7 +3123,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -3191,7 +3191,7 @@ version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -3312,7 +3312,7 @@ version = "0.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b43a02ae007b64b177f4dbb21d322f276458e4860f9fefbd8b9b791c21644ab" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "shank_macro_impl 0.0.9", "syn 1.0.107", @@ -3324,7 +3324,7 @@ version = "0.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63927d22a1e8b74bda98cc6e151fcdf178b7abb0dc6c4f81e0bbf5ffe2fc4ec8" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "shank_macro_impl 0.0.11", "syn 1.0.107", @@ -3337,7 +3337,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d36cdf68202db080a13ef0300c369fc691695265e3d0ab0fa08d4734b0cfb66" dependencies = [ "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "serde", "syn 1.0.107", @@ -3350,7 +3350,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ce03403df682f80f4dc1efafa87a4d0cb89b03726d0565e6364bdca5b9a441" dependencies = [ "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "serde", "syn 1.0.107", @@ -3725,7 +3725,7 @@ version = "1.14.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be23cc7a382f54dfe1348edb94610e5cc146b8eb21563cdd04062a403c75ba62" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "rustc_version", "syn 1.0.107", @@ -4064,7 +4064,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d0acbad862093ea123f3a27364336dcb0c8373522cd6810496a34e932c56c1" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "rustversion", "syn 1.0.107", @@ -4375,7 +4375,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.0", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "rustversion", "syn 1.0.107", @@ -4410,7 +4410,7 @@ version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "unicode-ident", ] @@ -4421,7 +4421,7 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "unicode-xid 0.2.2", @@ -4468,7 +4468,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -4536,7 +4536,7 @@ version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -4638,7 +4638,7 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -4760,7 +4760,7 @@ version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e65ce065b4b5c53e73bb28912318cb8c9e9ad3921f1d669eb0e68b4c8143a2b" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -5007,7 +5007,7 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "wasm-bindgen-shared", @@ -5041,7 +5041,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "wasm-bindgen-backend", @@ -5232,7 +5232,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "synstructure", diff --git a/auction-house/program/src/utils.rs b/auction-house/program/src/utils.rs index 8889044cad..88982960f6 100644 --- a/auction-house/program/src/utils.rs +++ b/auction-house/program/src/utils.rs @@ -15,7 +15,7 @@ use anchor_lang::{ }; use anchor_spl::token::{Mint, Token, TokenAccount}; use arrayref::array_ref; -use mpl_token_metadata::state::{Metadata, TokenMetadataAccount}; +use mpl_token_metadata::state::Metadata; use spl_token::{instruction::initialize_account2, state::Account as SplAccount}; use std::{convert::TryInto, slice::Iter}; @@ -379,7 +379,11 @@ pub fn pay_creator_fees<'a>( size: u64, is_native: bool, ) -> Result { - let metadata = Metadata::from_account_info(metadata_info)?; + let data = &metadata_info.data.borrow_mut(); + if data.is_empty() || data[0] != mpl_token_metadata::state::Key::MetadataV1 as u8 { + return Err(AuctionHouseError::MetadataDoesntExist.into()); + } + let metadata = Metadata::deserialize(&mut data.as_ref())?; let fees = metadata.data.seller_fee_basis_points; let total_fee = (fees as u128) .checked_mul(size as u128) diff --git a/auctioneer/program/Cargo.lock b/auctioneer/program/Cargo.lock index 49119ddac0..8660bbaef3 100644 --- a/auctioneer/program/Cargo.lock +++ b/auctioneer/program/Cargo.lock @@ -103,7 +103,7 @@ checksum = "cf7d535e1381be3de2c0716c0a1c1e32ad9df1042cddcf7bc18d743569e53319" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "regex", "syn 1.0.107", @@ -118,7 +118,7 @@ dependencies = [ "anchor-syn", "anyhow", "bs58 0.4.0", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustversion", "syn 1.0.107", @@ -131,7 +131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1be64a48e395fe00b8217287f226078be2cf32dae42fdf8a885b997945c3d28" dependencies = [ "anchor-syn", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "syn 1.0.107", ] @@ -142,7 +142,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38ea6713d1938c0da03656ff8a693b17dc0396da66d1ba320557f07e86eca0d4" dependencies = [ "anchor-syn", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -155,7 +155,7 @@ checksum = "d401f11efb3644285685f8339829a9786d43ed7490bb1699f33c478d04d5a582" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -169,7 +169,7 @@ dependencies = [ "anchor-syn", "anyhow", "heck 0.3.3", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -182,7 +182,7 @@ checksum = "6ad769993b5266714e8939e47fbdede90e5c030333c7522d99a4d4748cf26712" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -195,7 +195,7 @@ checksum = "4e677fae4a016a554acdd0e3b7f178d3acafaa7e7ffac6b8690cf4e171f1c116" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -225,7 +225,7 @@ checksum = "340beef6809d1c3fcc7ae219153d981e95a8a277ff31985bd7050e32645dc9a8" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -275,7 +275,7 @@ dependencies = [ "anyhow", "bs58 0.3.1", "heck 0.3.3", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "proc-macro2-diagnostics", "quote 1.0.21", "serde", @@ -349,7 +349,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "synstructure", @@ -361,7 +361,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -401,7 +401,7 @@ version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -523,7 +523,7 @@ dependencies = [ "borsh-derive-internal", "borsh-schema-derive-internal", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "syn 1.0.107", ] @@ -533,7 +533,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -544,7 +544,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -613,7 +613,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9e1f5fa78f69496407a27ae9ed989e3c3b072310286f5ef385525e4cbc24a9" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1080,7 +1080,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1156,7 +1156,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c07b7cc9cd8c08d10db74fca3b20949b9b6199725c04a0cce6d543496098fcac" dependencies = [ "enum-ordinalize", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1197,7 +1197,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1210,7 +1210,7 @@ checksum = "2170fc0efee383079a8bdd05d6ea2a184d2a0f07a1c1dcabdb2fd5e9f24bc36c" dependencies = [ "num-bigint 0.4.3", "num-traits", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustc_version", "syn 1.0.107", @@ -1223,7 +1223,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eb359f1476bf611266ac1f5355bc14aeca37b299d0ebccc038ee7058891c9cb" dependencies = [ "once_cell", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1353,7 +1353,7 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2003,7 +2003,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2245,7 +2245,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2330,7 +2330,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ "proc-macro-crate 1.2.1", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2420,7 +2420,7 @@ checksum = "4a0d9d1a6191c4f391f87219d1ea42b23f09ee84d64763cd05ee6ea88d9f384d" dependencies = [ "Inflector", "proc-macro-error", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2536,7 +2536,7 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2621,7 +2621,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "version_check", @@ -2633,7 +2633,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "version_check", ] @@ -2649,9 +2649,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] @@ -2662,7 +2662,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "version_check", @@ -2746,7 +2746,7 @@ version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", ] [[package]] @@ -3125,7 +3125,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -3193,7 +3193,7 @@ version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -3314,7 +3314,7 @@ version = "0.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b43a02ae007b64b177f4dbb21d322f276458e4860f9fefbd8b9b791c21644ab" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "shank_macro_impl 0.0.9", "syn 1.0.107", @@ -3326,7 +3326,7 @@ version = "0.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63927d22a1e8b74bda98cc6e151fcdf178b7abb0dc6c4f81e0bbf5ffe2fc4ec8" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "shank_macro_impl 0.0.11", "syn 1.0.107", @@ -3339,7 +3339,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d36cdf68202db080a13ef0300c369fc691695265e3d0ab0fa08d4734b0cfb66" dependencies = [ "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "serde", "syn 1.0.107", @@ -3352,7 +3352,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ce03403df682f80f4dc1efafa87a4d0cb89b03726d0565e6364bdca5b9a441" dependencies = [ "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "serde", "syn 1.0.107", @@ -3730,7 +3730,7 @@ version = "1.14.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be23cc7a382f54dfe1348edb94610e5cc146b8eb21563cdd04062a403c75ba62" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustc_version", "syn 1.0.107", @@ -4069,7 +4069,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d0acbad862093ea123f3a27364336dcb0c8373522cd6810496a34e932c56c1" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustversion", "syn 1.0.107", @@ -4380,7 +4380,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.0", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustversion", "syn 1.0.107", @@ -4415,7 +4415,7 @@ version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "unicode-ident", ] @@ -4426,7 +4426,7 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "unicode-xid 0.2.4", @@ -4473,7 +4473,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -4541,7 +4541,7 @@ version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -4644,7 +4644,7 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -4766,7 +4766,7 @@ version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -5018,7 +5018,7 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "wasm-bindgen-shared", @@ -5052,7 +5052,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "wasm-bindgen-backend", @@ -5243,7 +5243,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "synstructure", diff --git a/candy-machine/program/Cargo.lock b/candy-machine/program/Cargo.lock index 5d6a71b8bb..5b53f83680 100644 --- a/candy-machine/program/Cargo.lock +++ b/candy-machine/program/Cargo.lock @@ -103,7 +103,7 @@ checksum = "cf7d535e1381be3de2c0716c0a1c1e32ad9df1042cddcf7bc18d743569e53319" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "regex", "syn 1.0.107", @@ -118,7 +118,7 @@ dependencies = [ "anchor-syn", "anyhow", "bs58 0.4.0", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "rustversion", "syn 1.0.107", @@ -131,7 +131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1be64a48e395fe00b8217287f226078be2cf32dae42fdf8a885b997945c3d28" dependencies = [ "anchor-syn", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "syn 1.0.107", ] @@ -142,7 +142,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38ea6713d1938c0da03656ff8a693b17dc0396da66d1ba320557f07e86eca0d4" dependencies = [ "anchor-syn", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -155,7 +155,7 @@ checksum = "d401f11efb3644285685f8339829a9786d43ed7490bb1699f33c478d04d5a582" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -169,7 +169,7 @@ dependencies = [ "anchor-syn", "anyhow", "heck 0.3.3", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -182,7 +182,7 @@ checksum = "6ad769993b5266714e8939e47fbdede90e5c030333c7522d99a4d4748cf26712" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -195,7 +195,7 @@ checksum = "4e677fae4a016a554acdd0e3b7f178d3acafaa7e7ffac6b8690cf4e171f1c116" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -225,7 +225,7 @@ checksum = "340beef6809d1c3fcc7ae219153d981e95a8a277ff31985bd7050e32645dc9a8" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -275,7 +275,7 @@ dependencies = [ "anyhow", "bs58 0.3.1", "heck 0.3.3", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "proc-macro2-diagnostics", "quote 1.0.23", "serde", @@ -340,7 +340,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "synstructure", @@ -352,7 +352,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -392,7 +392,7 @@ version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -520,7 +520,7 @@ dependencies = [ "borsh-derive-internal", "borsh-schema-derive-internal", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "syn 1.0.107", ] @@ -530,7 +530,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -541,7 +541,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -610,7 +610,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9e1f5fa78f69496407a27ae9ed989e3c3b072310286f5ef385525e4cbc24a9" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -1055,7 +1055,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -1131,7 +1131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c07b7cc9cd8c08d10db74fca3b20949b9b6199725c04a0cce6d543496098fcac" dependencies = [ "enum-ordinalize", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -1172,7 +1172,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -1185,7 +1185,7 @@ checksum = "2170fc0efee383079a8bdd05d6ea2a184d2a0f07a1c1dcabdb2fd5e9f24bc36c" dependencies = [ "num-bigint 0.4.3", "num-traits", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "rustc_version", "syn 1.0.107", @@ -1198,7 +1198,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eb359f1476bf611266ac1f5355bc14aeca37b299d0ebccc038ee7058891c9cb" dependencies = [ "once_cell", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -1350,7 +1350,7 @@ version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -1992,7 +1992,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -2160,7 +2160,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -2233,7 +2233,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21" dependencies = [ "proc-macro-crate 1.1.0", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -2323,7 +2323,7 @@ checksum = "4a0d9d1a6191c4f391f87219d1ea42b23f09ee84d64763cd05ee6ea88d9f384d" dependencies = [ "Inflector", "proc-macro-error", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -2439,7 +2439,7 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -2523,7 +2523,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "version_check", @@ -2535,7 +2535,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "version_check", ] @@ -2551,9 +2551,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.46" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] @@ -2564,7 +2564,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "version_check", @@ -2648,7 +2648,7 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", ] [[package]] @@ -3026,7 +3026,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -3094,7 +3094,7 @@ version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -3206,7 +3206,7 @@ version = "0.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63927d22a1e8b74bda98cc6e151fcdf178b7abb0dc6c4f81e0bbf5ffe2fc4ec8" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "shank_macro_impl", "syn 1.0.107", @@ -3219,7 +3219,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ce03403df682f80f4dc1efafa87a4d0cb89b03726d0565e6364bdca5b9a441" dependencies = [ "anyhow", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "serde", "syn 1.0.107", @@ -3598,7 +3598,7 @@ version = "1.14.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be23cc7a382f54dfe1348edb94610e5cc146b8eb21563cdd04062a403c75ba62" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "rustc_version", "syn 1.0.107", @@ -3952,7 +3952,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d0acbad862093ea123f3a27364336dcb0c8373522cd6810496a34e932c56c1" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "rustversion", "syn 1.0.107", @@ -4263,7 +4263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.0", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "rustversion", "syn 1.0.107", @@ -4298,7 +4298,7 @@ version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "unicode-ident", ] @@ -4309,7 +4309,7 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "unicode-xid 0.2.2", @@ -4356,7 +4356,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -4414,7 +4414,7 @@ version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -4516,7 +4516,7 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -4638,7 +4638,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", ] @@ -4885,7 +4885,7 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "wasm-bindgen-shared", @@ -4919,7 +4919,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "wasm-bindgen-backend", @@ -5167,7 +5167,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ - "proc-macro2 1.0.46", + "proc-macro2 1.0.60", "quote 1.0.23", "syn 1.0.107", "synstructure", diff --git a/candy-machine/program/src/errors.rs b/candy-machine/program/src/errors.rs index 7822292c6d..5c9161e149 100644 --- a/candy-machine/program/src/errors.rs +++ b/candy-machine/program/src/errors.rs @@ -110,4 +110,6 @@ pub enum CandyError { SizedCollectionMetadataMustBeMutable, #[msg("Cannot remove Hidden Settings.")] CannotSwitchFromHiddenSettings, + #[msg("Invalid Metadata Account")] + InvalidMetadataAccount, } diff --git a/candy-machine/program/src/processor/collection/remove_collection.rs b/candy-machine/program/src/processor/collection/remove_collection.rs index fdbce28790..f3b7159d3e 100644 --- a/candy-machine/program/src/processor/collection/remove_collection.rs +++ b/candy-machine/program/src/processor/collection/remove_collection.rs @@ -1,8 +1,5 @@ use anchor_lang::prelude::*; -use mpl_token_metadata::{ - instruction::revoke_collection_authority, - state::{Metadata, TokenMetadataAccount}, -}; +use mpl_token_metadata::{instruction::revoke_collection_authority, state::Metadata}; use solana_program::program::invoke; use crate::{ @@ -35,7 +32,13 @@ pub fn handle_remove_collection(ctx: Context) -> Result<()> { let candy_machine = &mut ctx.accounts.candy_machine; candy_machine.assert_not_minted(error!(CandyError::NoChangingCollectionDuringMint))?; - let metadata: Metadata = Metadata::from_account_info(&ctx.accounts.metadata.to_account_info())?; + let metadata = { + let data = &ctx.accounts.metadata.data.borrow_mut(); + if data.is_empty() || data[0] != mpl_token_metadata::state::Key::MetadataV1 as u8 { + return Err(CandyError::InvalidMetadataAccount.into()); + } + Metadata::deserialize(&mut data.as_ref())? + }; if !cmp_pubkeys(&metadata.update_authority, &ctx.accounts.authority.key()) { return err!(CandyError::IncorrectCollectionAuthority); }; diff --git a/candy-machine/program/src/processor/collection/set_collection.rs b/candy-machine/program/src/processor/collection/set_collection.rs index dad44515db..a533e3af2f 100644 --- a/candy-machine/program/src/processor/collection/set_collection.rs +++ b/candy-machine/program/src/processor/collection/set_collection.rs @@ -1,14 +1,12 @@ use anchor_lang::prelude::*; use mpl_token_metadata::{ - assertions::collection::assert_master_edition, - instruction::approve_collection_authority, - state::{Metadata, TokenMetadataAccount}, + instruction::approve_collection_authority, state::Metadata, utils::create_or_allocate_account_raw, }; use solana_program::program::invoke; use crate::{ - cmp_pubkeys, + assert_master_edition, cmp_pubkeys, constants::{COLLECTIONS_FEATURE_INDEX, COLLECTION_PDA_SIZE}, set_feature_flag, CandyError, CandyMachine, CollectionPDA, }; @@ -42,7 +40,13 @@ pub struct SetCollection<'info> { pub fn handle_set_collection(ctx: Context) -> Result<()> { let mint = ctx.accounts.mint.to_account_info(); - let metadata: Metadata = Metadata::from_account_info(&ctx.accounts.metadata.to_account_info())?; + let metadata = { + let data = &ctx.accounts.metadata.data.borrow_mut(); + if data.is_empty() || data[0] != mpl_token_metadata::state::Key::MetadataV1 as u8 { + return Err(CandyError::InvalidMetadataAccount.into()); + } + Metadata::deserialize(&mut data.as_ref())? + }; if !cmp_pubkeys(&metadata.update_authority, &ctx.accounts.authority.key()) { return err!(CandyError::IncorrectCollectionAuthority); } diff --git a/candy-machine/program/src/processor/collection/set_collection_during_mint.rs b/candy-machine/program/src/processor/collection/set_collection_during_mint.rs index 0d311d0fe3..914ba6ea62 100644 --- a/candy-machine/program/src/processor/collection/set_collection_during_mint.rs +++ b/candy-machine/program/src/processor/collection/set_collection_during_mint.rs @@ -1,7 +1,7 @@ use anchor_lang::prelude::*; use mpl_token_metadata::{ instruction::{set_and_verify_collection, set_and_verify_sized_collection_item}, - state::{Metadata, TokenMetadataAccount}, + state::Metadata, utils::assert_derivation, }; use solana_program::{ @@ -108,9 +108,13 @@ pub fn handle_set_collection_during_mint(ctx: Context) return Ok(()); } - let collection_metadata: Metadata = - Metadata::safe_deserialize(&ctx.accounts.collection_metadata.data.borrow_mut())?; - + let collection_metadata: Metadata = { + let data = ctx.accounts.collection_metadata.data.borrow_mut(); + if data.is_empty() || data[0] != mpl_token_metadata::state::Key::MetadataV1 as u8 { + return err!(CandyError::InvalidMetadataAccount); + } + Metadata::deserialize(&mut data.as_ref())? + }; let collection_instruction = if collection_metadata.collection_details.is_some() { if !ctx.accounts.collection_metadata.is_writable { return err!(CandyError::SizedCollectionMetadataMustBeMutable); diff --git a/candy-machine/program/src/utils.rs b/candy-machine/program/src/utils.rs index 4e08827983..a14ecc6c2d 100644 --- a/candy-machine/program/src/utils.rs +++ b/candy-machine/program/src/utils.rs @@ -1,4 +1,8 @@ use anchor_lang::prelude::*; +use mpl_token_metadata::{ + error::MetadataError, + state::{MasterEditionV2, Metadata, TokenStandard}, +}; use solana_program::{ account_info::AccountInfo, clock::Clock, @@ -234,6 +238,28 @@ pub fn punish_bots<'a>( Ok(()) } +pub fn assert_master_edition( + collection_data: &Metadata, + edition_account_info: &AccountInfo, +) -> core::result::Result<(), ProgramError> { + let data = edition_account_info.try_borrow_data()?; + if data.is_empty() || data[0] != mpl_token_metadata::state::Key::MasterEditionV2 as u8 { + return Err(MetadataError::DataTypeMismatch.into()); + } + let edition = MasterEditionV2::deserialize(&mut data.as_ref()) + .map_err(|_err: std::io::Error| MetadataError::CollectionMustBeAUniqueMasterEdition)?; + + match collection_data.token_standard { + Some(TokenStandard::NonFungible) | Some(TokenStandard::ProgrammableNonFungible) => (), + _ => return Err(MetadataError::CollectionMustBeAUniqueMasterEdition.into()), + } + + if edition.max_supply != Some(0) { + return Err(MetadataError::CollectionMustBeAUniqueMasterEdition.into()); + } + Ok(()) +} + #[cfg(test)] pub mod tests { use std::{assert_eq, println}; diff --git a/candy-machine/program/tests/utils/candy_manager.rs b/candy-machine/program/tests/utils/candy_manager.rs index b819821318..ab6da87f4d 100644 --- a/candy-machine/program/tests/utils/candy_manager.rs +++ b/candy-machine/program/tests/utils/candy_manager.rs @@ -1028,7 +1028,7 @@ impl CandyManager { } let sol_fees = { - let mut fees = 5000 + 5616720 + 2853600 + 10000000; + let mut fees = 5000 + 5115600 + 1030080 + 10000000; if self.freeze_info.set { let freeze_pda = self.get_freeze_pda(context).await; fees += freeze_pda.freeze_fee; diff --git a/fixed-price-sale/program/Cargo.lock b/fixed-price-sale/program/Cargo.lock index b7d26b2d75..4c1c5ce799 100644 --- a/fixed-price-sale/program/Cargo.lock +++ b/fixed-price-sale/program/Cargo.lock @@ -103,7 +103,7 @@ checksum = "cf7d535e1381be3de2c0716c0a1c1e32ad9df1042cddcf7bc18d743569e53319" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "regex", "syn 1.0.107", @@ -118,7 +118,7 @@ dependencies = [ "anchor-syn", "anyhow", "bs58 0.4.0", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustversion", "syn 1.0.107", @@ -131,7 +131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1be64a48e395fe00b8217287f226078be2cf32dae42fdf8a885b997945c3d28" dependencies = [ "anchor-syn", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "syn 1.0.107", ] @@ -142,7 +142,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38ea6713d1938c0da03656ff8a693b17dc0396da66d1ba320557f07e86eca0d4" dependencies = [ "anchor-syn", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -155,7 +155,7 @@ checksum = "d401f11efb3644285685f8339829a9786d43ed7490bb1699f33c478d04d5a582" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -169,7 +169,7 @@ dependencies = [ "anchor-syn", "anyhow", "heck 0.3.3", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -182,7 +182,7 @@ checksum = "6ad769993b5266714e8939e47fbdede90e5c030333c7522d99a4d4748cf26712" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -195,7 +195,7 @@ checksum = "4e677fae4a016a554acdd0e3b7f178d3acafaa7e7ffac6b8690cf4e171f1c116" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -225,7 +225,7 @@ checksum = "340beef6809d1c3fcc7ae219153d981e95a8a277ff31985bd7050e32645dc9a8" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -275,7 +275,7 @@ dependencies = [ "anyhow", "bs58 0.3.1", "heck 0.3.3", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "proc-macro2-diagnostics", "quote 1.0.21", "serde", @@ -349,7 +349,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "synstructure", @@ -361,7 +361,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -401,7 +401,7 @@ version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -523,7 +523,7 @@ dependencies = [ "borsh-derive-internal", "borsh-schema-derive-internal", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "syn 1.0.107", ] @@ -533,7 +533,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -544,7 +544,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -613,7 +613,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9e1f5fa78f69496407a27ae9ed989e3c3b072310286f5ef385525e4cbc24a9" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1080,7 +1080,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1156,7 +1156,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c07b7cc9cd8c08d10db74fca3b20949b9b6199725c04a0cce6d543496098fcac" dependencies = [ "enum-ordinalize", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1197,7 +1197,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1210,7 +1210,7 @@ checksum = "2170fc0efee383079a8bdd05d6ea2a184d2a0f07a1c1dcabdb2fd5e9f24bc36c" dependencies = [ "num-bigint 0.4.3", "num-traits", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustc_version", "syn 1.0.107", @@ -1223,7 +1223,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eb359f1476bf611266ac1f5355bc14aeca37b299d0ebccc038ee7058891c9cb" dependencies = [ "once_cell", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1353,7 +1353,7 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2003,7 +2003,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2226,7 +2226,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2311,7 +2311,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ "proc-macro-crate 1.2.1", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2401,7 +2401,7 @@ checksum = "4a0d9d1a6191c4f391f87219d1ea42b23f09ee84d64763cd05ee6ea88d9f384d" dependencies = [ "Inflector", "proc-macro-error", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2517,7 +2517,7 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2602,7 +2602,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "version_check", @@ -2614,7 +2614,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "version_check", ] @@ -2630,9 +2630,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] @@ -2643,7 +2643,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "version_check", @@ -2727,7 +2727,7 @@ version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", ] [[package]] @@ -3106,7 +3106,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -3174,7 +3174,7 @@ version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -3295,7 +3295,7 @@ version = "0.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b43a02ae007b64b177f4dbb21d322f276458e4860f9fefbd8b9b791c21644ab" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "shank_macro_impl 0.0.9", "syn 1.0.107", @@ -3307,7 +3307,7 @@ version = "0.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63927d22a1e8b74bda98cc6e151fcdf178b7abb0dc6c4f81e0bbf5ffe2fc4ec8" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "shank_macro_impl 0.0.11", "syn 1.0.107", @@ -3320,7 +3320,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d36cdf68202db080a13ef0300c369fc691695265e3d0ab0fa08d4734b0cfb66" dependencies = [ "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "serde", "syn 1.0.107", @@ -3333,7 +3333,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ce03403df682f80f4dc1efafa87a4d0cb89b03726d0565e6364bdca5b9a441" dependencies = [ "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "serde", "syn 1.0.107", @@ -3711,7 +3711,7 @@ version = "1.14.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be23cc7a382f54dfe1348edb94610e5cc146b8eb21563cdd04062a403c75ba62" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustc_version", "syn 1.0.107", @@ -4050,7 +4050,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d0acbad862093ea123f3a27364336dcb0c8373522cd6810496a34e932c56c1" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustversion", "syn 1.0.107", @@ -4361,7 +4361,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.0", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustversion", "syn 1.0.107", @@ -4396,7 +4396,7 @@ version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "unicode-ident", ] @@ -4407,7 +4407,7 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "unicode-xid 0.2.4", @@ -4454,7 +4454,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -4522,7 +4522,7 @@ version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -4625,7 +4625,7 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -4747,7 +4747,7 @@ version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -4999,7 +4999,7 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "wasm-bindgen-shared", @@ -5033,7 +5033,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "wasm-bindgen-backend", @@ -5224,7 +5224,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "synstructure", diff --git a/fixed-price-sale/program/src/error.rs b/fixed-price-sale/program/src/error.rs index 768f141707..d1ea07bfa6 100644 --- a/fixed-price-sale/program/src/error.rs +++ b/fixed-price-sale/program/src/error.rs @@ -142,4 +142,7 @@ pub enum ErrorCode { // 6045 #[msg("Invalid edition marker")] InvalidEditionMarkerAccount, + // 6046 + #[msg("Invalid Metadata Account")] + InvalidMetadataAccount, } diff --git a/fixed-price-sale/program/src/processor/buy.rs b/fixed-price-sale/program/src/processor/buy.rs index 3213c0f08e..525aa56daa 100644 --- a/fixed-price-sale/program/src/processor/buy.rs +++ b/fixed-price-sale/program/src/processor/buy.rs @@ -373,7 +373,11 @@ impl<'info> Buy<'info> { user_token_acc.try_borrow_data()?.as_ref(), )?; - let metadata_data = Metadata::from_account_info(metadata)?; + let data = &metadata.data.borrow_mut(); + if data.is_empty() || data[0] != mpl_token_metadata::state::Key::MetadataV1 as u8 { + return Err(ErrorCode::InvalidMetadataAccount.into()); + } + let metadata_data = Metadata::deserialize(&mut data.as_ref())?; let token_metadata_program_key = mpl_token_metadata::id(); let metadata_seeds = &[ diff --git a/fixed-price-sale/program/src/processor/claim_resource.rs b/fixed-price-sale/program/src/processor/claim_resource.rs index dd4e17ef9f..0181a6425f 100644 --- a/fixed-price-sale/program/src/processor/claim_resource.rs +++ b/fixed-price-sale/program/src/processor/claim_resource.rs @@ -6,7 +6,6 @@ use crate::{ }; use anchor_lang::{prelude::*, solana_program::program_pack::Pack, system_program::System}; use anchor_spl::token; -use mpl_token_metadata::state::TokenMetadataAccount; impl<'info> ClaimResource<'info> { pub fn process(&mut self, vault_owner_bump: u8) -> Result<()> { @@ -69,9 +68,17 @@ impl<'info> ClaimResource<'info> { ]]; // Update primary sale flag - let metadata_state: mpl_token_metadata::state::Metadata = - mpl_token_metadata::state::Metadata::from_account_info(metadata)?; - if !metadata_state.primary_sale_happened { + let primary_sale_happened = { + let data = &metadata.data.borrow_mut(); + if data.is_empty() || data[0] != mpl_token_metadata::state::Key::MetadataV1 as u8 { + return Err(ErrorCode::InvalidMetadataAccount.into()); + } + let metadata_state = + mpl_token_metadata::state::Metadata::deserialize(&mut data.as_ref())?; + metadata_state.primary_sale_happened + }; + + if !primary_sale_happened { mpl_update_primary_sale_happened_via_token( &metadata.to_account_info(), &vault_owner.to_account_info(), diff --git a/fixed-price-sale/program/src/processor/init_selling_resource.rs b/fixed-price-sale/program/src/processor/init_selling_resource.rs index 895305fca2..1db6858dcb 100644 --- a/fixed-price-sale/program/src/processor/init_selling_resource.rs +++ b/fixed-price-sale/program/src/processor/init_selling_resource.rs @@ -1,7 +1,6 @@ use crate::{error::ErrorCode, state::SellingResourceState, utils::*, InitSellingResource}; use anchor_lang::prelude::*; use anchor_spl::token; -use mpl_token_metadata::state::TokenMetadataAccount; impl<'info> InitSellingResource<'info> { pub fn process( @@ -45,8 +44,11 @@ impl<'info> InitSellingResource<'info> { ], )?; - let metadata = - mpl_token_metadata::state::Metadata::from_account_info(&metadata.to_account_info())?; + let data = &metadata.data.borrow_mut(); + if data.is_empty() || data[0] != mpl_token_metadata::state::Key::MetadataV1 as u8 { + return Err(ErrorCode::InvalidMetadataAccount.into()); + } + let metadata = mpl_token_metadata::state::Metadata::deserialize(&mut data.as_ref())?; // Check, that at least one creator exists in primary sale if !metadata.primary_sale_happened { @@ -59,8 +61,12 @@ impl<'info> InitSellingResource<'info> { } } + let data = &master_edition_info.data.borrow(); + if data.is_empty() || data[0] != mpl_token_metadata::state::Key::MasterEditionV2 as u8 { + return Err(ErrorCode::InvalidMetadataAccount.into()); + } let master_edition = - mpl_token_metadata::state::MasterEditionV2::from_account_info(master_edition_info)?; + mpl_token_metadata::state::MasterEditionV2::deserialize(&mut data.as_ref())?; let mut actual_max_supply = max_supply; diff --git a/fixed-price-sale/program/src/processor/save_primary_metadata_creators.rs b/fixed-price-sale/program/src/processor/save_primary_metadata_creators.rs index a076a824d4..515e06ac69 100644 --- a/fixed-price-sale/program/src/processor/save_primary_metadata_creators.rs +++ b/fixed-price-sale/program/src/processor/save_primary_metadata_creators.rs @@ -1,6 +1,5 @@ use crate::{error::ErrorCode, state::Creator, utils::*, SavePrimaryMetadataCreators}; use anchor_lang::prelude::*; -use mpl_token_metadata::state::TokenMetadataAccount; impl<'info> SavePrimaryMetadataCreators<'info> { pub fn process( @@ -11,8 +10,11 @@ impl<'info> SavePrimaryMetadataCreators<'info> { let metadata = &self.metadata; let admin = &self.admin; let secondary_metadata_creators = &mut self.primary_metadata_creators; - let metadata_state: mpl_token_metadata::state::Metadata = - mpl_token_metadata::state::Metadata::from_account_info(metadata)?; + let data = &metadata.data.borrow_mut(); + if data.is_empty() || data[0] != mpl_token_metadata::state::Key::MetadataV1 as u8 { + return Err(ErrorCode::InvalidMetadataAccount.into()); + } + let metadata_state = mpl_token_metadata::state::Metadata::deserialize(&mut data.as_ref())?; if creators.len() > MAX_PRIMARY_CREATORS_LEN { return Err(ErrorCode::CreatorsIsGtThanAvailable.into()); diff --git a/fixed-price-sale/program/src/processor/withdraw.rs b/fixed-price-sale/program/src/processor/withdraw.rs index 2e6d398e17..4e13d390f8 100644 --- a/fixed-price-sale/program/src/processor/withdraw.rs +++ b/fixed-price-sale/program/src/processor/withdraw.rs @@ -9,7 +9,6 @@ use anchor_spl::{ associated_token::{self, get_associated_token_address}, token, }; -use mpl_token_metadata::state::TokenMetadataAccount; impl<'info> Withdraw<'info> { pub fn process( @@ -59,8 +58,11 @@ impl<'info> Withdraw<'info> { )?; // Obtain right creators according to sale type - let metadata: mpl_token_metadata::state::Metadata = - mpl_token_metadata::state::Metadata::from_account_info(metadata)?; + let data = &metadata.data.borrow_mut(); + if data.is_empty() || data[0] != mpl_token_metadata::state::Key::MetadataV1 as u8 { + return Err(ErrorCode::InvalidMetadataAccount.into()); + } + let metadata = mpl_token_metadata::state::Metadata::deserialize(&mut data.as_ref())?; let actual_creators = if !metadata.primary_sale_happened { if remaining_accounts.is_empty() { return Err(ErrorCode::PrimaryMetadataCreatorsNotProvided.into()); diff --git a/fixed-price-sale/program/tests/buy.rs b/fixed-price-sale/program/tests/buy.rs index 7588584582..aff46b097b 100644 --- a/fixed-price-sale/program/tests/buy.rs +++ b/fixed-price-sale/program/tests/buy.rs @@ -14,7 +14,8 @@ mod buy { }, }; use anchor_lang::{ - error::ERROR_CODE_OFFSET, AccountDeserialize, InstructionData, ToAccountMetas, + error::ERROR_CODE_OFFSET, AccountDeserialize, AnchorDeserialize, InstructionData, + ToAccountMetas, }; use mpl_fixed_price_sale::{ accounts as mpl_fixed_price_sale_accounts, @@ -26,10 +27,7 @@ mod buy { find_vault_owner_address, }, }; - use mpl_token_metadata::{ - instruction::burn_edition_nft, - state::{MasterEditionV2, TokenMetadataAccount}, - }; + use mpl_token_metadata::{instruction::burn_edition_nft, state::MasterEditionV2}; use solana_program::{clock::Clock, instruction::AccountMeta}; use solana_program_test::*; use solana_sdk::{ @@ -4330,7 +4328,7 @@ mod buy { .unwrap() .unwrap(); let master_edition_struct = - MasterEditionV2::safe_deserialize(&master_edition_account.data).unwrap(); + MasterEditionV2::deserialize(&mut master_edition_account.data.as_slice()).unwrap(); assert_eq!(master_edition_struct.supply, 1); @@ -4365,7 +4363,7 @@ mod buy { .unwrap() .unwrap(); let master_edition_struct = - MasterEditionV2::safe_deserialize(&master_edition_account.data).unwrap(); + MasterEditionV2::deserialize(&mut master_edition_account.data.as_slice()).unwrap(); assert_eq!(master_edition_struct.supply, 0); /* BURN ENDED */ diff --git a/fixed-price-sale/program/tests/buy_v2.rs b/fixed-price-sale/program/tests/buy_v2.rs index c5852188b7..329c0d28d6 100644 --- a/fixed-price-sale/program/tests/buy_v2.rs +++ b/fixed-price-sale/program/tests/buy_v2.rs @@ -12,7 +12,7 @@ mod buy_v2 { setup_functions::{setup_selling_resource, setup_store}, }, }; - use anchor_lang::{AccountDeserialize, InstructionData, ToAccountMetas}; + use anchor_lang::{AccountDeserialize, AnchorDeserialize, InstructionData, ToAccountMetas}; use mpl_fixed_price_sale::{ accounts as mpl_fixed_price_sale_accounts, instruction as mpl_fixed_price_sale_instruction, state::{SellingResource, TradeHistory}, @@ -21,10 +21,7 @@ mod buy_v2 { find_vault_owner_address, }, }; - use mpl_token_metadata::{ - instruction::burn_edition_nft, - state::{MasterEditionV2, TokenMetadataAccount}, - }; + use mpl_token_metadata::{instruction::burn_edition_nft, state::MasterEditionV2}; use solana_program::clock::Clock; use solana_program_test::*; use solana_sdk::{ @@ -315,7 +312,7 @@ mod buy_v2 { .unwrap() .unwrap(); let master_edition_struct = - MasterEditionV2::safe_deserialize(&master_edition_account.data).unwrap(); + MasterEditionV2::deserialize(&mut master_edition_account.data.as_slice()).unwrap(); assert_eq!(master_edition_struct.supply, 1); @@ -350,7 +347,7 @@ mod buy_v2 { .unwrap() .unwrap(); let master_edition_struct = - MasterEditionV2::safe_deserialize(&master_edition_account.data).unwrap(); + MasterEditionV2::deserialize(&mut master_edition_account.data.as_slice()).unwrap(); assert_eq!(master_edition_struct.supply, 0); /* BURN ENDED */ diff --git a/gumdrop/program/Cargo.lock b/gumdrop/program/Cargo.lock index 541cb61577..def91d9a8e 100644 --- a/gumdrop/program/Cargo.lock +++ b/gumdrop/program/Cargo.lock @@ -1252,9 +1252,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] diff --git a/hydra/program/Cargo.lock b/hydra/program/Cargo.lock index 9ecec764b8..8b9ec8f5f4 100644 --- a/hydra/program/Cargo.lock +++ b/hydra/program/Cargo.lock @@ -1251,9 +1251,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] diff --git a/hydra/program/src/utils/logic/distribution.rs b/hydra/program/src/utils/logic/distribution.rs index a72bcbb19b..0361a3d4a8 100644 --- a/hydra/program/src/utils/logic/distribution.rs +++ b/hydra/program/src/utils/logic/distribution.rs @@ -80,7 +80,6 @@ pub fn distribute_mint<'info>( let mint = &fanout_mint; let fanout_for_mint_membership_voucher_unchecked = fanout_for_mint_membership_voucher; let fanout_mint_member_token_account_info = fanout_mint_member_token_account.to_account_info(); - let fanout_for_mint = fanout_for_mint; let total_shares = fanout.total_shares as u64; assert_owned_by(fanout_for_mint, &crate::ID)?; assert_owned_by(&fanout_mint_member_token_account_info, &Token::id())?; diff --git a/hydra/program/src/utils/validation/mod.rs b/hydra/program/src/utils/validation/mod.rs index 67c005c412..86f79b0722 100644 --- a/hydra/program/src/utils/validation/mod.rs +++ b/hydra/program/src/utils/validation/mod.rs @@ -117,7 +117,11 @@ pub fn assert_valid_metadata( metadata_account: &AccountInfo, mint: &AccountInfo, ) -> Result { - let meta = Metadata::from_account_info(metadata_account)?; + let data = &metadata_account.data.borrow_mut(); + if data.is_empty() || data[0] != mpl_token_metadata::state::Key::MetadataV1 as u8 { + return Err(HydraError::InvalidMetadata.into()); + } + let meta = mpl_token_metadata::state::Metadata::deserialize(&mut data.as_ref())?; if !cmp_pubkeys(&meta.mint, mint.key) { return Err(HydraError::InvalidMetadata.into()); } diff --git a/test.sh b/test.sh new file mode 100755 index 0000000000..67c847ba67 --- /dev/null +++ b/test.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +function exists_in_list() { + LIST=$1 + DELIMITER=$2 + VALUE=$3 + echo $LIST | tr "$DELIMITER" '\n' | grep -F -q -x "$VALUE" +} + +input=$1 + +programs="auction-house auctioneer candy-machine fixed-price-sale gumdrop hydra token-entangler" + +mkdir -p test-programs + +if exists_in_list "$programs" " " $input; then + echo "testing $input" + cd $input/program + cargo test-bpf --bpf-out-dir ../../test-programs/ + cd ../../ + +elif [[ $input = "all" ]] +then + echo "testing all programs" + for program in ${programs}; do + echo "testing $program" + cd $program/program + cargo test-bpf --bpf-out-dir ../../test-programs/ + cd ../../ + done + #echo "building testing-utils" + #cd core/rust/testing-utils + #cargo build-bpf --bpf-out-dir ../../../test-programs/ + #cd ../../../ +elif [[ $input = "token-auth-rules" ]] +then + solana program dump -u https://api.mainnet-beta.solana.com auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg ./test-programs/mpl_token_auth_rules.so +elif [[ $input = "rooster" ]] +then + solana program dump -u https://api.mainnet-beta.solana.com Roostrnex2Z9Y2XZC49sFAdZARP8E4iFpEnZC5QJWdz ./test-programs/rooster.so +else + echo "Invalid program name: $input" + exit 1 +fi + + diff --git a/token-entangler/program/Cargo.lock b/token-entangler/program/Cargo.lock index 3d800d24cd..f08d43dd47 100644 --- a/token-entangler/program/Cargo.lock +++ b/token-entangler/program/Cargo.lock @@ -103,7 +103,7 @@ checksum = "cf7d535e1381be3de2c0716c0a1c1e32ad9df1042cddcf7bc18d743569e53319" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "regex", "syn 1.0.107", @@ -118,7 +118,7 @@ dependencies = [ "anchor-syn", "anyhow", "bs58 0.4.0", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustversion", "syn 1.0.107", @@ -131,7 +131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1be64a48e395fe00b8217287f226078be2cf32dae42fdf8a885b997945c3d28" dependencies = [ "anchor-syn", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "syn 1.0.107", ] @@ -142,7 +142,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38ea6713d1938c0da03656ff8a693b17dc0396da66d1ba320557f07e86eca0d4" dependencies = [ "anchor-syn", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -155,7 +155,7 @@ checksum = "d401f11efb3644285685f8339829a9786d43ed7490bb1699f33c478d04d5a582" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -169,7 +169,7 @@ dependencies = [ "anchor-syn", "anyhow", "heck 0.3.3", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -182,7 +182,7 @@ checksum = "6ad769993b5266714e8939e47fbdede90e5c030333c7522d99a4d4748cf26712" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -195,7 +195,7 @@ checksum = "4e677fae4a016a554acdd0e3b7f178d3acafaa7e7ffac6b8690cf4e171f1c116" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -208,7 +208,7 @@ checksum = "340beef6809d1c3fcc7ae219153d981e95a8a277ff31985bd7050e32645dc9a8" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -258,7 +258,7 @@ dependencies = [ "anyhow", "bs58 0.3.1", "heck 0.3.3", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "proc-macro2-diagnostics", "quote 1.0.21", "serde", @@ -332,7 +332,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "synstructure", @@ -344,7 +344,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -384,7 +384,7 @@ version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -506,7 +506,7 @@ dependencies = [ "borsh-derive-internal", "borsh-schema-derive-internal", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "syn 1.0.107", ] @@ -516,7 +516,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -527,7 +527,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -596,7 +596,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9e1f5fa78f69496407a27ae9ed989e3c3b072310286f5ef385525e4cbc24a9" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1043,7 +1043,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1119,7 +1119,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c07b7cc9cd8c08d10db74fca3b20949b9b6199725c04a0cce6d543496098fcac" dependencies = [ "enum-ordinalize", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1160,7 +1160,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1173,7 +1173,7 @@ checksum = "2170fc0efee383079a8bdd05d6ea2a184d2a0f07a1c1dcabdb2fd5e9f24bc36c" dependencies = [ "num-bigint 0.4.3", "num-traits", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustc_version", "syn 1.0.107", @@ -1186,7 +1186,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11f36e95862220b211a6e2aa5eca09b4fa391b13cd52ceb8035a24bf65a79de2" dependencies = [ "once_cell", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1316,7 +1316,7 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -1966,7 +1966,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2129,7 +2129,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2202,7 +2202,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ "proc-macro-crate 1.2.1", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2283,7 +2283,7 @@ checksum = "4a0d9d1a6191c4f391f87219d1ea42b23f09ee84d64763cd05ee6ea88d9f384d" dependencies = [ "Inflector", "proc-macro-error", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2399,7 +2399,7 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -2484,7 +2484,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "version_check", @@ -2496,7 +2496,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "version_check", ] @@ -2512,9 +2512,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] @@ -2525,7 +2525,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "version_check", @@ -2609,7 +2609,7 @@ version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", ] [[package]] @@ -2987,7 +2987,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -3055,7 +3055,7 @@ version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -3167,7 +3167,7 @@ version = "0.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63927d22a1e8b74bda98cc6e151fcdf178b7abb0dc6c4f81e0bbf5ffe2fc4ec8" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "shank_macro_impl", "syn 1.0.107", @@ -3180,7 +3180,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ce03403df682f80f4dc1efafa87a4d0cb89b03726d0565e6364bdca5b9a441" dependencies = [ "anyhow", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "serde", "syn 1.0.107", @@ -3555,7 +3555,7 @@ version = "1.14.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be23cc7a382f54dfe1348edb94610e5cc146b8eb21563cdd04062a403c75ba62" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustc_version", "syn 1.0.107", @@ -3894,7 +3894,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d0acbad862093ea123f3a27364336dcb0c8373522cd6810496a34e932c56c1" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustversion", "syn 1.0.107", @@ -4205,7 +4205,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "rustversion", "syn 1.0.107", @@ -4240,7 +4240,7 @@ version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "unicode-ident", ] @@ -4251,7 +4251,7 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "unicode-xid 0.2.4", @@ -4298,7 +4298,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -4356,7 +4356,7 @@ version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -4468,7 +4468,7 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -4590,7 +4590,7 @@ version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", ] @@ -4842,7 +4842,7 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "wasm-bindgen-shared", @@ -4876,7 +4876,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "wasm-bindgen-backend", @@ -5148,7 +5148,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ - "proc-macro2 1.0.50", + "proc-macro2 1.0.60", "quote 1.0.21", "syn 1.0.107", "synstructure", diff --git a/token-entangler/program/src/utils.rs b/token-entangler/program/src/utils.rs index c60bfb8333..e5993bf474 100644 --- a/token-entangler/program/src/utils.rs +++ b/token-entangler/program/src/utils.rs @@ -11,7 +11,7 @@ use anchor_lang::{ }; use anchor_spl::token::Token; use arrayref::array_ref; -use mpl_token_metadata::state::{Metadata, TokenMetadataAccount}; +use mpl_token_metadata::state::Metadata; use spl_associated_token_account::get_associated_token_address; use spl_token::{instruction::initialize_account2, state::Account}; use std::{convert::TryInto, slice::Iter}; @@ -191,7 +191,15 @@ pub fn pay_creator_fees<'a>( size: u64, is_native: bool, ) -> Result<()> { - let metadata = Metadata::from_account_info(metadata_info)?; + let metadata = { + let data = &metadata_info.data.borrow(); + if metadata_info.data_is_empty() + || data[0] != mpl_token_metadata::state::Key::MetadataV1 as u8 + { + return Err(ErrorCode::MetadataDoesntExist.into()); + } + Metadata::deserialize(&mut data.as_ref())? + }; let total_fee = size as u128; match metadata.data.creators { Some(creators) => {