diff --git a/.gitignore b/.gitignore index a7386df8..4aabe5e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target /lints/*/ui/*/Cargo.lock +/lints/*/target_* diff --git a/Cargo.lock b/Cargo.lock index 582910d7..fb2feac3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "anchor-syn" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" +checksum = "f99daacb53b55cfd37ce14d6c9905929721137fd4c67bbab44a19802aecb622f" dependencies = [ "anyhow", "bs58", diff --git a/crate/Cargo.toml b/crate/Cargo.toml index 5d7435e3..a6c7ddfa 100644 --- a/crate/Cargo.toml +++ b/crate/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -anchor-syn = "0.29.0" +anchor-syn = "0.30.0" clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "ac4c2094a6030530661bee3876e0228ddfeb6b8b" } if_chain = "1.0" syn = { version = "1.0.109", features = ["parsing"] } diff --git a/crate/diffs/insecure_account_close.diff b/crate/diffs/insecure_account_close.diff index 6b00bb06..576f0798 100644 --- a/crate/diffs/insecure_account_close.diff +++ b/crate/diffs/insecure_account_close.diff @@ -38,7 +38,20 @@ diff -r -x Cargo.lock ./insecure-still-still/Cargo.toml ../../../../lints/insecu diff -r -x Cargo.lock ./insecure-still-still/src/lib.rs ../../../../lints/insecure_account_close/ui/insecure-still-still/src/lib.rs 1a2 > use anchor_lang::solana_program::entrypoint::ProgramResult; -45a47,49 +6a8,11 +> // S3v3ru5: Anchor does not use CLOSED_ACCOUNT_DISCRIMINATOR from v0.30 +> // ref: https://github.com/coral-xyz/anchor/pull/2726 +> pub const CLOSED_ACCOUNT_DISCRIMINATOR: [u8; 8] = [255, 255, 255, 255, 255, 255, 255, 255]; +> +25d29 +< +28,30c32 +< cursor +< .write_all(&anchor_lang::__private::CLOSED_ACCOUNT_DISCRIMINATOR) +< .unwrap(); +--- +> cursor.write_all(&CLOSED_ACCOUNT_DISCRIMINATOR).unwrap(); +45a48,50 > > #[allow(dead_code)] > fn main() {} @@ -68,9 +81,16 @@ diff -r -x Cargo.lock ./secure/Cargo.toml ../../../../lints/insecure_account_clo > > [workspace] diff -r -x Cargo.lock ./secure/src/lib.rs ../../../../lints/insecure_account_close/ui/secure/src/lib.rs -2a3 +1d0 +< use anchor_lang::__private::CLOSED_ACCOUNT_DISCRIMINATOR; +2a2 > use anchor_lang::solana_program::entrypoint::ProgramResult; -71a73,75 +7a8,11 +> // S3v3ru5: Anchor does not use CLOSED_ACCOUNT_DISCRIMINATOR from v0.30 +> // ref: https://github.com/coral-xyz/anchor/pull/2726 +> pub const CLOSED_ACCOUNT_DISCRIMINATOR: [u8; 8] = [255, 255, 255, 255, 255, 255, 255, 255]; +> +71a76,78 > > #[allow(dead_code)] > fn main() {} diff --git a/crate/src/lib.rs b/crate/src/lib.rs index 7b3f02bb..517350b2 100644 --- a/crate/src/lib.rs +++ b/crate/src/lib.rs @@ -11,3 +11,6 @@ extern crate rustc_driver; pub mod paths; pub mod utils; + +pub use anchor_syn; +pub use syn; diff --git a/lints/arbitrary_cpi/Cargo.lock b/lints/arbitrary_cpi/Cargo.lock index a0a61c37..52f1d993 100644 --- a/lints/arbitrary_cpi/Cargo.lock +++ b/lints/arbitrary_cpi/Cargo.lock @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" +checksum = "47fe28365b33e8334dd70ae2f34a43892363012fe239cf37d2ee91693575b1f8" dependencies = [ "anchor-syn", "proc-macro2", @@ -84,9 +84,9 @@ dependencies = [ [[package]] name = "anchor-attribute-account" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" +checksum = "3c288d496168268d198d9b53ee9f4f9d260a55ba4df9877ea1d4486ad6109e0f" dependencies = [ "anchor-syn", "bs58 0.5.0", @@ -97,9 +97,9 @@ dependencies = [ [[package]] name = "anchor-attribute-constant" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" +checksum = "49b77b6948d0eeaaa129ce79eea5bbbb9937375a9241d909ca8fb9e006bb6e90" dependencies = [ "anchor-syn", "quote", @@ -108,9 +108,9 @@ dependencies = [ [[package]] name = "anchor-attribute-error" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" +checksum = "4d20bb569c5a557c86101b944721d865e1fd0a4c67c381d31a44a84f07f84828" dependencies = [ "anchor-syn", "quote", @@ -119,9 +119,9 @@ dependencies = [ [[package]] name = "anchor-attribute-event" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" +checksum = "4cebd8d0671a3a9dc3160c48598d652c34c77de6be4d44345b8b514323284d57" dependencies = [ "anchor-syn", "proc-macro2", @@ -131,20 +131,26 @@ dependencies = [ [[package]] name = "anchor-attribute-program" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" +checksum = "efb2a5eb0860e661ab31aff7bb5e0288357b176380e985bade4ccb395981b42d" dependencies = [ + "anchor-lang-idl", "anchor-syn", + "anyhow", + "bs58 0.5.0", + "heck", + "proc-macro2", "quote", + "serde_json", "syn 1.0.109", ] [[package]] name = "anchor-derive-accounts" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" +checksum = "04368b5abef4266250ca8d1d12f4dff860242681e4ec22b885dcfe354fd35aa1" dependencies = [ "anchor-syn", "quote", @@ -153,9 +159,9 @@ dependencies = [ [[package]] name = "anchor-derive-serde" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +checksum = "e0bb0e0911ad4a70cab880cdd6287fe1e880a1a9d8e4e6defa8e9044b9796a6c" dependencies = [ "anchor-syn", "borsh-derive-internal 0.10.3", @@ -166,9 +172,9 @@ dependencies = [ [[package]] name = "anchor-derive-space" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" +checksum = "5ef415ff156dc82e9ecb943189b0cb241b3a6bfc26a180234dc21bd3ef3ce0cb" dependencies = [ "proc-macro2", "quote", @@ -177,9 +183,9 @@ dependencies = [ [[package]] name = "anchor-lang" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" +checksum = "6620c9486d9d36a4389cab5e37dc34a42ed0bfaa62e6a75a2999ce98f8f2e373" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -191,7 +197,7 @@ dependencies = [ "anchor-derive-serde", "anchor-derive-space", "arrayref", - "base64 0.13.1", + "base64 0.21.7", "bincode", "borsh 0.10.3", "bytemuck", @@ -200,24 +206,50 @@ dependencies = [ "thiserror", ] +[[package]] +name = "anchor-lang-idl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31cf97b4e6f7d6144a05e435660fcf757dbc3446d38d0e2b851d11ed13625bba" +dependencies = [ + "anchor-lang-idl-spec", + "anyhow", + "heck", + "serde", + "serde_json", + "sha2 0.10.8", +] + +[[package]] +name = "anchor-lang-idl-spec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdf143115440fe621bdac3a29a1f7472e09f6cd82b2aa569429a0c13f103838" +dependencies = [ + "anyhow", + "serde", +] + [[package]] name = "anchor-spl" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" +checksum = "04bd077c34449319a1e4e0bc21cea572960c9ae0d0fefda0dd7c52fcc3c647a3" dependencies = [ "anchor-lang", - "solana-program", "spl-associated-token-account", + "spl-pod", "spl-token", - "spl-token-2022 0.9.0", + "spl-token-2022", + "spl-token-group-interface", + "spl-token-metadata-interface", ] [[package]] name = "anchor-syn" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" +checksum = "f99daacb53b55cfd37ce14d6c9905929721137fd4c67bbab44a19802aecb622f" dependencies = [ "anyhow", "bs58 0.5.0", @@ -417,12 +449,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -658,9 +684,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.14.1" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" dependencies = [ "bytemuck_derive", ] @@ -2375,9 +2401,9 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "solana-frozen-abi" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b24a0e5179387f145afba79d72b27db817cecf1b9494f7cd55d42aa986ed3141" +checksum = "4867f66e9527fa44451c861c1dc6d9b2a7c7a668d7c6a297cdefbe39f4395b33" dependencies = [ "block-buffer 0.10.4", "bs58 0.4.0", @@ -2400,9 +2426,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92970a9898903eb1433d42f53ca4e8f497bc05382b7bc170ea81d4d3c6ff5d58" +checksum = "168f24d97347b85f05192df58d6be3e3047a4aadc4001bc1b9e711a5ec878eea" dependencies = [ "proc-macro2", "quote", @@ -2422,9 +2448,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea25cdb22fe3dfed39a9ef59b836153d226fb9e3984a1f5b6134061bfa94528" +checksum = "a0511082fc62f2d086520fff5aa1917c389d8c840930c08ad255ae05952c08a2" dependencies = [ "env_logger 0.9.3", "lazy_static", @@ -2433,9 +2459,9 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ce0a1f4487b0b9e5e53610e8c17e558d17069145281aaae9f825bfef84b16e" +checksum = "2bc5a636dc75e5c25651e34f7a36afc9ae60d38166687c5b0375abb580ac81a2" dependencies = [ "ark-bn254", "ark-ec", @@ -2488,9 +2514,9 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90134b382769b2e7a1d87ae97d6242f1b7ce237591e06520641ad6e2df07653c" +checksum = "df43d3a1e1637397ab43cbc216a5a8f977ec8a3cc3f3ae8c3851c83a3255dbcf" dependencies = [ "assert_matches", "base64 0.21.7", @@ -2543,9 +2569,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e3cdf8616a66e99343c3f99c39f311b4dc3e13977a4c96d7bbaa82dffd2fc5" +checksum = "86c76414183a325038ff020b22c07d1e9d2da0703ddc0244acfed37ee2921d96" dependencies = [ "bs58 0.4.0", "proc-macro2", @@ -2562,9 +2588,9 @@ checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" [[package]] name = "solana-zk-token-sdk" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29693ea4eac0f076b9beb54db7c11d0220b110620aeee56a32ff2a49a170ebe8" +checksum = "513407f88394e437b4ff5aad892bc5bf51a655ae2401e6e63549734d3695c46f" dependencies = [ "aes-gcm-siv", "base64 0.21.7", @@ -2591,25 +2617,25 @@ dependencies = [ [[package]] name = "spl-associated-token-account" -version = "2.3.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "992d9c64c2564cc8f63a4b508bf3ebcdf2254b0429b13cd1d31adb6162432a5f" +checksum = "a2e688554bac5838217ffd1fab7845c573ff106b6336bf7d290db7c98d5a8efd" dependencies = [ "assert_matches", - "borsh 0.10.3", + "borsh 1.3.1", "num-derive", "num-traits", "solana-program", "spl-token", - "spl-token-2022 1.0.0", + "spl-token-2022", "thiserror", ] [[package]] name = "spl-discriminator" -version = "0.1.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa600f2fe56f32e923261719bae640d873edadbc5237681a39b8e37bfd4d263" +checksum = "34d1814406e98b08c5cd02c1126f83fd407ad084adce0b05fda5730677822eac" dependencies = [ "bytemuck", "solana-program", @@ -2618,9 +2644,9 @@ dependencies = [ [[package]] name = "spl-discriminator-derive" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" +checksum = "d9e8418ea6269dcfb01c712f0444d2c75542c04448b480e87de59d2865edc750" dependencies = [ "quote", "spl-discriminator-syn", @@ -2629,9 +2655,9 @@ dependencies = [ [[package]] name = "spl-discriminator-syn" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fea7be851bd98d10721782ea958097c03a0c2a07d8d4997041d0ece6319a63" +checksum = "8c1f05593b7ca9eac7caca309720f2eafb96355e037e6d373b909a80fe7b69b9" dependencies = [ "proc-macro2", "quote", @@ -2651,11 +2677,11 @@ dependencies = [ [[package]] name = "spl-pod" -version = "0.1.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85a5db7e4efb1107b0b8e52a13f035437cdcb36ef99c58f6d467f089d9b2915a" +checksum = "046ce669f48cf2eca1ec518916d8725596bfb655beb1c74374cf71dc6cb773c9" dependencies = [ - "borsh 0.10.3", + "borsh 1.3.1", "bytemuck", "solana-program", "solana-zk-token-sdk", @@ -2664,9 +2690,9 @@ dependencies = [ [[package]] name = "spl-program-error" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0657b6490196971d9e729520ba934911ff41fbb2cb9004463dbe23cf8b4b4f" +checksum = "49065093ea91f57b9b2bd81493ff705e2ad4e64507a07dbc02b085778e02770e" dependencies = [ "num-derive", "num-traits", @@ -2677,9 +2703,9 @@ dependencies = [ [[package]] name = "spl-program-error-derive" -version = "0.3.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1845dfe71fd68f70382232742e758557afe973ae19e6c06807b2c30f5d5cb474" +checksum = "e6d375dd76c517836353e093c2dbb490938ff72821ab568b545fd30ab3256b3e" dependencies = [ "proc-macro2", "quote", @@ -2689,23 +2715,9 @@ dependencies = [ [[package]] name = "spl-tlv-account-resolution" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" -dependencies = [ - "bytemuck", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", - "spl-type-length-value", -] - -[[package]] -name = "spl-tlv-account-resolution" -version = "0.5.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f335787add7fa711819f9e7c573f8145a5358a709446fe2d24bf2a88117c90" +checksum = "cace91ba08984a41556efe49cbf2edca4db2f577b649da7827d3621161784bf8" dependencies = [ "bytemuck", "solana-program", @@ -2732,31 +2744,9 @@ dependencies = [ [[package]] name = "spl-token-2022" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" -dependencies = [ - "arrayref", - "bytemuck", - "num-derive", - "num-traits", - "num_enum", - "solana-program", - "solana-zk-token-sdk", - "spl-memo", - "spl-pod", - "spl-token", - "spl-token-metadata-interface", - "spl-transfer-hook-interface 0.3.0", - "spl-type-length-value", - "thiserror", -] - -[[package]] -name = "spl-token-2022" -version = "1.0.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d697fac19fd74ff472dfcc13f0b442dd71403178ce1de7b5d16f83a33561c059" +checksum = "e5412f99ae7ee6e0afde00defaa354e6228e47e30c0e3adf553e2e01e6abb584" dependencies = [ "arrayref", "bytemuck", @@ -2771,16 +2761,16 @@ dependencies = [ "spl-token", "spl-token-group-interface", "spl-token-metadata-interface", - "spl-transfer-hook-interface 0.4.1", + "spl-transfer-hook-interface", "spl-type-length-value", "thiserror", ] [[package]] name = "spl-token-group-interface" -version = "0.1.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb67fbacd587377a400aba81718abe4424d0e9d5ea510034d3b7f130d102153" +checksum = "d419b5cfa3ee8e0f2386fd7e02a33b3ec8a7db4a9c7064a2ea24849dc4a273b6" dependencies = [ "bytemuck", "solana-program", @@ -2791,39 +2781,23 @@ dependencies = [ [[package]] name = "spl-token-metadata-interface" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16aa8f64b6e0eaab3f5034e84d867c8435d8216497b4543a4978a31f4b6e8a8" -dependencies = [ - "borsh 0.10.3", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", - "spl-type-length-value", -] - -[[package]] -name = "spl-transfer-hook-interface" -version = "0.3.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" +checksum = "30179c47e93625680dabb620c6e7931bd12d62af390f447bc7beb4a3a9b5feee" dependencies = [ - "arrayref", - "bytemuck", + "borsh 1.3.1", "solana-program", "spl-discriminator", "spl-pod", "spl-program-error", - "spl-tlv-account-resolution 0.4.0", "spl-type-length-value", ] [[package]] name = "spl-transfer-hook-interface" -version = "0.4.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aabdb7c471566f6ddcee724beb8618449ea24b399e58d464d6b5bc7db550259" +checksum = "66a98359769cd988f7b35c02558daa56d496a7e3bd8626e61f90a7c757eedb9b" dependencies = [ "arrayref", "bytemuck", @@ -2831,15 +2805,15 @@ dependencies = [ "spl-discriminator", "spl-pod", "spl-program-error", - "spl-tlv-account-resolution 0.5.2", + "spl-tlv-account-resolution", "spl-type-length-value", ] [[package]] name = "spl-type-length-value" -version = "0.3.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f9ebd75d29c5f48de5f6a9c114e08531030b75b8ac2c557600ac7da0b73b1e8" +checksum = "422ce13429dbd41d2cee8a73931c05fda0b0c8ca156a8b0c19445642550bb61a" dependencies = [ "bytemuck", "solana-program", diff --git a/lints/arbitrary_cpi/Cargo.toml b/lints/arbitrary_cpi/Cargo.toml index 82caf051..111df27f 100644 --- a/lints/arbitrary_cpi/Cargo.toml +++ b/lints/arbitrary_cpi/Cargo.toml @@ -32,8 +32,8 @@ if_chain = "1.0" solana-lints = { path = "../../crate" } [dev-dependencies] -anchor-lang = "0.29" -anchor-spl = "0.29" +anchor-lang = "0.30" +anchor-spl = "0.30" dylint_testing = "2.6" [workspace] diff --git a/lints/bump_seed_canonicalization/Cargo.lock b/lints/bump_seed_canonicalization/Cargo.lock index f060ec72..dfcb2fe0 100644 --- a/lints/bump_seed_canonicalization/Cargo.lock +++ b/lints/bump_seed_canonicalization/Cargo.lock @@ -36,9 +36,9 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" +checksum = "47fe28365b33e8334dd70ae2f34a43892363012fe239cf37d2ee91693575b1f8" dependencies = [ "anchor-syn", "proc-macro2", @@ -48,9 +48,9 @@ dependencies = [ [[package]] name = "anchor-attribute-account" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" +checksum = "3c288d496168268d198d9b53ee9f4f9d260a55ba4df9877ea1d4486ad6109e0f" dependencies = [ "anchor-syn", "bs58 0.5.0", @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "anchor-attribute-constant" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" +checksum = "49b77b6948d0eeaaa129ce79eea5bbbb9937375a9241d909ca8fb9e006bb6e90" dependencies = [ "anchor-syn", "quote", @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "anchor-attribute-error" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" +checksum = "4d20bb569c5a557c86101b944721d865e1fd0a4c67c381d31a44a84f07f84828" dependencies = [ "anchor-syn", "quote", @@ -83,9 +83,9 @@ dependencies = [ [[package]] name = "anchor-attribute-event" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" +checksum = "4cebd8d0671a3a9dc3160c48598d652c34c77de6be4d44345b8b514323284d57" dependencies = [ "anchor-syn", "proc-macro2", @@ -95,20 +95,26 @@ dependencies = [ [[package]] name = "anchor-attribute-program" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" +checksum = "efb2a5eb0860e661ab31aff7bb5e0288357b176380e985bade4ccb395981b42d" dependencies = [ + "anchor-lang-idl", "anchor-syn", + "anyhow", + "bs58 0.5.0", + "heck", + "proc-macro2", "quote", + "serde_json", "syn 1.0.109", ] [[package]] name = "anchor-derive-accounts" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" +checksum = "04368b5abef4266250ca8d1d12f4dff860242681e4ec22b885dcfe354fd35aa1" dependencies = [ "anchor-syn", "quote", @@ -117,9 +123,9 @@ dependencies = [ [[package]] name = "anchor-derive-serde" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +checksum = "e0bb0e0911ad4a70cab880cdd6287fe1e880a1a9d8e4e6defa8e9044b9796a6c" dependencies = [ "anchor-syn", "borsh-derive-internal 0.10.3", @@ -130,9 +136,9 @@ dependencies = [ [[package]] name = "anchor-derive-space" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" +checksum = "5ef415ff156dc82e9ecb943189b0cb241b3a6bfc26a180234dc21bd3ef3ce0cb" dependencies = [ "proc-macro2", "quote", @@ -141,9 +147,9 @@ dependencies = [ [[package]] name = "anchor-lang" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" +checksum = "6620c9486d9d36a4389cab5e37dc34a42ed0bfaa62e6a75a2999ce98f8f2e373" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -155,7 +161,7 @@ dependencies = [ "anchor-derive-serde", "anchor-derive-space", "arrayref", - "base64 0.13.1", + "base64 0.21.7", "bincode", "borsh 0.10.3", "bytemuck", @@ -164,11 +170,35 @@ dependencies = [ "thiserror", ] +[[package]] +name = "anchor-lang-idl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31cf97b4e6f7d6144a05e435660fcf757dbc3446d38d0e2b851d11ed13625bba" +dependencies = [ + "anchor-lang-idl-spec", + "anyhow", + "heck", + "serde", + "serde_json", + "sha2 0.10.8", +] + +[[package]] +name = "anchor-lang-idl-spec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdf143115440fe621bdac3a29a1f7472e09f6cd82b2aa569429a0c13f103838" +dependencies = [ + "anyhow", + "serde", +] + [[package]] name = "anchor-syn" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" +checksum = "f99daacb53b55cfd37ce14d6c9905929721137fd4c67bbab44a19802aecb622f" dependencies = [ "anyhow", "bs58 0.5.0", @@ -338,12 +368,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" diff --git a/lints/bump_seed_canonicalization/Cargo.toml b/lints/bump_seed_canonicalization/Cargo.toml index 458172fe..8ed77da2 100644 --- a/lints/bump_seed_canonicalization/Cargo.toml +++ b/lints/bump_seed_canonicalization/Cargo.toml @@ -36,7 +36,7 @@ if_chain = "1.0" solana-lints = { path = "../../crate" } [dev-dependencies] -anchor-lang = "0.29" +anchor-lang = "0.30" dylint_testing = "2.6" [workspace] diff --git a/lints/insecure_account_close/Cargo.lock b/lints/insecure_account_close/Cargo.lock index 1480c355..68884611 100644 --- a/lints/insecure_account_close/Cargo.lock +++ b/lints/insecure_account_close/Cargo.lock @@ -36,9 +36,9 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" +checksum = "47fe28365b33e8334dd70ae2f34a43892363012fe239cf37d2ee91693575b1f8" dependencies = [ "anchor-syn", "proc-macro2", @@ -48,9 +48,9 @@ dependencies = [ [[package]] name = "anchor-attribute-account" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" +checksum = "3c288d496168268d198d9b53ee9f4f9d260a55ba4df9877ea1d4486ad6109e0f" dependencies = [ "anchor-syn", "bs58 0.5.0", @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "anchor-attribute-constant" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" +checksum = "49b77b6948d0eeaaa129ce79eea5bbbb9937375a9241d909ca8fb9e006bb6e90" dependencies = [ "anchor-syn", "quote", @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "anchor-attribute-error" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" +checksum = "4d20bb569c5a557c86101b944721d865e1fd0a4c67c381d31a44a84f07f84828" dependencies = [ "anchor-syn", "quote", @@ -83,9 +83,9 @@ dependencies = [ [[package]] name = "anchor-attribute-event" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" +checksum = "4cebd8d0671a3a9dc3160c48598d652c34c77de6be4d44345b8b514323284d57" dependencies = [ "anchor-syn", "proc-macro2", @@ -95,20 +95,26 @@ dependencies = [ [[package]] name = "anchor-attribute-program" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" +checksum = "efb2a5eb0860e661ab31aff7bb5e0288357b176380e985bade4ccb395981b42d" dependencies = [ + "anchor-lang-idl", "anchor-syn", + "anyhow", + "bs58 0.5.0", + "heck", + "proc-macro2", "quote", + "serde_json", "syn 1.0.109", ] [[package]] name = "anchor-derive-accounts" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" +checksum = "04368b5abef4266250ca8d1d12f4dff860242681e4ec22b885dcfe354fd35aa1" dependencies = [ "anchor-syn", "quote", @@ -117,9 +123,9 @@ dependencies = [ [[package]] name = "anchor-derive-serde" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +checksum = "e0bb0e0911ad4a70cab880cdd6287fe1e880a1a9d8e4e6defa8e9044b9796a6c" dependencies = [ "anchor-syn", "borsh-derive-internal 0.10.3", @@ -130,9 +136,9 @@ dependencies = [ [[package]] name = "anchor-derive-space" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" +checksum = "5ef415ff156dc82e9ecb943189b0cb241b3a6bfc26a180234dc21bd3ef3ce0cb" dependencies = [ "proc-macro2", "quote", @@ -141,9 +147,9 @@ dependencies = [ [[package]] name = "anchor-lang" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" +checksum = "6620c9486d9d36a4389cab5e37dc34a42ed0bfaa62e6a75a2999ce98f8f2e373" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -155,7 +161,7 @@ dependencies = [ "anchor-derive-serde", "anchor-derive-space", "arrayref", - "base64 0.13.1", + "base64 0.21.7", "bincode", "borsh 0.10.3", "bytemuck", @@ -164,11 +170,35 @@ dependencies = [ "thiserror", ] +[[package]] +name = "anchor-lang-idl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31cf97b4e6f7d6144a05e435660fcf757dbc3446d38d0e2b851d11ed13625bba" +dependencies = [ + "anchor-lang-idl-spec", + "anyhow", + "heck", + "serde", + "serde_json", + "sha2 0.10.8", +] + +[[package]] +name = "anchor-lang-idl-spec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdf143115440fe621bdac3a29a1f7472e09f6cd82b2aa569429a0c13f103838" +dependencies = [ + "anyhow", + "serde", +] + [[package]] name = "anchor-syn" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" +checksum = "f99daacb53b55cfd37ce14d6c9905929721137fd4c67bbab44a19802aecb622f" dependencies = [ "anyhow", "bs58 0.5.0", @@ -338,12 +368,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" diff --git a/lints/insecure_account_close/Cargo.toml b/lints/insecure_account_close/Cargo.toml index 3967ee23..a0a094da 100644 --- a/lints/insecure_account_close/Cargo.toml +++ b/lints/insecure_account_close/Cargo.toml @@ -36,7 +36,7 @@ if_chain = "1.0" solana-lints = { path = "../../crate" } [dev-dependencies] -anchor-lang = "0.29" +anchor-lang = "0.30" dylint_testing = "2.6" [workspace] diff --git a/lints/insecure_account_close/ui/insecure-still-still/src/lib.rs b/lints/insecure_account_close/ui/insecure-still-still/src/lib.rs index 7a048d10..e46f7269 100644 --- a/lints/insecure_account_close/ui/insecure-still-still/src/lib.rs +++ b/lints/insecure_account_close/ui/insecure-still-still/src/lib.rs @@ -5,6 +5,10 @@ use std::ops::DerefMut; declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"); +// S3v3ru5: Anchor does not use CLOSED_ACCOUNT_DISCRIMINATOR from v0.30 +// ref: https://github.com/coral-xyz/anchor/pull/2726 +pub const CLOSED_ACCOUNT_DISCRIMINATOR: [u8; 8] = [255, 255, 255, 255, 255, 255, 255, 255]; + #[program] pub mod closing_accounts_insecure_still_still { use super::*; @@ -23,12 +27,9 @@ pub mod closing_accounts_insecure_still_still { for byte in data.deref_mut().iter_mut() { *byte = 0; } - let dst: &mut [u8] = &mut data; let mut cursor = std::io::Cursor::new(dst); - cursor - .write_all(&anchor_lang::__private::CLOSED_ACCOUNT_DISCRIMINATOR) - .unwrap(); + cursor.write_all(&CLOSED_ACCOUNT_DISCRIMINATOR).unwrap(); Ok(()) } diff --git a/lints/insecure_account_close/ui/secure/src/lib.rs b/lints/insecure_account_close/ui/secure/src/lib.rs index deaabc0a..7351b106 100644 --- a/lints/insecure_account_close/ui/secure/src/lib.rs +++ b/lints/insecure_account_close/ui/secure/src/lib.rs @@ -1,4 +1,3 @@ -use anchor_lang::__private::CLOSED_ACCOUNT_DISCRIMINATOR; use anchor_lang::prelude::*; use anchor_lang::solana_program::entrypoint::ProgramResult; use std::io::{Cursor, Write}; @@ -6,6 +5,10 @@ use std::ops::DerefMut; declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"); +// S3v3ru5: Anchor does not use CLOSED_ACCOUNT_DISCRIMINATOR from v0.30 +// ref: https://github.com/coral-xyz/anchor/pull/2726 +pub const CLOSED_ACCOUNT_DISCRIMINATOR: [u8; 8] = [255, 255, 255, 255, 255, 255, 255, 255]; + #[program] pub mod closing_accounts_secure { use super::*; diff --git a/lints/missing_owner_check/Cargo.lock b/lints/missing_owner_check/Cargo.lock index 34a65c16..d9ea911c 100644 --- a/lints/missing_owner_check/Cargo.lock +++ b/lints/missing_owner_check/Cargo.lock @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" +checksum = "47fe28365b33e8334dd70ae2f34a43892363012fe239cf37d2ee91693575b1f8" dependencies = [ "anchor-syn", "proc-macro2", @@ -84,9 +84,9 @@ dependencies = [ [[package]] name = "anchor-attribute-account" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" +checksum = "3c288d496168268d198d9b53ee9f4f9d260a55ba4df9877ea1d4486ad6109e0f" dependencies = [ "anchor-syn", "bs58 0.5.0", @@ -97,9 +97,9 @@ dependencies = [ [[package]] name = "anchor-attribute-constant" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" +checksum = "49b77b6948d0eeaaa129ce79eea5bbbb9937375a9241d909ca8fb9e006bb6e90" dependencies = [ "anchor-syn", "quote", @@ -108,9 +108,9 @@ dependencies = [ [[package]] name = "anchor-attribute-error" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" +checksum = "4d20bb569c5a557c86101b944721d865e1fd0a4c67c381d31a44a84f07f84828" dependencies = [ "anchor-syn", "quote", @@ -119,9 +119,9 @@ dependencies = [ [[package]] name = "anchor-attribute-event" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" +checksum = "4cebd8d0671a3a9dc3160c48598d652c34c77de6be4d44345b8b514323284d57" dependencies = [ "anchor-syn", "proc-macro2", @@ -131,20 +131,26 @@ dependencies = [ [[package]] name = "anchor-attribute-program" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" +checksum = "efb2a5eb0860e661ab31aff7bb5e0288357b176380e985bade4ccb395981b42d" dependencies = [ + "anchor-lang-idl", "anchor-syn", + "anyhow", + "bs58 0.5.0", + "heck", + "proc-macro2", "quote", + "serde_json", "syn 1.0.109", ] [[package]] name = "anchor-derive-accounts" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" +checksum = "04368b5abef4266250ca8d1d12f4dff860242681e4ec22b885dcfe354fd35aa1" dependencies = [ "anchor-syn", "quote", @@ -153,9 +159,9 @@ dependencies = [ [[package]] name = "anchor-derive-serde" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +checksum = "e0bb0e0911ad4a70cab880cdd6287fe1e880a1a9d8e4e6defa8e9044b9796a6c" dependencies = [ "anchor-syn", "borsh-derive-internal 0.10.3", @@ -166,9 +172,9 @@ dependencies = [ [[package]] name = "anchor-derive-space" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" +checksum = "5ef415ff156dc82e9ecb943189b0cb241b3a6bfc26a180234dc21bd3ef3ce0cb" dependencies = [ "proc-macro2", "quote", @@ -177,9 +183,9 @@ dependencies = [ [[package]] name = "anchor-lang" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" +checksum = "6620c9486d9d36a4389cab5e37dc34a42ed0bfaa62e6a75a2999ce98f8f2e373" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -191,7 +197,7 @@ dependencies = [ "anchor-derive-serde", "anchor-derive-space", "arrayref", - "base64 0.13.1", + "base64 0.21.7", "bincode", "borsh 0.10.3", "bytemuck", @@ -200,24 +206,50 @@ dependencies = [ "thiserror", ] +[[package]] +name = "anchor-lang-idl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31cf97b4e6f7d6144a05e435660fcf757dbc3446d38d0e2b851d11ed13625bba" +dependencies = [ + "anchor-lang-idl-spec", + "anyhow", + "heck", + "serde", + "serde_json", + "sha2 0.10.8", +] + +[[package]] +name = "anchor-lang-idl-spec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdf143115440fe621bdac3a29a1f7472e09f6cd82b2aa569429a0c13f103838" +dependencies = [ + "anyhow", + "serde", +] + [[package]] name = "anchor-spl" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" +checksum = "04bd077c34449319a1e4e0bc21cea572960c9ae0d0fefda0dd7c52fcc3c647a3" dependencies = [ "anchor-lang", - "solana-program", "spl-associated-token-account", + "spl-pod", "spl-token", - "spl-token-2022 0.9.0", + "spl-token-2022", + "spl-token-group-interface", + "spl-token-metadata-interface", ] [[package]] name = "anchor-syn" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" +checksum = "f99daacb53b55cfd37ce14d6c9905929721137fd4c67bbab44a19802aecb622f" dependencies = [ "anyhow", "bs58 0.5.0", @@ -404,12 +436,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -645,9 +671,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.14.1" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" dependencies = [ "bytemuck_derive", ] @@ -1682,13 +1708,11 @@ version = "0.1.0" dependencies = [ "anchor-lang", "anchor-spl", - "anchor-syn", "clippy_utils", "dylint_linting", "dylint_testing", "if_chain", "solana-lints", - "syn 1.0.109", ] [[package]] @@ -2377,9 +2401,9 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "solana-frozen-abi" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b24a0e5179387f145afba79d72b27db817cecf1b9494f7cd55d42aa986ed3141" +checksum = "4867f66e9527fa44451c861c1dc6d9b2a7c7a668d7c6a297cdefbe39f4395b33" dependencies = [ "block-buffer 0.10.4", "bs58 0.4.0", @@ -2402,9 +2426,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92970a9898903eb1433d42f53ca4e8f497bc05382b7bc170ea81d4d3c6ff5d58" +checksum = "168f24d97347b85f05192df58d6be3e3047a4aadc4001bc1b9e711a5ec878eea" dependencies = [ "proc-macro2", "quote", @@ -2424,9 +2448,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea25cdb22fe3dfed39a9ef59b836153d226fb9e3984a1f5b6134061bfa94528" +checksum = "a0511082fc62f2d086520fff5aa1917c389d8c840930c08ad255ae05952c08a2" dependencies = [ "env_logger 0.9.3", "lazy_static", @@ -2435,9 +2459,9 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ce0a1f4487b0b9e5e53610e8c17e558d17069145281aaae9f825bfef84b16e" +checksum = "2bc5a636dc75e5c25651e34f7a36afc9ae60d38166687c5b0375abb580ac81a2" dependencies = [ "ark-bn254", "ark-ec", @@ -2490,9 +2514,9 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90134b382769b2e7a1d87ae97d6242f1b7ce237591e06520641ad6e2df07653c" +checksum = "df43d3a1e1637397ab43cbc216a5a8f977ec8a3cc3f3ae8c3851c83a3255dbcf" dependencies = [ "assert_matches", "base64 0.21.7", @@ -2545,9 +2569,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e3cdf8616a66e99343c3f99c39f311b4dc3e13977a4c96d7bbaa82dffd2fc5" +checksum = "86c76414183a325038ff020b22c07d1e9d2da0703ddc0244acfed37ee2921d96" dependencies = [ "bs58 0.4.0", "proc-macro2", @@ -2564,9 +2588,9 @@ checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" [[package]] name = "solana-zk-token-sdk" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29693ea4eac0f076b9beb54db7c11d0220b110620aeee56a32ff2a49a170ebe8" +checksum = "513407f88394e437b4ff5aad892bc5bf51a655ae2401e6e63549734d3695c46f" dependencies = [ "aes-gcm-siv", "base64 0.21.7", @@ -2593,25 +2617,25 @@ dependencies = [ [[package]] name = "spl-associated-token-account" -version = "2.3.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "992d9c64c2564cc8f63a4b508bf3ebcdf2254b0429b13cd1d31adb6162432a5f" +checksum = "a2e688554bac5838217ffd1fab7845c573ff106b6336bf7d290db7c98d5a8efd" dependencies = [ "assert_matches", - "borsh 0.10.3", + "borsh 1.3.1", "num-derive", "num-traits", "solana-program", "spl-token", - "spl-token-2022 1.0.0", + "spl-token-2022", "thiserror", ] [[package]] name = "spl-discriminator" -version = "0.1.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa600f2fe56f32e923261719bae640d873edadbc5237681a39b8e37bfd4d263" +checksum = "34d1814406e98b08c5cd02c1126f83fd407ad084adce0b05fda5730677822eac" dependencies = [ "bytemuck", "solana-program", @@ -2620,9 +2644,9 @@ dependencies = [ [[package]] name = "spl-discriminator-derive" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" +checksum = "d9e8418ea6269dcfb01c712f0444d2c75542c04448b480e87de59d2865edc750" dependencies = [ "quote", "spl-discriminator-syn", @@ -2631,9 +2655,9 @@ dependencies = [ [[package]] name = "spl-discriminator-syn" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fea7be851bd98d10721782ea958097c03a0c2a07d8d4997041d0ece6319a63" +checksum = "8c1f05593b7ca9eac7caca309720f2eafb96355e037e6d373b909a80fe7b69b9" dependencies = [ "proc-macro2", "quote", @@ -2653,11 +2677,11 @@ dependencies = [ [[package]] name = "spl-pod" -version = "0.1.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85a5db7e4efb1107b0b8e52a13f035437cdcb36ef99c58f6d467f089d9b2915a" +checksum = "046ce669f48cf2eca1ec518916d8725596bfb655beb1c74374cf71dc6cb773c9" dependencies = [ - "borsh 0.10.3", + "borsh 1.3.1", "bytemuck", "solana-program", "solana-zk-token-sdk", @@ -2666,9 +2690,9 @@ dependencies = [ [[package]] name = "spl-program-error" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0657b6490196971d9e729520ba934911ff41fbb2cb9004463dbe23cf8b4b4f" +checksum = "49065093ea91f57b9b2bd81493ff705e2ad4e64507a07dbc02b085778e02770e" dependencies = [ "num-derive", "num-traits", @@ -2679,9 +2703,9 @@ dependencies = [ [[package]] name = "spl-program-error-derive" -version = "0.3.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1845dfe71fd68f70382232742e758557afe973ae19e6c06807b2c30f5d5cb474" +checksum = "e6d375dd76c517836353e093c2dbb490938ff72821ab568b545fd30ab3256b3e" dependencies = [ "proc-macro2", "quote", @@ -2691,23 +2715,9 @@ dependencies = [ [[package]] name = "spl-tlv-account-resolution" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" -dependencies = [ - "bytemuck", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", - "spl-type-length-value", -] - -[[package]] -name = "spl-tlv-account-resolution" -version = "0.5.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f335787add7fa711819f9e7c573f8145a5358a709446fe2d24bf2a88117c90" +checksum = "cace91ba08984a41556efe49cbf2edca4db2f577b649da7827d3621161784bf8" dependencies = [ "bytemuck", "solana-program", @@ -2734,31 +2744,9 @@ dependencies = [ [[package]] name = "spl-token-2022" -version = "0.9.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" -dependencies = [ - "arrayref", - "bytemuck", - "num-derive", - "num-traits", - "num_enum", - "solana-program", - "solana-zk-token-sdk", - "spl-memo", - "spl-pod", - "spl-token", - "spl-token-metadata-interface", - "spl-transfer-hook-interface 0.3.0", - "spl-type-length-value", - "thiserror", -] - -[[package]] -name = "spl-token-2022" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d697fac19fd74ff472dfcc13f0b442dd71403178ce1de7b5d16f83a33561c059" +checksum = "e5412f99ae7ee6e0afde00defaa354e6228e47e30c0e3adf553e2e01e6abb584" dependencies = [ "arrayref", "bytemuck", @@ -2773,16 +2761,16 @@ dependencies = [ "spl-token", "spl-token-group-interface", "spl-token-metadata-interface", - "spl-transfer-hook-interface 0.4.1", + "spl-transfer-hook-interface", "spl-type-length-value", "thiserror", ] [[package]] name = "spl-token-group-interface" -version = "0.1.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb67fbacd587377a400aba81718abe4424d0e9d5ea510034d3b7f130d102153" +checksum = "d419b5cfa3ee8e0f2386fd7e02a33b3ec8a7db4a9c7064a2ea24849dc4a273b6" dependencies = [ "bytemuck", "solana-program", @@ -2793,39 +2781,23 @@ dependencies = [ [[package]] name = "spl-token-metadata-interface" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16aa8f64b6e0eaab3f5034e84d867c8435d8216497b4543a4978a31f4b6e8a8" -dependencies = [ - "borsh 0.10.3", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", - "spl-type-length-value", -] - -[[package]] -name = "spl-transfer-hook-interface" -version = "0.3.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" +checksum = "30179c47e93625680dabb620c6e7931bd12d62af390f447bc7beb4a3a9b5feee" dependencies = [ - "arrayref", - "bytemuck", + "borsh 1.3.1", "solana-program", "spl-discriminator", "spl-pod", "spl-program-error", - "spl-tlv-account-resolution 0.4.0", "spl-type-length-value", ] [[package]] name = "spl-transfer-hook-interface" -version = "0.4.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aabdb7c471566f6ddcee724beb8618449ea24b399e58d464d6b5bc7db550259" +checksum = "66a98359769cd988f7b35c02558daa56d496a7e3bd8626e61f90a7c757eedb9b" dependencies = [ "arrayref", "bytemuck", @@ -2833,15 +2805,15 @@ dependencies = [ "spl-discriminator", "spl-pod", "spl-program-error", - "spl-tlv-account-resolution 0.5.2", + "spl-tlv-account-resolution", "spl-type-length-value", ] [[package]] name = "spl-type-length-value" -version = "0.3.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f9ebd75d29c5f48de5f6a9c114e08531030b75b8ac2c557600ac7da0b73b1e8" +checksum = "422ce13429dbd41d2cee8a73931c05fda0b0c8ca156a8b0c19445642550bb61a" dependencies = [ "bytemuck", "solana-program", diff --git a/lints/missing_owner_check/Cargo.toml b/lints/missing_owner_check/Cargo.toml index 20f4b118..88868dde 100644 --- a/lints/missing_owner_check/Cargo.toml +++ b/lints/missing_owner_check/Cargo.toml @@ -38,16 +38,14 @@ name = "secure-anchor-constraints" path = "ui/secure-anchor-constraints/src/lib.rs" [dependencies] -anchor-syn = "0.29.0" clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "ac4c2094a6030530661bee3876e0228ddfeb6b8b" } dylint_linting = "2.6" if_chain = "1.0" solana-lints = { path = "../../crate" } -syn = { version = "1.0.109", features = ["parsing"] } [dev-dependencies] -anchor-lang = "0.29" -anchor-spl = "0.29" +anchor-lang = "0.30" +anchor-spl = "0.30" dylint_testing = "2.6" [workspace] diff --git a/lints/missing_owner_check/src/lib.rs b/lints/missing_owner_check/src/lib.rs index 6482ef36..56998809 100644 --- a/lints/missing_owner_check/src/lib.rs +++ b/lints/missing_owner_check/src/lib.rs @@ -5,7 +5,6 @@ extern crate rustc_hir; extern crate rustc_middle; extern crate rustc_span; -use anchor_syn::{AccountField, AccountsStruct, ConstraintGroup}; use clippy_utils::{ diagnostics::span_lint, match_any_def_paths, match_def_path, ty::match_type, SpanlessEq, }; @@ -18,6 +17,7 @@ use rustc_hir::{ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty; use rustc_span::Span; +use solana_lints::anchor_syn::{AccountField, AccountsStruct, ConstraintGroup}; use solana_lints::{paths, utils::get_anchor_accounts_struct, utils::visit_expr_no_bodies}; use std::collections::HashMap; diff --git a/lints/missing_signer_check/Cargo.lock b/lints/missing_signer_check/Cargo.lock index a1d9b6f5..29eeb750 100644 --- a/lints/missing_signer_check/Cargo.lock +++ b/lints/missing_signer_check/Cargo.lock @@ -36,9 +36,9 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" +checksum = "47fe28365b33e8334dd70ae2f34a43892363012fe239cf37d2ee91693575b1f8" dependencies = [ "anchor-syn", "proc-macro2", @@ -48,9 +48,9 @@ dependencies = [ [[package]] name = "anchor-attribute-account" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" +checksum = "3c288d496168268d198d9b53ee9f4f9d260a55ba4df9877ea1d4486ad6109e0f" dependencies = [ "anchor-syn", "bs58 0.5.0", @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "anchor-attribute-constant" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" +checksum = "49b77b6948d0eeaaa129ce79eea5bbbb9937375a9241d909ca8fb9e006bb6e90" dependencies = [ "anchor-syn", "quote", @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "anchor-attribute-error" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" +checksum = "4d20bb569c5a557c86101b944721d865e1fd0a4c67c381d31a44a84f07f84828" dependencies = [ "anchor-syn", "quote", @@ -83,9 +83,9 @@ dependencies = [ [[package]] name = "anchor-attribute-event" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" +checksum = "4cebd8d0671a3a9dc3160c48598d652c34c77de6be4d44345b8b514323284d57" dependencies = [ "anchor-syn", "proc-macro2", @@ -95,20 +95,26 @@ dependencies = [ [[package]] name = "anchor-attribute-program" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" +checksum = "efb2a5eb0860e661ab31aff7bb5e0288357b176380e985bade4ccb395981b42d" dependencies = [ + "anchor-lang-idl", "anchor-syn", + "anyhow", + "bs58 0.5.0", + "heck", + "proc-macro2", "quote", + "serde_json", "syn 1.0.109", ] [[package]] name = "anchor-derive-accounts" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" +checksum = "04368b5abef4266250ca8d1d12f4dff860242681e4ec22b885dcfe354fd35aa1" dependencies = [ "anchor-syn", "quote", @@ -117,9 +123,9 @@ dependencies = [ [[package]] name = "anchor-derive-serde" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +checksum = "e0bb0e0911ad4a70cab880cdd6287fe1e880a1a9d8e4e6defa8e9044b9796a6c" dependencies = [ "anchor-syn", "borsh-derive-internal 0.10.3", @@ -130,9 +136,9 @@ dependencies = [ [[package]] name = "anchor-derive-space" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" +checksum = "5ef415ff156dc82e9ecb943189b0cb241b3a6bfc26a180234dc21bd3ef3ce0cb" dependencies = [ "proc-macro2", "quote", @@ -141,9 +147,9 @@ dependencies = [ [[package]] name = "anchor-lang" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" +checksum = "6620c9486d9d36a4389cab5e37dc34a42ed0bfaa62e6a75a2999ce98f8f2e373" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -155,7 +161,7 @@ dependencies = [ "anchor-derive-serde", "anchor-derive-space", "arrayref", - "base64 0.13.1", + "base64 0.21.7", "bincode", "borsh 0.10.3", "bytemuck", @@ -164,11 +170,35 @@ dependencies = [ "thiserror", ] +[[package]] +name = "anchor-lang-idl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31cf97b4e6f7d6144a05e435660fcf757dbc3446d38d0e2b851d11ed13625bba" +dependencies = [ + "anchor-lang-idl-spec", + "anyhow", + "heck", + "serde", + "serde_json", + "sha2 0.10.8", +] + +[[package]] +name = "anchor-lang-idl-spec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdf143115440fe621bdac3a29a1f7472e09f6cd82b2aa569429a0c13f103838" +dependencies = [ + "anyhow", + "serde", +] + [[package]] name = "anchor-syn" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" +checksum = "f99daacb53b55cfd37ce14d6c9905929721137fd4c67bbab44a19802aecb622f" dependencies = [ "anyhow", "bs58 0.5.0", @@ -338,12 +368,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -1450,7 +1474,6 @@ name = "missing_signer_check" version = "0.1.0" dependencies = [ "anchor-lang", - "anchor-syn", "clippy_utils", "dylint_linting", "dylint_testing", diff --git a/lints/missing_signer_check/Cargo.toml b/lints/missing_signer_check/Cargo.toml index 77c59b24..e6f49b6e 100644 --- a/lints/missing_signer_check/Cargo.toml +++ b/lints/missing_signer_check/Cargo.toml @@ -30,14 +30,13 @@ name = "secure-non-anchor" path = "ui/secure-non-anchor/src/lib.rs" [dependencies] -anchor-syn = "0.29.0" clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "ac4c2094a6030530661bee3876e0228ddfeb6b8b" } dylint_linting = "2.6" if_chain = "1.0" solana-lints = { path = "../../crate" } [dev-dependencies] -anchor-lang = "0.29" +anchor-lang = "0.30" dylint_testing = "2.6" solana-program = "1.18.4" diff --git a/lints/missing_signer_check/src/lib.rs b/lints/missing_signer_check/src/lib.rs index 3b401458..ec0175f4 100644 --- a/lints/missing_signer_check/src/lib.rs +++ b/lints/missing_signer_check/src/lib.rs @@ -5,7 +5,6 @@ extern crate rustc_hir; extern crate rustc_middle; extern crate rustc_span; -use anchor_syn::{AccountField, Ty as FieldTy}; use clippy_utils::{diagnostics::span_lint, diagnostics::span_lint_and_then, ty::match_type}; use if_chain::if_chain; use rustc_hir::{ @@ -14,6 +13,7 @@ use rustc_hir::{ use rustc_lint::{LateContext, LateLintPass}; use rustc_middle::ty::{self, GenericArg, GenericArgKind}; use rustc_span::Span; +use solana_lints::anchor_syn::{AccountField, Ty as FieldTy}; use solana_lints::{ paths, utils::{get_anchor_accounts_struct, is_anchor_program, visit_expr_no_bodies}, diff --git a/lints/sysvar_get/Cargo.lock b/lints/sysvar_get/Cargo.lock index c8a0afdc..08c1fdbb 100644 --- a/lints/sysvar_get/Cargo.lock +++ b/lints/sysvar_get/Cargo.lock @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" +checksum = "47fe28365b33e8334dd70ae2f34a43892363012fe239cf37d2ee91693575b1f8" dependencies = [ "anchor-syn", "proc-macro2", @@ -84,9 +84,9 @@ dependencies = [ [[package]] name = "anchor-attribute-account" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" +checksum = "3c288d496168268d198d9b53ee9f4f9d260a55ba4df9877ea1d4486ad6109e0f" dependencies = [ "anchor-syn", "bs58 0.5.0", @@ -97,9 +97,9 @@ dependencies = [ [[package]] name = "anchor-attribute-constant" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" +checksum = "49b77b6948d0eeaaa129ce79eea5bbbb9937375a9241d909ca8fb9e006bb6e90" dependencies = [ "anchor-syn", "quote", @@ -108,9 +108,9 @@ dependencies = [ [[package]] name = "anchor-attribute-error" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" +checksum = "4d20bb569c5a557c86101b944721d865e1fd0a4c67c381d31a44a84f07f84828" dependencies = [ "anchor-syn", "quote", @@ -119,9 +119,9 @@ dependencies = [ [[package]] name = "anchor-attribute-event" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" +checksum = "4cebd8d0671a3a9dc3160c48598d652c34c77de6be4d44345b8b514323284d57" dependencies = [ "anchor-syn", "proc-macro2", @@ -131,20 +131,26 @@ dependencies = [ [[package]] name = "anchor-attribute-program" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" +checksum = "efb2a5eb0860e661ab31aff7bb5e0288357b176380e985bade4ccb395981b42d" dependencies = [ + "anchor-lang-idl", "anchor-syn", + "anyhow", + "bs58 0.5.0", + "heck", + "proc-macro2", "quote", + "serde_json", "syn 1.0.109", ] [[package]] name = "anchor-derive-accounts" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" +checksum = "04368b5abef4266250ca8d1d12f4dff860242681e4ec22b885dcfe354fd35aa1" dependencies = [ "anchor-syn", "quote", @@ -153,9 +159,9 @@ dependencies = [ [[package]] name = "anchor-derive-serde" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +checksum = "e0bb0e0911ad4a70cab880cdd6287fe1e880a1a9d8e4e6defa8e9044b9796a6c" dependencies = [ "anchor-syn", "borsh-derive-internal 0.10.3", @@ -166,9 +172,9 @@ dependencies = [ [[package]] name = "anchor-derive-space" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" +checksum = "5ef415ff156dc82e9ecb943189b0cb241b3a6bfc26a180234dc21bd3ef3ce0cb" dependencies = [ "proc-macro2", "quote", @@ -177,9 +183,9 @@ dependencies = [ [[package]] name = "anchor-lang" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" +checksum = "6620c9486d9d36a4389cab5e37dc34a42ed0bfaa62e6a75a2999ce98f8f2e373" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -191,7 +197,7 @@ dependencies = [ "anchor-derive-serde", "anchor-derive-space", "arrayref", - "base64 0.13.1", + "base64 0.21.7", "bincode", "borsh 0.10.3", "bytemuck", @@ -200,24 +206,50 @@ dependencies = [ "thiserror", ] +[[package]] +name = "anchor-lang-idl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31cf97b4e6f7d6144a05e435660fcf757dbc3446d38d0e2b851d11ed13625bba" +dependencies = [ + "anchor-lang-idl-spec", + "anyhow", + "heck", + "serde", + "serde_json", + "sha2 0.10.8", +] + +[[package]] +name = "anchor-lang-idl-spec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdf143115440fe621bdac3a29a1f7472e09f6cd82b2aa569429a0c13f103838" +dependencies = [ + "anyhow", + "serde", +] + [[package]] name = "anchor-spl" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" +checksum = "04bd077c34449319a1e4e0bc21cea572960c9ae0d0fefda0dd7c52fcc3c647a3" dependencies = [ "anchor-lang", - "solana-program", "spl-associated-token-account", + "spl-pod", "spl-token", - "spl-token-2022 0.9.0", + "spl-token-2022", + "spl-token-group-interface", + "spl-token-metadata-interface", ] [[package]] name = "anchor-syn" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" +checksum = "f99daacb53b55cfd37ce14d6c9905929721137fd4c67bbab44a19802aecb622f" dependencies = [ "anyhow", "bs58 0.5.0", @@ -404,12 +436,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -645,9 +671,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.14.1" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" dependencies = [ "bytemuck_derive", ] @@ -2362,9 +2388,9 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "solana-frozen-abi" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b24a0e5179387f145afba79d72b27db817cecf1b9494f7cd55d42aa986ed3141" +checksum = "4867f66e9527fa44451c861c1dc6d9b2a7c7a668d7c6a297cdefbe39f4395b33" dependencies = [ "block-buffer 0.10.4", "bs58 0.4.0", @@ -2387,9 +2413,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92970a9898903eb1433d42f53ca4e8f497bc05382b7bc170ea81d4d3c6ff5d58" +checksum = "168f24d97347b85f05192df58d6be3e3047a4aadc4001bc1b9e711a5ec878eea" dependencies = [ "proc-macro2", "quote", @@ -2409,9 +2435,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea25cdb22fe3dfed39a9ef59b836153d226fb9e3984a1f5b6134061bfa94528" +checksum = "a0511082fc62f2d086520fff5aa1917c389d8c840930c08ad255ae05952c08a2" dependencies = [ "env_logger 0.9.3", "lazy_static", @@ -2420,9 +2446,9 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ce0a1f4487b0b9e5e53610e8c17e558d17069145281aaae9f825bfef84b16e" +checksum = "2bc5a636dc75e5c25651e34f7a36afc9ae60d38166687c5b0375abb580ac81a2" dependencies = [ "ark-bn254", "ark-ec", @@ -2475,9 +2501,9 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90134b382769b2e7a1d87ae97d6242f1b7ce237591e06520641ad6e2df07653c" +checksum = "df43d3a1e1637397ab43cbc216a5a8f977ec8a3cc3f3ae8c3851c83a3255dbcf" dependencies = [ "assert_matches", "base64 0.21.7", @@ -2530,9 +2556,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e3cdf8616a66e99343c3f99c39f311b4dc3e13977a4c96d7bbaa82dffd2fc5" +checksum = "86c76414183a325038ff020b22c07d1e9d2da0703ddc0244acfed37ee2921d96" dependencies = [ "bs58 0.4.0", "proc-macro2", @@ -2549,9 +2575,9 @@ checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" [[package]] name = "solana-zk-token-sdk" -version = "1.18.1" +version = "1.18.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29693ea4eac0f076b9beb54db7c11d0220b110620aeee56a32ff2a49a170ebe8" +checksum = "513407f88394e437b4ff5aad892bc5bf51a655ae2401e6e63549734d3695c46f" dependencies = [ "aes-gcm-siv", "base64 0.21.7", @@ -2578,25 +2604,25 @@ dependencies = [ [[package]] name = "spl-associated-token-account" -version = "2.3.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "992d9c64c2564cc8f63a4b508bf3ebcdf2254b0429b13cd1d31adb6162432a5f" +checksum = "a2e688554bac5838217ffd1fab7845c573ff106b6336bf7d290db7c98d5a8efd" dependencies = [ "assert_matches", - "borsh 0.10.3", + "borsh 1.3.1", "num-derive", "num-traits", "solana-program", "spl-token", - "spl-token-2022 1.0.0", + "spl-token-2022", "thiserror", ] [[package]] name = "spl-discriminator" -version = "0.1.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa600f2fe56f32e923261719bae640d873edadbc5237681a39b8e37bfd4d263" +checksum = "34d1814406e98b08c5cd02c1126f83fd407ad084adce0b05fda5730677822eac" dependencies = [ "bytemuck", "solana-program", @@ -2605,9 +2631,9 @@ dependencies = [ [[package]] name = "spl-discriminator-derive" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" +checksum = "d9e8418ea6269dcfb01c712f0444d2c75542c04448b480e87de59d2865edc750" dependencies = [ "quote", "spl-discriminator-syn", @@ -2616,9 +2642,9 @@ dependencies = [ [[package]] name = "spl-discriminator-syn" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fea7be851bd98d10721782ea958097c03a0c2a07d8d4997041d0ece6319a63" +checksum = "8c1f05593b7ca9eac7caca309720f2eafb96355e037e6d373b909a80fe7b69b9" dependencies = [ "proc-macro2", "quote", @@ -2638,11 +2664,11 @@ dependencies = [ [[package]] name = "spl-pod" -version = "0.1.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85a5db7e4efb1107b0b8e52a13f035437cdcb36ef99c58f6d467f089d9b2915a" +checksum = "046ce669f48cf2eca1ec518916d8725596bfb655beb1c74374cf71dc6cb773c9" dependencies = [ - "borsh 0.10.3", + "borsh 1.3.1", "bytemuck", "solana-program", "solana-zk-token-sdk", @@ -2651,9 +2677,9 @@ dependencies = [ [[package]] name = "spl-program-error" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0657b6490196971d9e729520ba934911ff41fbb2cb9004463dbe23cf8b4b4f" +checksum = "49065093ea91f57b9b2bd81493ff705e2ad4e64507a07dbc02b085778e02770e" dependencies = [ "num-derive", "num-traits", @@ -2664,9 +2690,9 @@ dependencies = [ [[package]] name = "spl-program-error-derive" -version = "0.3.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1845dfe71fd68f70382232742e758557afe973ae19e6c06807b2c30f5d5cb474" +checksum = "e6d375dd76c517836353e093c2dbb490938ff72821ab568b545fd30ab3256b3e" dependencies = [ "proc-macro2", "quote", @@ -2676,23 +2702,9 @@ dependencies = [ [[package]] name = "spl-tlv-account-resolution" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" -dependencies = [ - "bytemuck", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", - "spl-type-length-value", -] - -[[package]] -name = "spl-tlv-account-resolution" -version = "0.5.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f335787add7fa711819f9e7c573f8145a5358a709446fe2d24bf2a88117c90" +checksum = "cace91ba08984a41556efe49cbf2edca4db2f577b649da7827d3621161784bf8" dependencies = [ "bytemuck", "solana-program", @@ -2719,31 +2731,9 @@ dependencies = [ [[package]] name = "spl-token-2022" -version = "0.9.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" -dependencies = [ - "arrayref", - "bytemuck", - "num-derive", - "num-traits", - "num_enum", - "solana-program", - "solana-zk-token-sdk", - "spl-memo", - "spl-pod", - "spl-token", - "spl-token-metadata-interface", - "spl-transfer-hook-interface 0.3.0", - "spl-type-length-value", - "thiserror", -] - -[[package]] -name = "spl-token-2022" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d697fac19fd74ff472dfcc13f0b442dd71403178ce1de7b5d16f83a33561c059" +checksum = "e5412f99ae7ee6e0afde00defaa354e6228e47e30c0e3adf553e2e01e6abb584" dependencies = [ "arrayref", "bytemuck", @@ -2758,16 +2748,16 @@ dependencies = [ "spl-token", "spl-token-group-interface", "spl-token-metadata-interface", - "spl-transfer-hook-interface 0.4.1", + "spl-transfer-hook-interface", "spl-type-length-value", "thiserror", ] [[package]] name = "spl-token-group-interface" -version = "0.1.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb67fbacd587377a400aba81718abe4424d0e9d5ea510034d3b7f130d102153" +checksum = "d419b5cfa3ee8e0f2386fd7e02a33b3ec8a7db4a9c7064a2ea24849dc4a273b6" dependencies = [ "bytemuck", "solana-program", @@ -2778,39 +2768,23 @@ dependencies = [ [[package]] name = "spl-token-metadata-interface" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16aa8f64b6e0eaab3f5034e84d867c8435d8216497b4543a4978a31f4b6e8a8" -dependencies = [ - "borsh 0.10.3", - "solana-program", - "spl-discriminator", - "spl-pod", - "spl-program-error", - "spl-type-length-value", -] - -[[package]] -name = "spl-transfer-hook-interface" -version = "0.3.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" +checksum = "30179c47e93625680dabb620c6e7931bd12d62af390f447bc7beb4a3a9b5feee" dependencies = [ - "arrayref", - "bytemuck", + "borsh 1.3.1", "solana-program", "spl-discriminator", "spl-pod", "spl-program-error", - "spl-tlv-account-resolution 0.4.0", "spl-type-length-value", ] [[package]] name = "spl-transfer-hook-interface" -version = "0.4.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aabdb7c471566f6ddcee724beb8618449ea24b399e58d464d6b5bc7db550259" +checksum = "66a98359769cd988f7b35c02558daa56d496a7e3bd8626e61f90a7c757eedb9b" dependencies = [ "arrayref", "bytemuck", @@ -2818,15 +2792,15 @@ dependencies = [ "spl-discriminator", "spl-pod", "spl-program-error", - "spl-tlv-account-resolution 0.5.2", + "spl-tlv-account-resolution", "spl-type-length-value", ] [[package]] name = "spl-type-length-value" -version = "0.3.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f9ebd75d29c5f48de5f6a9c114e08531030b75b8ac2c557600ac7da0b73b1e8" +checksum = "422ce13429dbd41d2cee8a73931c05fda0b0c8ca156a8b0c19445642550bb61a" dependencies = [ "bytemuck", "solana-program", @@ -2887,13 +2861,11 @@ version = "0.1.0" dependencies = [ "anchor-lang", "anchor-spl", - "anchor-syn", "clippy_utils", "dylint_linting", "dylint_testing", "if_chain", "solana-lints", - "syn 1.0.109", ] [[package]] diff --git a/lints/sysvar_get/Cargo.toml b/lints/sysvar_get/Cargo.toml index 9bac6a47..fa103b48 100644 --- a/lints/sysvar_get/Cargo.toml +++ b/lints/sysvar_get/Cargo.toml @@ -18,16 +18,14 @@ name = "secure" path = "ui/secure/src/lib.rs" [dependencies] -anchor-syn = "0.29.0" clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "ac4c2094a6030530661bee3876e0228ddfeb6b8b" } dylint_linting = "2.6" if_chain = "1.0" solana-lints = { path = "../../crate" } -syn = { version = "1.0.109", features = ["parsing"] } [dev-dependencies] -anchor-lang = "0.29" -anchor-spl = "0.29" +anchor-lang = "0.30" +anchor-spl = "0.30" dylint_testing = "2.6" [workspace] diff --git a/lints/sysvar_get/src/lib.rs b/lints/sysvar_get/src/lib.rs index 7555d8ad..d162a0ea 100644 --- a/lints/sysvar_get/src/lib.rs +++ b/lints/sysvar_get/src/lib.rs @@ -4,7 +4,6 @@ extern crate rustc_hir; extern crate rustc_span; -use anchor_syn::{AccountField, SysvarTy, Ty as FieldTy}; use clippy_utils::{ diagnostics::span_lint, diagnostics::span_lint_and_then, match_any_def_paths, match_def_path, }; @@ -17,6 +16,7 @@ use rustc_hir::{ }; use rustc_lint::{LateContext, LateLintPass}; use rustc_span::Span; +use solana_lints::anchor_syn::{AccountField, SysvarTy, Ty as FieldTy}; use solana_lints::{paths, utils::get_anchor_accounts_struct}; dylint_linting::declare_late_lint! { diff --git a/lints/type_cosplay/Cargo.lock b/lints/type_cosplay/Cargo.lock index a1931c1a..d4978166 100644 --- a/lints/type_cosplay/Cargo.lock +++ b/lints/type_cosplay/Cargo.lock @@ -36,9 +36,9 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" +checksum = "47fe28365b33e8334dd70ae2f34a43892363012fe239cf37d2ee91693575b1f8" dependencies = [ "anchor-syn", "proc-macro2", @@ -48,9 +48,9 @@ dependencies = [ [[package]] name = "anchor-attribute-account" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" +checksum = "3c288d496168268d198d9b53ee9f4f9d260a55ba4df9877ea1d4486ad6109e0f" dependencies = [ "anchor-syn", "bs58 0.5.0", @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "anchor-attribute-constant" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" +checksum = "49b77b6948d0eeaaa129ce79eea5bbbb9937375a9241d909ca8fb9e006bb6e90" dependencies = [ "anchor-syn", "quote", @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "anchor-attribute-error" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" +checksum = "4d20bb569c5a557c86101b944721d865e1fd0a4c67c381d31a44a84f07f84828" dependencies = [ "anchor-syn", "quote", @@ -83,9 +83,9 @@ dependencies = [ [[package]] name = "anchor-attribute-event" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" +checksum = "4cebd8d0671a3a9dc3160c48598d652c34c77de6be4d44345b8b514323284d57" dependencies = [ "anchor-syn", "proc-macro2", @@ -95,20 +95,26 @@ dependencies = [ [[package]] name = "anchor-attribute-program" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" +checksum = "efb2a5eb0860e661ab31aff7bb5e0288357b176380e985bade4ccb395981b42d" dependencies = [ + "anchor-lang-idl", "anchor-syn", + "anyhow", + "bs58 0.5.0", + "heck", + "proc-macro2", "quote", + "serde_json", "syn 1.0.109", ] [[package]] name = "anchor-derive-accounts" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" +checksum = "04368b5abef4266250ca8d1d12f4dff860242681e4ec22b885dcfe354fd35aa1" dependencies = [ "anchor-syn", "quote", @@ -117,9 +123,9 @@ dependencies = [ [[package]] name = "anchor-derive-serde" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" +checksum = "e0bb0e0911ad4a70cab880cdd6287fe1e880a1a9d8e4e6defa8e9044b9796a6c" dependencies = [ "anchor-syn", "borsh-derive-internal 0.10.3", @@ -130,9 +136,9 @@ dependencies = [ [[package]] name = "anchor-derive-space" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" +checksum = "5ef415ff156dc82e9ecb943189b0cb241b3a6bfc26a180234dc21bd3ef3ce0cb" dependencies = [ "proc-macro2", "quote", @@ -141,9 +147,9 @@ dependencies = [ [[package]] name = "anchor-lang" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" +checksum = "6620c9486d9d36a4389cab5e37dc34a42ed0bfaa62e6a75a2999ce98f8f2e373" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -155,7 +161,7 @@ dependencies = [ "anchor-derive-serde", "anchor-derive-space", "arrayref", - "base64 0.13.1", + "base64 0.21.7", "bincode", "borsh 0.10.3", "bytemuck", @@ -164,11 +170,35 @@ dependencies = [ "thiserror", ] +[[package]] +name = "anchor-lang-idl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31cf97b4e6f7d6144a05e435660fcf757dbc3446d38d0e2b851d11ed13625bba" +dependencies = [ + "anchor-lang-idl-spec", + "anyhow", + "heck", + "serde", + "serde_json", + "sha2 0.10.8", +] + +[[package]] +name = "anchor-lang-idl-spec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdf143115440fe621bdac3a29a1f7472e09f6cd82b2aa569429a0c13f103838" +dependencies = [ + "anyhow", + "serde", +] + [[package]] name = "anchor-syn" -version = "0.29.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" +checksum = "f99daacb53b55cfd37ce14d6c9905929721137fd4c67bbab44a19802aecb622f" dependencies = [ "anyhow", "bs58 0.5.0", @@ -338,12 +368,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" diff --git a/lints/type_cosplay/Cargo.toml b/lints/type_cosplay/Cargo.toml index 2cedcbdc..6ee61444 100644 --- a/lints/type_cosplay/Cargo.toml +++ b/lints/type_cosplay/Cargo.toml @@ -48,7 +48,7 @@ if_chain = "1.0" solana-lints = { path = "../../crate" } [dev-dependencies] -anchor-lang = "0.29" +anchor-lang = "0.30" dylint_testing = "2.6" [workspace]