[INFO] cloning repository https://github.com/diobenu08koga/sol_idl_extractor [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/diobenu08koga/sol_idl_extractor" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdiobenu08koga%2Fsol_idl_extractor", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdiobenu08koga%2Fsol_idl_extractor'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] d8154ae3bd599b89230c9131b99a972bbccef447 [INFO] linting diobenu08koga/sol_idl_extractor against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdiobenu08koga%2Fsol_idl_extractor" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/diobenu08koga/sol_idl_extractor [INFO] finished tweaking git repo https://github.com/diobenu08koga/sol_idl_extractor [INFO] tweaked toml for git repo https://github.com/diobenu08koga/sol_idl_extractor written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/diobenu08koga/sol_idl_extractor on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/diobenu08koga/sol_idl_extractor already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded solana-fee v2.2.7 [INFO] [stderr] Downloaded solana-address-lookup-table-program v2.2.7 [INFO] [stderr] Downloaded solana-svm-transaction v2.2.7 [INFO] [stderr] Downloaded solana-curve25519 v2.2.7 [INFO] [stderr] Downloaded agave-transaction-view v2.2.7 [INFO] [stderr] Downloaded solana-unified-scheduler-logic v2.2.7 [INFO] [stderr] Downloaded solana-bucket-map v2.2.7 [INFO] [stderr] Downloaded solana-banks-client v2.2.7 [INFO] [stderr] Downloaded solana-zk-elgamal-proof-program v2.2.7 [INFO] [stderr] Downloaded solana-bpf-loader-program v2.2.7 [INFO] [stderr] Downloaded solana-sbpf v0.11.0 [INFO] [stderr] Downloaded solana-lattice-hash v2.2.7 [INFO] [stderr] Downloaded solana-accounts-db v2.2.7 [INFO] [stderr] Downloaded goblin v0.6.1 [INFO] [stderr] Downloaded solana-poseidon v2.2.7 [INFO] [stderr] Downloaded solana-zk-token-proof-program v2.2.7 [INFO] [stderr] Downloaded solana-program-test v2.2.7 [INFO] [stderr] Downloaded solana-stake-program v2.2.7 [INFO] [stderr] Downloaded solana-runtime-transaction v2.2.7 [INFO] [stderr] Downloaded solana-compute-budget-instruction v2.2.7 [INFO] [stderr] Downloaded solana-loader-v4-program v2.2.7 [INFO] [stderr] Downloaded async-compression v0.4.22 [INFO] [stderr] Downloaded solana-builtins v2.2.7 [INFO] [stderr] Downloaded solana-banks-interface v2.2.7 [INFO] [stderr] Downloaded solana-send-transaction-service v2.2.7 [INFO] [stderr] Downloaded solana-banks-server v2.2.7 [INFO] [stderr] Downloaded solana-svm-rent-collector v2.2.7 [INFO] [stderr] Downloaded solana-system-program v2.2.7 [INFO] [stderr] Downloaded solana-cost-model v2.2.7 [INFO] [stderr] Downloaded solana-zk-token-sdk v2.2.7 [INFO] [stderr] Downloaded solana-svm v2.2.7 [INFO] [stderr] Downloaded solana-builtins-default-costs v2.2.7 [INFO] [stderr] Downloaded index_list v0.2.15 [INFO] [stderr] Downloaded solana-zk-sdk v2.2.7 [INFO] [stderr] Downloaded solana-vote v2.2.7 [INFO] [stderr] Downloaded solana-runtime v2.2.7 [INFO] [stderr] Downloaded solana-compute-budget-program v2.2.7 [INFO] [stderr] Downloaded solana-vote-interface v2.2.3 [INFO] [stderr] Downloaded solana-vote-program v2.2.7 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 04ac5ada0b2dcd84f2237b3a57ae4ad66bcecd7dfa95e9acbccea09b9ec94814 [INFO] running `Command { std: "docker" "start" "-a" "04ac5ada0b2dcd84f2237b3a57ae4ad66bcecd7dfa95e9acbccea09b9ec94814", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "04ac5ada0b2dcd84f2237b3a57ae4ad66bcecd7dfa95e9acbccea09b9ec94814", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "04ac5ada0b2dcd84f2237b3a57ae4ad66bcecd7dfa95e9acbccea09b9ec94814", kill_on_drop: false }` [INFO] [stdout] 04ac5ada0b2dcd84f2237b3a57ae4ad66bcecd7dfa95e9acbccea09b9ec94814 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] d2b5cfe7a3e94755632bd625a042b5d6349814a66e38128c26dd0349919318bd [INFO] running `Command { std: "docker" "start" "-a" "d2b5cfe7a3e94755632bd625a042b5d6349814a66e38128c26dd0349919318bd", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.171 [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Compiling hashbrown v0.15.2 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Compiling winnow v0.7.6 [INFO] [stderr] Checking zerocopy v0.7.35 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Compiling zeroize_derive v1.4.2 [INFO] [stderr] Compiling bytemuck_derive v1.9.3 [INFO] [stderr] Compiling curve25519-dalek-derive v0.1.1 [INFO] [stderr] Compiling curve25519-dalek v4.1.3 [INFO] [stderr] Checking memchr v2.7.4 [INFO] [stderr] Compiling solana-sdk-macro v2.2.1 [INFO] [stderr] Checking sha2 v0.9.9 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling crunchy v0.2.3 [INFO] [stderr] Compiling digest v0.9.0 [INFO] [stderr] Checking scopeguard v1.2.0 [INFO] [stderr] Checking crypto-mac v0.8.0 [INFO] [stderr] Compiling indexmap v2.9.0 [INFO] [stderr] Compiling libsecp256k1-core v0.2.2 [INFO] [stderr] Checking lock_api v0.4.12 [INFO] [stderr] Checking hmac v0.8.1 [INFO] [stderr] Compiling openssl v0.10.72 [INFO] [stderr] Checking zeroize v1.8.1 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Checking hmac-drbg v0.3.0 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Compiling jobserver v0.1.33 [INFO] [stderr] Checking tracing-core v0.1.33 [INFO] [stderr] Compiling num-derive v0.4.2 [INFO] [stderr] Checking solana-native-token v2.2.1 [INFO] [stderr] Checking solana-decode-error v2.2.1 [INFO] [stderr] Checking solana-program-memory v2.2.1 [INFO] [stderr] Checking num-integer v0.1.46 [INFO] [stderr] Compiling cc v1.2.19 [INFO] [stderr] Checking solana-precompile-error v2.2.1 [INFO] [stderr] Checking num-bigint v0.4.6 [INFO] [stderr] Checking brotli-decompressor v4.0.2 [INFO] [stderr] Compiling darling_core v0.20.11 [INFO] [stderr] Compiling cfg_eval v0.1.2 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking bytemuck v1.22.0 [INFO] [stderr] Checking ahash v0.8.11 [INFO] [stderr] Checking crypto-common v0.1.6 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking hashbrown v0.13.2 [INFO] [stderr] Checking getrandom v0.1.16 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Checking signal-hook-registry v1.4.2 [INFO] [stderr] Checking rand_core v0.5.1 [INFO] [stderr] Compiling libsecp256k1-gen-genmult v0.2.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Compiling libsecp256k1-gen-ecmult v0.2.1 [INFO] [stderr] Checking sha2 v0.10.8 [INFO] [stderr] Checking sha3 v0.10.8 [INFO] [stderr] Compiling openssl-src v300.5.0+3.5.0 [INFO] [stderr] Checking parking_lot_core v0.9.10 [INFO] [stderr] Compiling libsecp256k1 v0.6.0 [INFO] [stderr] Checking rand_chacha v0.2.2 [INFO] [stderr] Checking curve25519-dalek v3.2.0 [INFO] [stderr] Checking parking_lot v0.12.3 [INFO] [stderr] Checking socket2 v0.5.9 [INFO] [stderr] Checking mio v1.0.3 [INFO] [stderr] Checking hmac v0.12.1 [INFO] [stderr] Checking pbkdf2 v0.11.0 [INFO] [stderr] Checking tinystr v0.7.6 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Checking rand v0.7.3 [INFO] [stderr] Checking icu_collections v1.5.0 [INFO] [stderr] Checking solana-seed-phrase v2.2.1 [INFO] [stderr] Checking brotli v7.0.0 [INFO] [stderr] Checking gethostname v0.2.3 [INFO] [stderr] Compiling memoffset v0.9.1 [INFO] [stderr] Checking icu_locid v1.5.0 [INFO] [stderr] Compiling num-bigint v0.2.6 [INFO] [stderr] Checking solana-measure v2.2.7 [INFO] [stderr] Compiling num-complex v0.2.4 [INFO] [stderr] Checking tokio v1.44.2 [INFO] [stderr] Compiling toml_edit v0.22.24 [INFO] [stderr] Compiling num-rational v0.2.4 [INFO] [stderr] Checking solana-big-mod-exp v2.2.1 [INFO] [stderr] Checking num-iter v0.1.45 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking inout v0.1.4 [INFO] [stderr] Compiling blake3 v1.8.1 [INFO] [stderr] Compiling openssl-sys v0.9.107 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Checking bincode v1.3.3 [INFO] [stderr] Checking bitflags v2.9.0 [INFO] [stderr] Checking ed25519-dalek v1.0.1 [INFO] [stderr] Compiling borsh-derive-internal v0.10.4 [INFO] [stderr] Compiling borsh-schema-derive-internal v0.10.4 [INFO] [stderr] Checking serde-big-array v0.5.1 [INFO] [stderr] Checking serde_json v1.0.140 [INFO] [stderr] Checking solana-short-vec v2.2.1 [INFO] [stderr] Checking bv v0.11.1 [INFO] [stderr] Checking solana-signature v2.2.1 [INFO] [stderr] Checking solana-fee-calculator v2.2.1 [INFO] [stderr] Checking serde_bytes v0.11.17 [INFO] [stderr] Checking icu_provider v1.5.0 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking solana-serde-varint v2.2.1 [INFO] [stderr] Compiling darling_macro v0.20.11 [INFO] [stderr] Checking ed25519-dalek-bip32 v0.2.0 [INFO] [stderr] Compiling darling v0.20.11 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking cipher v0.4.4 [INFO] [stderr] Checking solana-inflation v2.2.1 [INFO] [stderr] Checking icu_locid_transform v1.5.0 [INFO] [stderr] Compiling serde_with_macros v3.12.0 [INFO] [stderr] Checking universal-hash v0.5.1 [INFO] [stderr] Compiling proc-macro-crate v3.3.0 [INFO] [stderr] Checking num v0.2.1 [INFO] [stderr] Checking combine v3.8.1 [INFO] [stderr] Checking polyval v0.6.2 [INFO] [stderr] Checking aes v0.8.4 [INFO] [stderr] Checking percentage v0.1.0 [INFO] [stderr] Checking ctr v0.9.2 [INFO] [stderr] Checking icu_properties v1.5.1 [INFO] [stderr] Checking aead v0.5.2 [INFO] [stderr] Compiling enum-iterator-derive v1.4.0 [INFO] [stderr] Checking merlin v3.0.0 [INFO] [stderr] Checking itertools v0.10.5 [INFO] [stderr] Checking hash32 v0.2.1 [INFO] [stderr] Checking aes-gcm-siv v0.11.1 [INFO] [stderr] Compiling borsh-derive v0.10.4 [INFO] [stderr] Compiling ark-serialize-derive v0.4.2 [INFO] [stderr] Checking ark-std v0.4.0 [INFO] [stderr] Checking solana-type-overrides v2.2.7 [INFO] [stderr] Checking borsh v0.10.4 [INFO] [stderr] Checking solana-log-collector v2.2.7 [INFO] [stderr] Checking chrono v0.4.40 [INFO] [stderr] Checking enum-iterator v1.5.0 [INFO] [stderr] Compiling ark-ff-asm v0.4.2 [INFO] [stderr] Checking ark-serialize v0.4.2 [INFO] [stderr] Compiling borsh-derive v1.5.7 [INFO] [stderr] Compiling derivative v2.2.0 [INFO] [stderr] Checking solana-curve25519 v2.2.7 [INFO] [stderr] Checking serde_with v3.12.0 [INFO] [stderr] Checking icu_normalizer v1.5.0 [INFO] [stderr] Checking futures-executor v0.3.31 [INFO] [stderr] Checking solana-reward-info v2.2.1 [INFO] [stderr] Checking solana-commitment-config v2.2.1 [INFO] [stderr] Compiling zstd-sys v2.0.15+zstd.1.5.7 [INFO] [stderr] Compiling num_enum_derive v0.7.3 [INFO] [stderr] Checking idna_adapter v1.2.0 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Compiling rustls v0.21.12 [INFO] [stderr] Checking idna v1.0.3 [INFO] [stderr] Compiling async-trait v0.1.88 [INFO] [stderr] Checking signal-hook v0.3.17 [INFO] [stderr] Checking futures v0.3.31 [INFO] [stderr] Checking solana-serde v2.2.1 [INFO] [stderr] Checking url v2.5.4 [INFO] [stderr] Checking solana-hard-forks v2.2.1 [INFO] [stderr] Checking memmap2 v0.5.10 [INFO] [stderr] Compiling getrandom v0.3.2 [INFO] [stderr] Checking solana-poh-config v2.2.1 [INFO] [stderr] Checking solana-define-syscall v2.2.1 [INFO] [stderr] Checking solana-packet v2.2.1 [INFO] [stderr] Checking rustls-webpki v0.101.7 [INFO] [stderr] Checking sct v0.7.1 [INFO] [stderr] Checking num_enum v0.7.3 [INFO] [stderr] Checking solana-epoch-info v2.2.1 [INFO] [stderr] Compiling nix v0.29.0 [INFO] [stderr] Compiling portable-atomic v1.11.0 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking nom v7.1.3 [INFO] [stderr] Compiling ark-ff-macros v0.4.2 [INFO] [stderr] Compiling synstructure v0.12.6 [INFO] [stderr] Checking tokio-util v0.7.14 [INFO] [stderr] Checking async-compression v0.4.22 [INFO] [stderr] Checking env_logger v0.9.3 [INFO] [stderr] Compiling rustls v0.23.26 [INFO] [stderr] Compiling spl-discriminator-syn v0.2.0 [INFO] [stderr] Checking h2 v0.3.26 [INFO] [stderr] Checking rustls-webpki v0.103.1 [INFO] [stderr] Checking solana-logger v2.3.1 [INFO] [stderr] Checking borsh v1.5.7 [INFO] [stderr] Compiling asn1-rs-impl v0.1.0 [INFO] [stderr] Checking num_cpus v1.16.0 [INFO] [stderr] Compiling asn1-rs-derive v0.4.0 [INFO] [stderr] Checking task-local-extensions v0.1.4 [INFO] [stderr] Compiling qualifier_attr v0.2.2 [INFO] [stderr] Checking solana-rayon-threadlimit v2.2.7 [INFO] [stderr] Compiling spl-discriminator-derive v0.2.0 [INFO] [stderr] Checking rand_core v0.9.3 [INFO] [stderr] Checking jsonrpc-core v18.0.0 [INFO] [stderr] Compiling dlopen2_derive v0.3.0 [INFO] [stderr] Compiling solana-perf v2.2.7 [INFO] [stderr] Checking dashmap v5.5.3 [INFO] [stderr] Checking ark-ff v0.4.2 [INFO] [stderr] Checking solana-hash v2.2.1 [INFO] [stderr] Checking solana-secp256k1-recover v2.2.1 [INFO] [stderr] Checking solana-borsh v2.2.1 [INFO] [stderr] Checking solana-sha256-hasher v2.2.1 [INFO] [stderr] Checking solana-cluster-type v2.2.1 [INFO] [stderr] Checking solana-keccak-hasher v2.2.1 [INFO] [stderr] Checking solana-blake3-hasher v2.2.1 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Checking solana-pubkey v2.2.1 [INFO] [stderr] Checking solana-shred-version v2.2.1 [INFO] [stderr] Checking dlopen2 v0.5.0 [INFO] [stderr] Checking solana-net-utils v2.2.7 [INFO] [stderr] Checking rusticata-macros v4.1.0 [INFO] [stderr] Checking caps v0.5.5 [INFO] [stderr] Compiling quinn-udp v0.5.11 [INFO] [stderr] Checking console v0.15.11 [INFO] [stderr] Checking raw-cpuid v11.5.0 [INFO] [stderr] Checking rand v0.9.1 [INFO] [stderr] Checking asn1-rs v0.5.2 [INFO] [stderr] Checking tokio-rustls v0.24.1 [INFO] [stderr] Compiling quinn v0.11.7 [INFO] [stderr] Compiling rustix v1.0.5 [INFO] [stderr] Checking solana-instruction v2.2.1 [INFO] [stderr] Checking solana-sdk-ids v2.2.1 [INFO] [stderr] Checking solana-feature-set-interface v4.0.0 [INFO] [stderr] Checking solana-nonce v2.2.1 [INFO] [stderr] Checking solana-timings v2.2.7 [INFO] [stderr] Checking solana-inline-spl v2.2.7 [INFO] [stderr] Checking solana-sbpf v0.10.0 [INFO] [stderr] Checking indicatif v0.17.11 [INFO] [stderr] Checking solana-sysvar-id v2.2.1 [INFO] [stderr] Checking solana-transaction-error v2.2.1 [INFO] [stderr] Checking solana-system-interface v1.0.0 [INFO] [stderr] Checking solana-program-error v2.2.1 [INFO] [stderr] Checking solana-epoch-schedule v2.2.1 [INFO] [stderr] Checking solana-clock v2.2.1 [INFO] [stderr] Checking solana-bincode v2.2.1 [INFO] [stderr] Checking solana-slot-hashes v2.2.1 [INFO] [stderr] Checking solana-serialize-utils v2.2.1 [INFO] [stderr] Checking solana-rent v2.2.1 [INFO] [stderr] Checking solana-slot-history v2.2.1 [INFO] [stderr] Checking solana-epoch-rewards v2.2.1 [INFO] [stderr] Checking solana-account-info v2.2.1 [INFO] [stderr] Checking solana-signer v2.2.1 [INFO] [stderr] Checking solana-last-restart-slot v2.2.1 [INFO] [stderr] Checking solana-feature-set v2.2.4 [INFO] [stderr] Checking solana-stable-layout v2.2.1 [INFO] [stderr] Checking agave-feature-set v2.2.7 [INFO] [stderr] Checking solana-program-entrypoint v2.2.1 [INFO] [stderr] Checking solana-cpi v2.2.1 [INFO] [stderr] Checking solana-instructions-sysvar v2.2.1 [INFO] [stderr] Checking solana-keypair v2.2.1 [INFO] [stderr] Checking solana-message v2.2.1 [INFO] [stderr] Checking solana-vote-interface v2.2.3 [INFO] [stderr] Checking solana-stake-interface v1.2.1 [INFO] [stderr] Checking solana-loader-v4-interface v2.2.1 [INFO] [stderr] Checking solana-loader-v3-interface v3.0.0 [INFO] [stderr] Checking solana-address-lookup-table-interface v2.2.2 [INFO] [stderr] Checking solana-zk-sdk v2.2.7 [INFO] [stderr] Checking solana-program-pack v2.2.1 [INFO] [stderr] Checking solana-loader-v2-interface v2.2.1 [INFO] [stderr] Checking solana-quic-definitions v2.2.1 [INFO] [stderr] Checking solana-version v2.2.7 [INFO] [stderr] Checking solana-ed25519-program v2.2.2 [INFO] [stderr] Checking solana-secp256k1-program v2.2.1 [INFO] [stderr] Checking solana-compute-budget-interface v2.2.1 [INFO] [stderr] Checking spl-discriminator v0.4.1 [INFO] [stderr] Checking der-parser v8.2.0 [INFO] [stderr] Checking oid-registry v0.6.1 [INFO] [stderr] Checking quanta v0.12.5 [INFO] [stderr] Checking solana-reserved-account-keys v2.2.1 [INFO] [stderr] Checking solana-presigner v2.2.1 [INFO] [stderr] Checking solana-offchain-message v2.2.1 [INFO] [stderr] Checking solana-rent-debits v2.2.1 [INFO] [stderr] Checking solana-fee-structure v2.2.1 [INFO] [stderr] Checking solana-example-mocks v2.2.1 [INFO] [stderr] Checking solana-epoch-rewards-hasher v2.2.1 [INFO] [stderr] Checking solana-sysvar v2.2.1 [INFO] [stderr] Compiling spl-program-error-derive v0.4.1 [INFO] [stderr] Checking webpki-roots v0.24.0 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Checking spinning_top v0.3.0 [INFO] [stderr] Checking solana-compute-budget v2.2.7 [INFO] [stderr] Compiling pin-project-internal v1.1.10 [INFO] [stderr] Checking x509-parser v0.14.0 [INFO] [stderr] Checking governor v0.6.3 [INFO] [stderr] Checking tokio-stream v0.1.17 [INFO] [stderr] Compiling bzip2-sys v0.1.13+1.0.8 [INFO] [stderr] Checking tungstenite v0.20.1 [INFO] [stderr] Checking solana-account v2.2.1 [INFO] [stderr] Checking rustls-platform-verifier v0.5.1 [INFO] [stderr] Compiling lz4-sys v1.11.1+lz4-1.10.0 [INFO] [stderr] Checking tokio-tungstenite v0.20.1 [INFO] [stderr] Checking agave-reserved-account-keys v2.2.7 [INFO] [stderr] Checking spl-memo v6.0.0 [INFO] [stderr] Checking solana-transaction-context v2.2.1 [INFO] [stderr] Checking solana-feature-gate-interface v2.2.1 [INFO] [stderr] Checking solana-genesis-config v2.2.1 [INFO] [stderr] Checking solana-nonce-account v2.2.1 [INFO] [stderr] Checking spl-pod v0.5.1 [INFO] [stderr] Checking solana-program v2.2.1 [INFO] [stderr] Checking quinn-proto v0.11.11 [INFO] [stderr] Checking spl-token-confidential-transfer-ciphertext-arithmetic v0.2.1 [INFO] [stderr] Compiling enum-ordinalize v3.1.15 [INFO] [stderr] Compiling modular-bitfield-impl v0.11.2 [INFO] [stderr] Checking spl-program-error v0.6.0 [INFO] [stderr] Checking spl-token v7.0.0 [INFO] [stderr] Checking solana-rent-collector v2.2.1 [INFO] [stderr] Checking thread_local v1.1.8 [INFO] [stderr] Checking spl-type-length-value v0.7.0 [INFO] [stderr] Checking solana-tls-utils v2.2.7 [INFO] [stderr] Checking spl-token-confidential-transfer-proof-extraction v0.2.1 [INFO] [stderr] Checking spl-token-group-interface v0.5.0 [INFO] [stderr] Checking predicates-core v1.0.9 [INFO] [stderr] Compiling educe v0.4.23 [INFO] [stderr] Checking spl-tlv-account-resolution v0.9.0 [INFO] [stderr] Checking spl-token-metadata-interface v0.6.0 [INFO] [stderr] Checking spl-elgamal-registry v0.1.1 [INFO] [stderr] Checking tracing-subscriber v0.3.19 [INFO] [stderr] Checking pin-project v1.1.10 [INFO] [stderr] Checking opentelemetry v0.17.0 [INFO] [stderr] Checking solana-zk-token-sdk v2.2.7 [INFO] [stderr] Checking filetime v0.2.25 [INFO] [stderr] Checking float-cmp v0.9.0 [INFO] [stderr] Checking spl-transfer-hook-interface v0.9.0 [INFO] [stderr] Checking bitmaps v2.1.0 [INFO] [stderr] Compiling include_dir_macros v0.7.4 [INFO] [stderr] Compiling proc-macro-error-attr2 v2.0.0 [INFO] [stderr] Checking termtree v0.5.1 [INFO] [stderr] Checking tempfile v3.19.1 [INFO] [stderr] Checking xattr v1.5.0 [INFO] [stderr] Checking hyper v0.14.32 [INFO] [stderr] Checking difflib v0.4.0 [INFO] [stderr] Compiling proc-macro-error2 v2.0.1 [INFO] [stderr] Compiling include_dir v0.7.4 [INFO] [stderr] Checking tar v0.4.44 [INFO] [stderr] Checking predicates v2.1.5 [INFO] [stderr] Checking modular-bitfield v0.11.2 [INFO] [stderr] Checking sized-chunks v0.6.5 [INFO] [stderr] Checking tokio-serde v0.8.0 [INFO] [stderr] Checking predicates-tree v1.0.12 [INFO] [stderr] Compiling strum_macros v0.24.3 [INFO] [stderr] Checking bzip2 v0.4.4 [INFO] [stderr] Checking tracing-opentelemetry v0.17.4 [INFO] [stderr] Checking spl-token-confidential-transfer-proof-generation v0.3.0 [INFO] [stderr] Checking solana-bucket-map v2.2.7 [INFO] [stderr] Checking spl-token-confidential-transfer-proof-generation v0.2.0 [INFO] [stderr] Checking tokio-util v0.6.10 [INFO] [stderr] Compiling mockall_derive v0.11.4 [INFO] [stderr] Compiling tarpc-plugins v0.12.0 [INFO] [stderr] Checking solana-lattice-hash v2.2.7 [INFO] [stderr] Checking seqlock v0.2.0 [INFO] [stderr] Checking rand_xoshiro v0.6.0 [INFO] [stderr] Checking downcast v0.11.0 [INFO] [stderr] Checking index_list v0.2.15 [INFO] [stderr] Checking fragile v2.0.1 [INFO] [stderr] Checking solana-nohash-hasher v0.2.1 [INFO] [stderr] Checking spl-token-2022 v6.0.0 [INFO] [stderr] Checking spl-token-2022 v7.0.0 [INFO] [stderr] Checking dir-diff v0.3.3 [INFO] [stderr] Checking spl-associated-token-account-client v2.0.0 [INFO] [stderr] Checking Inflector v0.11.4 [INFO] [stderr] Compiling scroll_derive v0.11.1 [INFO] [stderr] Checking dirs-sys v0.3.7 [INFO] [stderr] Checking im v15.1.0 [INFO] [stderr] Checking is-terminal v0.4.16 [INFO] [stderr] Compiling aquamarine v0.6.0 [INFO] [stderr] Checking solana-sbpf v0.11.0 [INFO] [stderr] Checking env_logger v0.10.2 [INFO] [stderr] Checking tarpc v0.29.0 [INFO] [stderr] Checking dirs v4.0.0 [INFO] [stderr] Checking chrono-humanize v0.2.3 [INFO] [stderr] Checking strum v0.24.1 [INFO] [stderr] Checking scroll v0.11.0 [INFO] [stderr] Checking goblin v0.6.1 [INFO] [stderr] Checking ark-poly v0.4.2 [INFO] [stderr] Checking spl-associated-token-account v6.0.0 [INFO] [stderr] Checking mockall v0.11.4 [INFO] [stderr] Checking ark-ec v0.4.2 [INFO] [stderr] Compiling zstd-safe v7.2.4 [INFO] [stderr] Checking hyper-rustls v0.24.2 [INFO] [stderr] Checking zstd v0.13.3 [INFO] [stderr] Checking solana-account-decoder-client-types v2.2.7 [INFO] [stderr] Checking ark-bn254 v0.4.0 [INFO] [stderr] Checking solana-bn254 v2.2.2 [INFO] [stderr] Checking light-poseidon v0.2.0 [INFO] [stderr] Checking solana-poseidon v2.2.7 [INFO] [stderr] Checking lz4 v1.28.1 [INFO] [stderr] Compiling native-tls v0.2.14 [INFO] [stderr] Checking solana-secp256r1-program v2.2.2 [INFO] [stderr] Checking solana-precompiles v2.2.1 [INFO] [stderr] Checking agave-precompiles v2.2.7 [INFO] [stderr] Checking tokio-native-tls v0.3.1 [INFO] [stderr] Checking solana-transaction v2.2.2 [INFO] [stderr] Checking hyper-tls v0.5.0 [INFO] [stderr] Checking reqwest v0.11.27 [INFO] [stderr] Checking solana-client-traits v2.2.1 [INFO] [stderr] Checking solana-transaction-status-client-types v2.2.7 [INFO] [stderr] Checking solana-svm-transaction v2.2.7 [INFO] [stderr] Checking solana-system-transaction v2.2.1 [INFO] [stderr] Checking solana-sdk v2.2.2 [INFO] [stderr] Checking agave-transaction-view v2.2.7 [INFO] [stderr] Checking solana-vote v2.2.7 [INFO] [stderr] Checking solana-fee v2.2.7 [INFO] [stderr] Checking solana-svm-rent-collector v2.2.7 [INFO] [stderr] Checking solana-banks-interface v2.2.7 [INFO] [stderr] Checking solana-banks-client v2.2.7 [INFO] [stderr] Checking solana-metrics v2.2.7 [INFO] [stderr] Checking reqwest-middleware v0.2.5 [INFO] [stderr] Checking solana-rpc-client-api v2.2.7 [INFO] [stderr] Checking solana-program-runtime v2.2.7 [INFO] [stderr] Checking solana-connection-cache v2.2.7 [INFO] [stderr] Checking solana-accounts-db v2.2.7 [INFO] [stderr] Checking solana-config-program v2.2.7 [INFO] [stderr] Checking solana-bpf-loader-program v2.2.7 [INFO] [stderr] Checking solana-vote-program v2.2.7 [INFO] [stderr] Checking solana-system-program v2.2.7 [INFO] [stderr] Checking solana-compute-budget-program v2.2.7 [INFO] [stderr] Checking solana-address-lookup-table-program v2.2.7 [INFO] [stderr] Checking solana-zk-token-proof-program v2.2.7 [INFO] [stderr] Checking solana-zk-elgamal-proof-program v2.2.7 [INFO] [stderr] Checking solana-transaction-metrics-tracker v2.2.7 [INFO] [stderr] Checking solana-streamer v2.2.7 [INFO] [stderr] Checking solana-stake-program v2.2.7 [INFO] [stderr] Checking solana-account-decoder v2.2.7 [INFO] [stderr] Checking solana-udp-client v2.2.7 [INFO] [stderr] Checking solana-loader-v4-program v2.2.7 [INFO] [stderr] Checking solana-builtins-default-costs v2.2.7 [INFO] [stderr] Checking solana-builtins v2.2.7 [INFO] [stderr] Checking solana-rpc-client v2.2.7 [INFO] [stderr] Checking solana-pubsub-client v2.2.7 [INFO] [stderr] Checking solana-quic-client v2.2.7 [INFO] [stderr] Checking solana-compute-budget-instruction v2.2.7 [INFO] [stderr] Checking solana-transaction-status v2.2.7 [INFO] [stderr] Checking solana-runtime-transaction v2.2.7 [INFO] [stderr] Checking solana-svm v2.2.7 [INFO] [stderr] Checking solana-cost-model v2.2.7 [INFO] [stderr] Checking solana-unified-scheduler-logic v2.2.7 [INFO] [stderr] Checking solana-thin-client v2.2.7 [INFO] [stderr] Checking solana-rpc-client-nonce-utils v2.2.7 [INFO] [stderr] Checking solana-tpu-client v2.2.7 [INFO] [stderr] Checking solana-runtime v2.2.7 [INFO] [stderr] Checking solana-client v2.2.7 [INFO] [stderr] Checking solana-idl-extractor v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused imports: `Context` and `anyhow` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:7:22 [INFO] [stdout] | [INFO] [stdout] 7 | use anyhow::{Result, anyhow, Context}; [INFO] [stdout] | ^^^^^^ ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `debug` and `info` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:8:11 [INFO] [stdout] | [INFO] [stdout] 8 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `is_load`, `is_store`, and `mem_size` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | mem_size, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 30 | is_load, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 31 | is_store, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AnchorDiscriminator` and `DiscriminatorKind` [INFO] [stdout] --> src/analyzer/bytecode/account_analyzer.rs:6:38 [INFO] [stdout] | [INFO] [stdout] 6 | use super::discriminator_detection::{AnchorDiscriminator, DiscriminatorKind}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `VecDeque` [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:5:33 [INFO] [stdout] | [INFO] [stdout] 5 | use std::collections::{HashSet, VecDeque}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `analyze_control_flow` and `call_target` [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:9:20 [INFO] [stdout] | [INFO] [stdout] 9 | branch_target, call_target, analyze_control_flow, find_function_boundaries [INFO] [stdout] | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `debug`, `info`, and `warn` [INFO] [stdout] --> src/analyzer/bytecode/discriminator_detection.rs:4:11 [INFO] [stdout] | [INFO] [stdout] 4 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^^ ^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `ANCHOR_ACCOUNT_NAMESPACE`, `ANCHOR_DISCRIMINATOR_LENGTH`, `ANCHOR_DISCRIMINATOR_NAMESPACE`, and `anchor` [INFO] [stdout] --> src/analyzer/bytecode/discriminator_detection.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | anchor, spl_token, system_program, program_ids, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 10 | ANCHOR_DISCRIMINATOR_LENGTH, ANCHOR_DISCRIMINATOR_NAMESPACE, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 11 | ANCHOR_ACCOUNT_NAMESPACE [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `extract_discriminator_values` and `is_anchor_instruction_validation` [INFO] [stdout] --> src/analyzer/bytecode/discriminator_detection.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | is_anchor_instruction_validation, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 16 | extract_discriminator_values, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `debug` [INFO] [stdout] --> src/analyzer/bytecode/disassembler.rs:4:11 [INFO] [stdout] | [INFO] [stdout] 4 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `analyze_error_handling` [INFO] [stdout] --> src/analyzer/bytecode/error_analyzer.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | analyze_error_handling, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `debug` and `info` [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:4:11 [INFO] [stdout] | [INFO] [stdout] 4 | use log::{debug, info}; [INFO] [stdout] | ^^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty lines after doc comment [INFO] [stdout] --> src/analyzer/bytecode/heuristics.rs:47:1 [INFO] [stdout] | [INFO] [stdout] 47 | / /// - Obfuscated programs may intentionally hide instruction boundaries [INFO] [stdout] 48 | | [INFO] [stdout] 49 | | /// # Account Detection Heuristics [INFO] [stdout] 50 | | /// [INFO] [stdout] ... | [INFO] [stdout] 121 | | [INFO] [stdout] | |_^ [INFO] [stdout] 122 | pub fn _dummy() {} [INFO] [stdout] | ------------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty lines are unintentional, remove them [INFO] [stdout] help: if the doc comment should not document function `_dummy` then comment it out [INFO] [stdout] | [INFO] [stdout] 19 ~ // /// # Instruction Detection Heuristics [INFO] [stdout] 20 ~ // /// [INFO] [stdout] 21 ~ // /// The following heuristics are used to detect instructions in program bytecode: [INFO] [stdout] 22 ~ // /// [INFO] [stdout] 23 ~ // /// 1. **Function Entry Points**: We identify potential function entry points by looking for: [INFO] [stdout] 24 ~ // /// - Function prologues (stack setup instructions) [INFO] [stdout] 25 ~ // /// - References from the instruction dispatch table [INFO] [stdout] 26 ~ // /// - Call instructions targeting these addresses [INFO] [stdout] 27 ~ // /// [INFO] [stdout] 28 ~ // /// 2. **Discriminator Detection**: For Anchor programs, we look for: [INFO] [stdout] 29 ~ // /// - 8-byte discriminator comparisons at the beginning of functions [INFO] [stdout] 30 ~ // /// - Anchor-style discriminator generation patterns (Sha256 of "instruction:X") [INFO] [stdout] 31 ~ // /// [INFO] [stdout] 32 ~ // /// 3. **Instruction Boundaries**: We determine instruction boundaries by: [INFO] [stdout] 33 ~ // /// - Analyzing the control flow graph [INFO] [stdout] 34 ~ // /// - Identifying dispatch table patterns [INFO] [stdout] 35 ~ // /// - Looking for switch/case patterns on the first byte of instruction data [INFO] [stdout] 36 ~ // /// [INFO] [stdout] 37 ~ // /// ## Assumptions [INFO] [stdout] 38 ~ // /// [INFO] [stdout] 39 ~ // /// - Programs follow common Solana patterns for instruction dispatch [INFO] [stdout] 40 ~ // /// - Anchor programs use the standard 8-byte discriminator pattern [INFO] [stdout] 41 ~ // /// - Native programs typically use a single byte as instruction code [INFO] [stdout] 42 ~ // /// [INFO] [stdout] 43 ~ // /// ## Limitations [INFO] [stdout] 44 ~ // /// [INFO] [stdout] 45 ~ // /// - Custom dispatch mechanisms might not be detected [INFO] [stdout] 46 ~ // /// - Heavily optimized code may confuse the boundary detection [INFO] [stdout] 47 ~ // /// - Obfuscated programs may intentionally hide instruction boundaries [INFO] [stdout] 48 | [INFO] [stdout] 49 ~ // /// # Account Detection Heuristics [INFO] [stdout] 50 ~ // /// [INFO] [stdout] 51 ~ // /// The following heuristics are used to detect accounts and their properties: [INFO] [stdout] 52 ~ // /// [INFO] [stdout] 53 ~ // /// 1. **Account References**: We identify accounts by looking for: [INFO] [stdout] 54 ~ // /// - References to the accounts array parameter [INFO] [stdout] 55 ~ // /// - Index-based access patterns (accounts[i]) [INFO] [stdout] 56 ~ // /// - Anchor-style account deserialization [INFO] [stdout] 57 ~ // /// [INFO] [stdout] 58 ~ // /// 2. **Account Properties**: We determine account properties by: [INFO] [stdout] 59 ~ // /// - Analyzing is_signer and is_writable checks [INFO] [stdout] 60 ~ // /// - Looking for owner checks (AccountInfo::owner) [INFO] [stdout] 61 ~ // /// - Identifying PDA derivation patterns [INFO] [stdout] 62 ~ // /// [INFO] [stdout] 63 ~ // /// 3. **Account Structures**: We infer account data structures by: [INFO] [stdout] 64 ~ // /// - Analyzing memory access patterns to account data [INFO] [stdout] 65 ~ // /// - Looking for deserialization code patterns [INFO] [stdout] 66 ~ // /// - Identifying Anchor account discriminators [INFO] [stdout] 67 ~ // /// [INFO] [stdout] 68 ~ // /// ## Assumptions [INFO] [stdout] 69 ~ // /// [INFO] [stdout] 70 ~ // /// - Programs follow standard Solana patterns for account validation [INFO] [stdout] 71 ~ // /// - Account data follows common serialization patterns [INFO] [stdout] 72 ~ // /// - Programs check account constraints before using them [INFO] [stdout] 73 ~ // /// [INFO] [stdout] 74 ~ // /// ## Limitations [INFO] [stdout] 75 ~ // /// [INFO] [stdout] 76 ~ // /// - Custom validation logic may not be detected [INFO] [stdout] 77 ~ // /// - Complex account relationships might be missed [INFO] [stdout] 78 ~ // /// - Dynamic account usage patterns are difficult to analyze statically [INFO] [stdout] 79 | [INFO] [stdout] 80 ~ // /// # String Analysis Heuristics [INFO] [stdout] 81 ~ // /// [INFO] [stdout] 82 ~ // /// The following heuristics are used to extract meaningful names: [INFO] [stdout] 83 ~ // /// [INFO] [stdout] 84 ~ // /// 1. **Name Extraction**: We extract potential names from: [INFO] [stdout] 85 ~ // /// - String literals in the .rodata section [INFO] [stdout] 86 ~ // /// - Error messages and debug prints [INFO] [stdout] 87 ~ // /// - Anchor discriminator strings [INFO] [stdout] 88 ~ // /// [INFO] [stdout] 89 ~ // /// 2. **Name Classification**: We classify strings as: [INFO] [stdout] 90 ~ // /// - Instruction names (verb-based, command-like) [INFO] [stdout] 91 ~ // /// - Account names (noun-based, entity-like) [INFO] [stdout] 92 ~ // /// - Field names (property-like, attribute-like) [INFO] [stdout] 93 ~ // /// [INFO] [stdout] 94 ~ // /// 3. **Name Matching**: We match names to program elements by: [INFO] [stdout] 95 ~ // /// - Proximity in the binary [INFO] [stdout] 96 ~ // /// - Usage patterns in the code [INFO] [stdout] 97 ~ // /// - Similarity to common Solana naming patterns [INFO] [stdout] 98 ~ // /// [INFO] [stdout] 99 ~ // /// ## Assumptions [INFO] [stdout] 100 ~ // /// [INFO] [stdout] 101 ~ // /// - Programs contain meaningful string literals [INFO] [stdout] 102 ~ // /// - Names follow common programming conventions [INFO] [stdout] 103 ~ // /// - Similar functionality has similar naming across programs [INFO] [stdout] 104 ~ // /// [INFO] [stdout] 105 ~ // /// ## Limitations [INFO] [stdout] 106 ~ // /// [INFO] [stdout] 107 ~ // /// - Stripped binaries contain few or no strings [INFO] [stdout] 108 ~ // /// - Generic names may be misclassified [INFO] [stdout] 109 ~ // /// - Names might be misleading or intentionally obfuscated [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Context` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:31:22 [INFO] [stdout] | [INFO] [stdout] 31 | use anyhow::{Result, Context, anyhow}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `debug` and `warn` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:32:11 [INFO] [stdout] | [INFO] [stdout] 32 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `get_instruction_frequency` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:46:107 [INFO] [stdout] | [INFO] [stdout] 46 | ...DynamicAnalysisResult, get_account_access_patterns, get_instruction_frequency, AccessType}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ErrorAnalysis` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:47:57 [INFO] [stdout] | [INFO] [stdout] 47 | use crate::utils::error_analysis::{extract_error_codes, ErrorAnalysis}; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `info` and `warn` [INFO] [stdout] --> src/analyzer/patterns.rs:4:18 [INFO] [stdout] | [INFO] [stdout] 4 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `UiTransactionEncoding` [INFO] [stdout] --> src/analyzer/patterns.rs:6:33 [INFO] [stdout] | [INFO] [stdout] 6 | use solana_transaction_status::{UiTransactionEncoding, TransactionBinaryEncoding, UiMessage, UiInstruction, UiCompiledInstruction, Ui... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::models::instruction::Instruction` [INFO] [stdout] --> src/analyzer/patterns.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use crate::models::instruction::Instruction; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `BTreeMap` and `HashSet` [INFO] [stdout] --> src/analyzer/patterns.rs:11:33 [INFO] [stdout] | [INFO] [stdout] 11 | use std::collections::{HashMap, HashSet, BTreeMap}; [INFO] [stdout] | ^^^^^^^ ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/analyzer/patterns.rs:309:12 [INFO] [stdout] | [INFO] [stdout] 309 | if offset + 1 <= data.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `offset < data.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] = note: `#[warn(clippy::int_plus_one)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/analyzer/patterns.rs:634:12 [INFO] [stdout] | [INFO] [stdout] 634 | if offset + 1 <= first_sample.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `offset < first_sample.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `debug` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:3:11 [INFO] [stdout] | [INFO] [stdout] 3 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Serialize` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:5:13 [INFO] [stdout] | [INFO] [stdout] 5 | use serde::{Serialize, Deserialize}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `HashSet` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:7:33 [INFO] [stdout] | [INFO] [stdout] 7 | use std::collections::{HashMap, HashSet}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Sha256` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 10 | use sha2::{Sha256, Digest}; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ErrorExt` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:26:54 [INFO] [stdout] | [INFO] [stdout] 26 | use crate::errors::{ExtractorError, ExtractorResult, ErrorExt, ErrorContext}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `solana_sbpf::insn_builder::Instruction` [INFO] [stdout] --> src/analyzer/mod.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | use solana_sbpf::insn_builder::Instruction; // use this instead for impl on l107 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/monitor/transaction.rs:178:12 [INFO] [stdout] | [INFO] [stdout] 178 | if offset + 1 <= first_sample.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `offset < first_sample.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/monitor/transaction.rs:391:8 [INFO] [stdout] | [INFO] [stdout] 391 | if offset + 1 <= data_samples[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `offset < data_samples[0].len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/monitor/transaction.rs:449:8 [INFO] [stdout] | [INFO] [stdout] 449 | if offset + 1 <= data_samples[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `offset < data_samples[0].len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fs` [INFO] [stdout] --> src/generator/mod.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use std::fs; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `debug` and `error` [INFO] [stdout] --> src/generator/mod.rs:13:17 [INFO] [stdout] | [INFO] [stdout] 13 | use log::{info, debug, error}; [INFO] [stdout] | ^^^^^ ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Path` [INFO] [stdout] --> src/cache/mod.rs:4:17 [INFO] [stdout] | [INFO] [stdout] 4 | use std::path::{Path, PathBuf}; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `warn` [INFO] [stdout] --> src/cache/mod.rs:8:18 [INFO] [stdout] | [INFO] [stdout] 8 | use log::{debug, warn}; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Context`, `Result`, and `anyhow` [INFO] [stdout] --> src/utils/transaction_parser.rs:8:14 [INFO] [stdout] | [INFO] [stdout] 8 | use anyhow::{Result, anyhow, Context}; [INFO] [stdout] | ^^^^^^ ^^^^^^ ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `info` [INFO] [stdout] --> src/utils/transaction_parser.rs:9:18 [INFO] [stdout] | [INFO] [stdout] 9 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `solana_instruction::Instruction` [INFO] [stdout] --> src/utils/transaction_parser.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | use solana_instruction::Instruction; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ErrorExt` [INFO] [stdout] --> src/utils/transaction_parser.rs:21:54 [INFO] [stdout] | [INFO] [stdout] 21 | use crate::errors::{ExtractorError, ExtractorResult, ErrorExt, ErrorContext}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `solana_sbpf::static_analysis::Analysis` [INFO] [stdout] --> src/utils/account_analysis.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use solana_sbpf::static_analysis::Analysis; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `HashSet` [INFO] [stdout] --> src/utils/dynamic_analysis.rs:10:33 [INFO] [stdout] | [INFO] [stdout] 10 | use std::collections::{HashMap, HashSet}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated associated function `solana_hash::Hash::new`: Use 'Hash::new_from_array' instead [INFO] [stdout] --> src/analyzer/simulation/mod.rs:193:39 [INFO] [stdout] | [INFO] [stdout] 193 | tx.sign(&[&self.payer], Hash::new(&recent_blockhash)); [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(deprecated)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Digest` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:10:20 [INFO] [stdout] | [INFO] [stdout] 10 | use sha2::{Sha256, Digest}; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `pc` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:703:10 [INFO] [stdout] | [INFO] [stdout] 703 | for (pc, insn) in analysis.instructions.iter().enumerate() { [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_pc` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `instructions` [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:109:5 [INFO] [stdout] | [INFO] [stdout] 109 | instructions: &[SbfInstruction], [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_instructions` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `instructions` [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:192:5 [INFO] [stdout] | [INFO] [stdout] 192 | instructions: &[SbfInstruction], [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_instructions` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `functions` [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:194:5 [INFO] [stdout] | [INFO] [stdout] 194 | functions: &[Function], [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_functions` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/analyzer/bytecode/account_analyzer.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 104 | analysis: &Analysis, [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `instructions` [INFO] [stdout] --> src/analyzer/bytecode/account_analyzer.rs:105:5 [INFO] [stdout] | [INFO] [stdout] 105 | instructions: &[SbfInstruction] [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_instructions` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:241:49 [INFO] [stdout] | [INFO] [stdout] 241 | fn connect_blocks(blocks: &mut Vec, analysis: &Analysis) { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `program_id` [INFO] [stdout] --> src/analyzer/bytecode/disassembler.rs:349:5 [INFO] [stdout] | [INFO] [stdout] 349 | program_id: &str, [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_program_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `entry_point` [INFO] [stdout] --> src/analyzer/bytecode/disassembler.rs:390:24 [INFO] [stdout] | [INFO] [stdout] 390 | for (i, (name, entry_point)) in disassembled.functions.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_entry_point` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `program_id` [INFO] [stdout] --> src/analyzer/bytecode/disassembler.rs:513:5 [INFO] [stdout] | [INFO] [stdout] 513 | program_id: &str, [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_program_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/analyzer/bytecode/error_analyzer.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | analysis: &Analysis [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `program_id` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:115:5 [INFO] [stdout] | [INFO] [stdout] 115 | program_id: &str, [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_program_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `boundary` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:480:18 [INFO] [stdout] | [INFO] [stdout] 480 | for (i, &boundary) in boundaries.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_boundary` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `context` [INFO] [stdout] --> src/analyzer/patterns.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | let context = ErrorContext { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_context` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/analyzer/patterns.rs:171:21 [INFO] [stdout] | [INFO] [stdout] 171 | _ => { [INFO] [stdout] | ^ no value can reach this [INFO] [stdout] | [INFO] [stdout] note: multiple earlier patterns match some of the same values [INFO] [stdout] --> src/analyzer/patterns.rs:171:21 [INFO] [stdout] | [INFO] [stdout] 161 | TransactionBinaryEncoding::Base58 => { [INFO] [stdout] | --------------------------------- matches some of the same values [INFO] [stdout] ... [INFO] [stdout] 166 | TransactionBinaryEncoding::Base64 => { [INFO] [stdout] | --------------------------------- matches some of the same values [INFO] [stdout] ... [INFO] [stdout] 171 | _ => { [INFO] [stdout] | ^ collectively making this unreachable [INFO] [stdout] = note: `#[warn(unreachable_patterns)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `err` [INFO] [stdout] --> src/analyzer/patterns.rs:143:45 [INFO] [stdout] | [INFO] [stdout] 143 | ... Err(err) => { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_err` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `program_id` [INFO] [stdout] --> src/analyzer/patterns.rs:187:40 [INFO] [stdout] | [INFO] [stdout] 187 | fn extract_from_binary(tx_data: &[u8], program_id: &Pubkey, instruction_data: &mut Vec>) -> ExtractorResult<()> { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_program_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `discriminator` [INFO] [stdout] --> src/analyzer/patterns.rs:394:41 [INFO] [stdout] | [INFO] [stdout] 394 | ... let discriminator = extract_discriminator_raw(instruction); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_discriminator` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `accounts` [INFO] [stdout] --> src/analyzer/patterns.rs:397:41 [INFO] [stdout] | [INFO] [stdout] 397 | ... let accounts = instruction.accounts.iter() [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_accounts` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `parsed_instruction` [INFO] [stdout] --> src/analyzer/patterns.rs:445:45 [INFO] [stdout] | [INFO] [stdout] 445 | UiParsedInstruction::Parsed(parsed_instruction) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_parsed_instruction` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `total_readonly` [INFO] [stdout] --> src/analyzer/patterns.rs:502:17 [INFO] [stdout] | [INFO] [stdout] 502 | let total_readonly = num_readonly_signed + num_readonly_unsigned; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_total_readonly` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `discriminator` [INFO] [stdout] --> src/analyzer/patterns.rs:531:10 [INFO] [stdout] | [INFO] [stdout] 531 | for (discriminator, data_group) in grouped_data { [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_discriminator` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `discriminator` [INFO] [stdout] --> src/analyzer/patterns.rs:719:41 [INFO] [stdout] | [INFO] [stdout] 719 | ... let discriminator = extract_discriminator_raw(instruction); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_discriminator` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `accounts` [INFO] [stdout] --> src/analyzer/patterns.rs:722:41 [INFO] [stdout] | [INFO] [stdout] 722 | ... let accounts = instruction.accounts.iter() [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_accounts` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `transactions` [INFO] [stdout] --> src/analyzer/patterns.rs:763:5 [INFO] [stdout] | [INFO] [stdout] 763 | transactions: &[solana_transaction_status::EncodedTransaction], [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_transactions` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `transaction` [INFO] [stdout] --> src/analyzer/patterns.rs:1052:5 [INFO] [stdout] | [INFO] [stdout] 1052 | transaction: &solana_transaction_status::EncodedTransaction, [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_transaction` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `account_idx` [INFO] [stdout] --> src/analyzer/patterns.rs:1053:5 [INFO] [stdout] | [INFO] [stdout] 1053 | account_idx: usize [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_account_idx` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `context` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:158:13 [INFO] [stdout] | [INFO] [stdout] 158 | let context = ErrorContext { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_context` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `program_id` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:715:46 [INFO] [stdout] | [INFO] [stdout] 715 | async fn try_simulate_instruction(&self, program_id: &Pubkey, instruction_data: &[u8]) -> Result { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_program_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `instruction_data` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:715:67 [INFO] [stdout] | [INFO] [stdout] 715 | async fn try_simulate_instruction(&self, program_id: &Pubkey, instruction_data: &[u8]) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_instruction_data` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `pattern_analysis` [INFO] [stdout] --> src/analyzer/mod.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | pattern_analysis: PatternAnalysis // TODO: use this to further enrich the IDL [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_pattern_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `frequency` [INFO] [stdout] --> src/monitor/transaction.rs:70:42 [INFO] [stdout] | [INFO] [stdout] 70 | for (i, (is_signer, is_writable, frequency)) in accounts.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_frequency` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/utils/error_analysis.rs:69:65 [INFO] [stdout] | [INFO] [stdout] 69 | fn infer_error_name(code: u32, instructions: &[SbfInstruction], analysis: &Analysis) -> String { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/utils/error_analysis.rs:152:5 [INFO] [stdout] | [INFO] [stdout] 152 | analysis: &Analysis [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `version` [INFO] [stdout] --> src/utils/error_analysis.rs:214:5 [INFO] [stdout] | [INFO] [stdout] 214 | version: SBPFVersion [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_version` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `version` [INFO] [stdout] --> src/utils/dynamic_analysis.rs:83:5 [INFO] [stdout] | [INFO] [stdout] 83 | version: SBPFVersion, [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_version` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `config` [INFO] [stdout] --> src/utils/dynamic_analysis.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 84 | config: &Config, [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_config` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `program_pubkey` [INFO] [stdout] --> src/utils/mod.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | program_pubkey: &Pubkey, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_program_pubkey` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `extract_anchor_instructions` is never used [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:345:4 [INFO] [stdout] | [INFO] [stdout] 345 | fn extract_anchor_instructions( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `extract_native_instructions` is never used [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:434:4 [INFO] [stdout] | [INFO] [stdout] 434 | fn extract_native_instructions( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `find_block_containing` is never used [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:280:4 [INFO] [stdout] | [INFO] [stdout] 280 | fn find_block_containing(pc: usize, blocks: &[BasicBlock]) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `add_standard_error_codes` is never used [INFO] [stdout] --> src/analyzer/bytecode/error_analyzer.rs:97:4 [INFO] [stdout] | [INFO] [stdout] 97 | fn add_standard_error_codes(error_codes: &mut HashMap) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `infer_error_name` is never used [INFO] [stdout] --> src/analyzer/bytecode/error_analyzer.rs:122:4 [INFO] [stdout] | [INFO] [stdout] 122 | fn infer_error_name(code: u32, instructions: &[SbfInstruction]) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `position` is never read [INFO] [stdout] --> src/analyzer/patterns.rs:1047:9 [INFO] [stdout] | [INFO] [stdout] 1039 | struct TransactionAccount { [INFO] [stdout] | ------------------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 1047 | pub position: usize, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `TransactionAccount` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `id` and `jsonrpc` are never read [INFO] [stdout] --> src/analyzer/simulation/mod.rs:63:5 [INFO] [stdout] | [INFO] [stdout] 61 | struct SimulateResponse { [INFO] [stdout] | ---------------- fields in this struct [INFO] [stdout] 62 | result: SimulateResult, [INFO] [stdout] 63 | id: u64, [INFO] [stdout] | ^^ [INFO] [stdout] 64 | jsonrpc: String, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `SimulateResponse` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `context` is never read [INFO] [stdout] --> src/analyzer/simulation/mod.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 69 | struct SimulateResult { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] 70 | context: RpcContext, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `SimulateResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `slot` is never read [INFO] [stdout] --> src/analyzer/simulation/mod.rs:77:5 [INFO] [stdout] | [INFO] [stdout] 76 | struct RpcContext { [INFO] [stdout] | ---------- field in this struct [INFO] [stdout] 77 | slot: u64, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RpcContext` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `executable`, `lamports`, and `rent_epoch` are never read [INFO] [stdout] --> src/analyzer/simulation/mod.rs:93:5 [INFO] [stdout] | [INFO] [stdout] 91 | struct AccountInfo { [INFO] [stdout] | ----------- fields in this struct [INFO] [stdout] 92 | data: Vec, [INFO] [stdout] 93 | executable: bool, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 94 | lamports: u64, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 95 | owner: String, [INFO] [stdout] 96 | rent_epoch: u64, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `AccountInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `extract_instruction_from_transaction` is never used [INFO] [stdout] --> src/analyzer/simulation/mod.rs:755:4 [INFO] [stdout] | [INFO] [stdout] 755 | fn extract_instruction_from_transaction(transaction_data: &[u8], program_id: &Pubkey) -> ExtractorResult { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `discriminator`, `account_patterns`, `data_patterns`, and `frequency` are never read [INFO] [stdout] --> src/monitor/transaction.rs:301:5 [INFO] [stdout] | [INFO] [stdout] 300 | struct TransactionPattern { [INFO] [stdout] | ------------------ fields in this struct [INFO] [stdout] 301 | discriminator: u8, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 302 | account_patterns: Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] 303 | data_patterns: Vec, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 304 | frequency: usize, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `TransactionPattern` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `index`, `is_signer`, `is_writable`, and `frequency` are never read [INFO] [stdout] --> src/monitor/transaction.rs:310:5 [INFO] [stdout] | [INFO] [stdout] 309 | struct AccountPattern { [INFO] [stdout] | -------------- fields in this struct [INFO] [stdout] 310 | index: usize, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 311 | is_signer: bool, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 312 | is_writable: bool, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] 313 | frequency: usize, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `AccountPattern` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `offset`, `size`, `type_hint`, and `frequency` are never read [INFO] [stdout] --> src/monitor/transaction.rs:319:5 [INFO] [stdout] | [INFO] [stdout] 318 | struct DataPattern { [INFO] [stdout] | ----------- fields in this struct [INFO] [stdout] 319 | offset: usize, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 320 | size: usize, [INFO] [stdout] | ^^^^ [INFO] [stdout] 321 | type_hint: String, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 322 | frequency: usize, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `DataPattern` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `generate_typescript` is never used [INFO] [stdout] --> src/generator/custom.rs:14:8 [INFO] [stdout] | [INFO] [stdout] 14 | pub fn generate_typescript(idl: &IDL) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `ts_type_for` is never used [INFO] [stdout] --> src/generator/custom.rs:47:4 [INFO] [stdout] | [INFO] [stdout] 47 | fn ts_type_for(ty: &str) -> &str { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `generate_typescript_with_patterns` is never used [INFO] [stdout] --> src/generator/custom.rs:59:4 [INFO] [stdout] | [INFO] [stdout] 59 | fn generate_typescript_with_patterns(idl: &IDL) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:112:21 [INFO] [stdout] | [INFO] [stdout] 112 | let class = (data[0] & 0x07) as u8; // bits 0-2 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `(data[0] & 0x07)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:383:17 [INFO] [stdout] | [INFO] [stdout] 383 | / if self.imm == 0 { [INFO] [stdout] 384 | | return Err("Division by zero".to_string()); [INFO] [stdout] 385 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 382 ~ opcodes::UDIV32_IMM | opcodes::UDIV64_IMM [INFO] [stdout] 383 ~ if self.imm == 0 => { [INFO] [stdout] 384 | return Err("Division by zero".to_string()); [INFO] [stdout] 385 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:388:17 [INFO] [stdout] | [INFO] [stdout] 388 | / if self.imm < 0 || self.imm >= 32 { [INFO] [stdout] 389 | | return Err(format!("Invalid 32-bit shift amount {}", self.imm)); [INFO] [stdout] 390 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 387 ~ opcodes::LSH32_IMM | opcodes::RSH32_IMM | opcodes::ARSH32_IMM [INFO] [stdout] 388 ~ if (self.imm < 0 || self.imm >= 32) => { [INFO] [stdout] 389 | return Err(format!("Invalid 32-bit shift amount {}", self.imm)); [INFO] [stdout] 390 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:393:17 [INFO] [stdout] | [INFO] [stdout] 393 | / if self.imm < 0 || self.imm >= 64 { [INFO] [stdout] 394 | | return Err(format!("Invalid 64-bit shift amount {}", self.imm)); [INFO] [stdout] 395 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 392 ~ opcodes::LSH64_IMM | opcodes::RSH64_IMM | opcodes::ARSH64_IMM [INFO] [stdout] 393 ~ if (self.imm < 0 || self.imm >= 64) => { [INFO] [stdout] 394 | return Err(format!("Invalid 64-bit shift amount {}", self.imm)); [INFO] [stdout] 395 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:447:18 [INFO] [stdout] | [INFO] [stdout] 447 | imm: insn.imm as i64, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `insn.imm` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:449:5 [INFO] [stdout] | [INFO] [stdout] 449 | / if instructions.len() >= 3 { [INFO] [stdout] 450 | | if instructions[0].is_load() && [INFO] [stdout] 451 | | instructions[0].mem_size() == Some(8) && [INFO] [stdout] 452 | | (instructions[1].opcode == opcodes::JEQ_REG || [INFO] [stdout] ... | [INFO] [stdout] 458 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 449 ~ if instructions.len() >= 3 [INFO] [stdout] 450 ~ && instructions[0].is_load() && [INFO] [stdout] 451 | instructions[0].mem_size() == Some(8) && [INFO] [stdout] ... [INFO] [stdout] 456 | return true; [INFO] [stdout] 457 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:588:9 [INFO] [stdout] | [INFO] [stdout] 588 | if !error_codes.contains_key(&2000) { error_codes.insert(2000, "ConstraintMut".to_string()); } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `error_codes.entry(2000).or_insert_with(|| "ConstraintMut".to_string());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:589:9 [INFO] [stdout] | [INFO] [stdout] 589 | if !error_codes.contains_key(&2001) { error_codes.insert(2001, "ConstraintHasOne".to_string()); } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `error_codes.entry(2001).or_insert_with(|| "ConstraintHasOne".to_string());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:590:9 [INFO] [stdout] | [INFO] [stdout] 590 | if !error_codes.contains_key(&2002) { error_codes.insert(2002, "ConstraintSigner".to_string()); } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `error_codes.entry(2002).or_insert_with(|| "ConstraintSigner".to_string());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:609:12 [INFO] [stdout] | [INFO] [stdout] 609 | if (code >= 2000 && code < 3000) && s.contains("Constraint") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(2000..3000).contains(&code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:613:12 [INFO] [stdout] | [INFO] [stdout] 613 | if (code >= 3000 && code < 4000) && s.contains("Account") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(3000..4000).contains(&code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:738:40 [INFO] [stdout] | [INFO] [stdout] 738 | let account_name = s[8..].to_string(); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:737:17 [INFO] [stdout] | [INFO] [stdout] 737 | if s.starts_with("account:") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 737 ~ if let Some() = s.strip_prefix("account:") { [INFO] [stdout] 738 ~ let account_name = .to_string(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/analyzer/bytecode/account_analyzer.rs:103:15 [INFO] [stdout] | [INFO] [stdout] 103 | accounts: &mut Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 103 - accounts: &mut Vec, [INFO] [stdout] 103 + accounts: &mut [Account], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:76:68 [INFO] [stdout] | [INFO] [stdout] 76 | let has_comparison = self.instructions.iter().take(10).any(|insn| [INFO] [stdout] | ____________________________________________________________________^ [INFO] [stdout] 77 | | is_conditional_branch(insn) [INFO] [stdout] | |_______________________________________^ help: replace the closure with the function itself: `is_conditional_branch` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:241:27 [INFO] [stdout] | [INFO] [stdout] 241 | fn connect_blocks(blocks: &mut Vec, analysis: &Analysis) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 241 - fn connect_blocks(blocks: &mut Vec, analysis: &Analysis) { [INFO] [stdout] 241 + fn connect_blocks(blocks: &mut [BasicBlock], analysis: &Analysis) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i16` -> `i16`) [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:253:37 [INFO] [stdout] | [INFO] [stdout] 253 | let target_offset = last_insn.offset as i16; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `last_insn.offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:267:28 [INFO] [stdout] | [INFO] [stdout] 267 | if source < target { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 268 | | // Add connection from source to target [INFO] [stdout] 269 | | blocks[source].successors.push(target); [INFO] [stdout] 270 | | blocks[target].predecessors.push(source); [INFO] [stdout] 271 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:271:16 [INFO] [stdout] | [INFO] [stdout] 271 | } else { [INFO] [stdout] | ________________^ [INFO] [stdout] 272 | | // Add connection from source to target [INFO] [stdout] 273 | | blocks[source].successors.push(target); [INFO] [stdout] 274 | | blocks[target].predecessors.push(source); [INFO] [stdout] 275 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:399:22 [INFO] [stdout] | [INFO] [stdout] 399 | (i > 0 && blocks[i-1].instructions.last().map_or(false, |insn| insn.opcode == opcodes::EXIT)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 399 - (i > 0 && blocks[i-1].instructions.last().map_or(false, |insn| insn.opcode == opcodes::EXIT)) { [INFO] [stdout] 399 + (i > 0 && blocks[i-1].instructions.last().is_some_and(|insn| insn.opcode == opcodes::EXIT)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:455:9 [INFO] [stdout] | [INFO] [stdout] 455 | / if insn.is_branch() || insn.is_return() { [INFO] [stdout] 456 | | if i + 1 < instructions.len() { [INFO] [stdout] 457 | | block_starts.insert(i + 1); [INFO] [stdout] 458 | | } [INFO] [stdout] 459 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 455 ~ if (insn.is_branch() || insn.is_return()) { [INFO] [stdout] 456 ~ && i + 1 < instructions.len() { [INFO] [stdout] 457 | block_starts.insert(i + 1); [INFO] [stdout] 458 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/analyzer/bytecode/discriminator_detection.rs:154:16 [INFO] [stdout] | [INFO] [stdout] 154 | if syscall_id >= 0x100000 && syscall_id <= 0x1FFFFFF { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x100000..=0x1FFFFFF).contains(&syscall_id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/analyzer/bytecode/disassembler.rs:299:53 [INFO] [stdout] | [INFO] [stdout] 299 | } else if insn.contains(" stw") { [INFO] [stdout] | _____________________________________________________^ [INFO] [stdout] 300 | | 4 [INFO] [stdout] 301 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/analyzer/bytecode/disassembler.rs:301:28 [INFO] [stdout] | [INFO] [stdout] 301 | } else { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 302 | | 4 // Default [INFO] [stdout] 303 | | }; [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/analyzer/bytecode/instruction_analyzer.rs:73:23 [INFO] [stdout] | [INFO] [stdout] 73 | .find(|d| d.code.map_or(false, |code| code as usize == i)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 73 - .find(|d| d.code.map_or(false, |code| code as usize == i)); [INFO] [stdout] 73 + .find(|d| d.code.is_some_and(|code| code as usize == i)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 8]` which implements the `Copy` trait [INFO] [stdout] --> src/analyzer/bytecode/instruction_analyzer.rs:91:46 [INFO] [stdout] | [INFO] [stdout] 91 | instruction.discriminator = Some(disc.bytes.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `disc.bytes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `instructions` [INFO] [stdout] --> src/analyzer/bytecode/error_analyzer.rs:51:14 [INFO] [stdout] | [INFO] [stdout] 51 | for i in start..end { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 51 - for i in start..end { [INFO] [stdout] 51 + for in instructions.iter().take(end).skip(start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:139:5 [INFO] [stdout] | [INFO] [stdout] 139 | confidence.max(0.0).min(1.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `confidence.clamp(0.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:183:8 [INFO] [stdout] | [INFO] [stdout] 183 | if name.chars().next().map_or(false, |c| c.is_uppercase()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 183 - if name.chars().next().map_or(false, |c| c.is_uppercase()) { [INFO] [stdout] 183 + if name.chars().next().is_some_and(|c| c.is_uppercase()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:188:5 [INFO] [stdout] | [INFO] [stdout] 188 | confidence.max(0.0).min(1.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `confidence.clamp(0.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:204:25 [INFO] [stdout] | [INFO] [stdout] 204 | let is_camel_case = name.chars().next().map_or(false, |c| c.is_lowercase()) && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 204 - let is_camel_case = name.chars().next().map_or(false, |c| c.is_lowercase()) && [INFO] [stdout] 204 + let is_camel_case = name.chars().next().is_some_and(|c| c.is_lowercase()) && [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:220:25 [INFO] [stdout] | [INFO] [stdout] 220 | let is_camel_case = name.chars().next().map_or(false, |c| c.is_lowercase()) && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 220 - let is_camel_case = name.chars().next().map_or(false, |c| c.is_lowercase()) && [INFO] [stdout] 220 + let is_camel_case = name.chars().next().is_some_and(|c| c.is_lowercase()) && [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:247:5 [INFO] [stdout] | [INFO] [stdout] 247 | confidence.max(0.0).min(1.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `confidence.clamp(0.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:96:1 [INFO] [stdout] | [INFO] [stdout] 96 | / impl Default for BytecodeAnalysis { [INFO] [stdout] 97 | | fn default() -> Self { [INFO] [stdout] 98 | | Self { [INFO] [stdout] 99 | | instructions: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 110 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 64 + #[derive(Default)] [INFO] [stdout] 65 | pub struct BytecodeAnalysis { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:309:54 [INFO] [stdout] | [INFO] [stdout] 309 | fn match_native_instruction_codes(instruction_codes: &mut Vec<(u8, Option)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 309 - fn match_native_instruction_codes(instruction_codes: &mut Vec<(u8, Option)>) { [INFO] [stdout] 309 + fn match_native_instruction_codes(instruction_codes: &mut [(u8, Option)]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's keys [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:456:31 [INFO] [stdout] | [INFO] [stdout] 456 | for (s, _) in &string_analysis.instruction_names { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 456 - for (s, _) in &string_analysis.instruction_names { [INFO] [stdout] 456 + for s in string_analysis.instruction_names.keys() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking solana-send-transaction-service v2.2.7 [INFO] [stdout] warning: the loop variable `i` is only used to index `instructions` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:542:14 [INFO] [stdout] | [INFO] [stdout] 542 | for i in start_idx..(start_idx + 50).min(instructions.len()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 542 - for i in start_idx..(start_idx + 50).min(instructions.len()) { [INFO] [stdout] 542 + for in instructions.iter().take((start_idx + 50).min(instructions.len())).skip(start_idx) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:557:23 [INFO] [stdout] | [INFO] [stdout] 557 | offset += insn.size as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `insn.size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:611:31 [INFO] [stdout] | [INFO] [stdout] 611 | } else if is_writable { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 612 | | format!("account_{}", idx) [INFO] [stdout] 613 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:613:16 [INFO] [stdout] | [INFO] [stdout] 613 | } else { [INFO] [stdout] | ________________^ [INFO] [stdout] 614 | | format!("account_{}", idx) [INFO] [stdout] 615 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/analyzer/anchor.rs:248:75 [INFO] [stdout] | [INFO] [stdout] 248 | let prefix_len = if string.starts_with("ERROR: ") { 7 } else { 7 }; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/analyzer/anchor.rs:248:86 [INFO] [stdout] | [INFO] [stdout] 248 | let prefix_len = if string.starts_with("ERROR: ") { 7 } else { 7 }; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/analyzer/anchor.rs:282:21 [INFO] [stdout] | [INFO] [stdout] 282 | / if !error_codes.contains_key(&error_code) { [INFO] [stdout] 283 | | error_codes.insert(error_code, format!("CustomError{}", error_code - 6000)); [INFO] [stdout] 284 | | } [INFO] [stdout] | |_____________________^ help: try: `error_codes.entry(error_code).or_insert_with(|| format!("CustomError{}", error_code - 6000));` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/analyzer/patterns.rs:427:5 [INFO] [stdout] | [INFO] [stdout] 427 | patterns.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 427 - patterns.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [INFO] [stdout] 427 + patterns.sort_by_key(|b| std::cmp::Reverse(b.frequency)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/analyzer/patterns.rs:609:17 [INFO] [stdout] | [INFO] [stdout] 609 | slice[4..].iter().any(|&b| b == 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `slice[4..].contains(&0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/analyzer/patterns.rs:752:5 [INFO] [stdout] | [INFO] [stdout] 752 | patterns.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 752 - patterns.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [INFO] [stdout] 752 + patterns.sort_by_key(|b| std::cmp::Reverse(b.frequency)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/analyzer/patterns.rs:992:5 [INFO] [stdout] | [INFO] [stdout] 992 | / match transaction { [INFO] [stdout] 993 | | solana_transaction_status::EncodedTransaction::Json(ui_transaction) => { [INFO] [stdout] 994 | | // Process JSON-encoded transaction [INFO] [stdout] 995 | | let ui_message = &ui_transaction.message; [INFO] [stdout] ... | [INFO] [stdout] 1031 | | _ => {} [INFO] [stdout] 1032 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 992 ~ if let solana_transaction_status::EncodedTransaction::Json(ui_transaction) = transaction { [INFO] [stdout] 993 + // Process JSON-encoded transaction [INFO] [stdout] 994 + let ui_message = &ui_transaction.message; [INFO] [stdout] 995 + [INFO] [stdout] 996 + // Extract accounts based on message type [INFO] [stdout] 997 + match ui_message { [INFO] [stdout] 998 + UiMessage::Parsed(parsed_message) => { [INFO] [stdout] 999 + // Find program instructions [INFO] [stdout] 1000 + for instruction in &parsed_message.instructions { [INFO] [stdout] 1001 + if let Some(program_id_str) = get_program_id(instruction, ui_message) { [INFO] [stdout] 1002 + if program_id_str == program_id.to_string() { [INFO] [stdout] 1003 + // Extract accounts for this instruction [INFO] [stdout] 1004 + if let Some(account_indices) = get_instruction_accounts(instruction) { [INFO] [stdout] 1005 + for (idx, account_idx) in account_indices.iter().enumerate() { [INFO] [stdout] 1006 + let account_idx = account_idx.parse::()?; [INFO] [stdout] 1007 + if account_idx < parsed_message.account_keys.len() { [INFO] [stdout] 1008 + let account_key = &parsed_message.account_keys[account_idx]; [INFO] [stdout] 1009 + let is_signer = account_key.signer; [INFO] [stdout] 1010 + let is_writable = account_key.writable; [INFO] [stdout] 1011 + [INFO] [stdout] 1012 + accounts.push(TransactionAccount { [INFO] [stdout] 1013 + pubkey: account_key.pubkey.clone(), [INFO] [stdout] 1014 + is_signer, [INFO] [stdout] 1015 + is_writable, [INFO] [stdout] 1016 + position: idx, [INFO] [stdout] 1017 + }); [INFO] [stdout] 1018 + } [INFO] [stdout] 1019 + } [INFO] [stdout] 1020 + } [INFO] [stdout] 1021 + } [INFO] [stdout] 1022 + } [INFO] [stdout] 1023 + } [INFO] [stdout] 1024 + }, [INFO] [stdout] 1025 + // Handle other message types... [INFO] [stdout] 1026 + _ => {} [INFO] [stdout] 1027 + } [INFO] [stdout] 1028 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/analyzer/patterns.rs:998:13 [INFO] [stdout] | [INFO] [stdout] 998 | / match ui_message { [INFO] [stdout] 999 | | UiMessage::Parsed(parsed_message) => { [INFO] [stdout] 1000 | | // Find program instructions [INFO] [stdout] 1001 | | for instruction in &parsed_message.instructions { [INFO] [stdout] ... | [INFO] [stdout] 1027 | | _ => {} [INFO] [stdout] 1028 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 998 ~ if let UiMessage::Parsed(parsed_message) = ui_message { [INFO] [stdout] 999 + // Find program instructions [INFO] [stdout] 1000 + for instruction in &parsed_message.instructions { [INFO] [stdout] 1001 + if let Some(program_id_str) = get_program_id(instruction, ui_message) { [INFO] [stdout] 1002 + if program_id_str == program_id.to_string() { [INFO] [stdout] 1003 + // Extract accounts for this instruction [INFO] [stdout] 1004 + if let Some(account_indices) = get_instruction_accounts(instruction) { [INFO] [stdout] 1005 + for (idx, account_idx) in account_indices.iter().enumerate() { [INFO] [stdout] 1006 + let account_idx = account_idx.parse::()?; [INFO] [stdout] 1007 + if account_idx < parsed_message.account_keys.len() { [INFO] [stdout] 1008 + let account_key = &parsed_message.account_keys[account_idx]; [INFO] [stdout] 1009 + let is_signer = account_key.signer; [INFO] [stdout] 1010 + let is_writable = account_key.writable; [INFO] [stdout] 1011 + [INFO] [stdout] 1012 + accounts.push(TransactionAccount { [INFO] [stdout] 1013 + pubkey: account_key.pubkey.clone(), [INFO] [stdout] 1014 + is_signer, [INFO] [stdout] 1015 + is_writable, [INFO] [stdout] 1016 + position: idx, [INFO] [stdout] 1017 + }); [INFO] [stdout] 1018 + } [INFO] [stdout] 1019 + } [INFO] [stdout] 1020 + } [INFO] [stdout] 1021 + } [INFO] [stdout] 1022 + } [INFO] [stdout] 1023 + } [INFO] [stdout] 1024 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:207:21 [INFO] [stdout] | [INFO] [stdout] 207 | let error = if let Some(err) = &result.value.err { [INFO] [stdout] | _____________________^ [INFO] [stdout] 208 | | Some(format!("{:?}", err)) [INFO] [stdout] 209 | | } else { [INFO] [stdout] 210 | | None [INFO] [stdout] 211 | | }; [INFO] [stdout] | |_________^ help: try: `result.value.err.as_ref().map(|err| format!("{:?}", err))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/analyzer/simulation/mod.rs:258:71 [INFO] [stdout] | [INFO] [stdout] 258 | fn generate_mock_accounts(&self, instruction: &IdlInstruction) -> anyhow::Result<(Vec, HashMap>)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/analyzer/simulation/mod.rs:764:18 [INFO] [stdout] | [INFO] [stdout] 764 | .map_err(|e| anyhow::Error::from(e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `anyhow::Error::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Analyzer` [INFO] [stdout] --> src/analyzer/mod.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | / pub fn new() -> Self { [INFO] [stdout] 31 | | Self {} [INFO] [stdout] 32 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 28 + impl Default for Analyzer { [INFO] [stdout] 29 + fn default() -> Self { [INFO] [stdout] 30 + Self::new() [INFO] [stdout] 31 + } [INFO] [stdout] 32 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/monitor/rpc.rs:288:48 [INFO] [stdout] | [INFO] [stdout] 288 | ... if data.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!data.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/monitor/rpc.rs:317:64 [INFO] [stdout] | [INFO] [stdout] 317 | ... if program_data.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!program_data.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/monitor/transaction.rs:35:18 [INFO] [stdout] | [INFO] [stdout] 35 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/monitor/transaction.rs:153:17 [INFO] [stdout] | [INFO] [stdout] 153 | slice[4..].iter().any(|&b| b == 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `slice[4..].contains(&0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/monitor/transaction.rs:252:17 [INFO] [stdout] | [INFO] [stdout] 252 | / if *instruction.program_id(decoded.message.static_account_keys()) == *program_id { [INFO] [stdout] 253 | | if !instruction.data.is_empty() { [INFO] [stdout] 254 | | let discriminator = instruction.data[0]; [INFO] [stdout] 255 | | grouped_txs.entry(discriminator) [INFO] [stdout] ... | [INFO] [stdout] 259 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 252 ~ if *instruction.program_id(decoded.message.static_account_keys()) == *program_id [INFO] [stdout] 253 ~ && !instruction.data.is_empty() { [INFO] [stdout] 254 | let discriminator = instruction.data[0]; [INFO] [stdout] ... [INFO] [stdout] 257 | .push(tx); [INFO] [stdout] 258 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/monitor/transaction.rs:256:30 [INFO] [stdout] | [INFO] [stdout] 256 | ... .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/monitor/transaction.rs:338:17 [INFO] [stdout] | [INFO] [stdout] 338 | / if *instruction.program_id(decoded.message.static_account_keys()) == *program_id { [INFO] [stdout] 339 | | if !instruction.data.is_empty() && instruction.data[0] == discriminator { [INFO] [stdout] 340 | | // Skip the discriminator byte [INFO] [stdout] 341 | | if instruction.data.len() > 1 { [INFO] [stdout] ... | [INFO] [stdout] 345 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 338 ~ if *instruction.program_id(decoded.message.static_account_keys()) == *program_id [INFO] [stdout] 339 ~ && !instruction.data.is_empty() && instruction.data[0] == discriminator { [INFO] [stdout] 340 | // Skip the discriminator byte [INFO] [stdout] ... [INFO] [stdout] 343 | } [INFO] [stdout] 344 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/models/instruction.rs:89:29 [INFO] [stdout] | [INFO] [stdout] 89 | if self.is_writable { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 90 | | if self.is_signer { [INFO] [stdout] 91 | | solana_instruction::AccountMeta::new(*pubkey, true) [INFO] [stdout] 92 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 95 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/models/instruction.rs:95:16 [INFO] [stdout] | [INFO] [stdout] 95 | } else { [INFO] [stdout] | ________________^ [INFO] [stdout] 96 | | if self.is_signer { [INFO] [stdout] 97 | | solana_instruction::AccountMeta::new(*pubkey, true) [INFO] [stdout] 98 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 101 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking solana-banks-server v2.2.7 [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/generator/custom.rs:80:9 [INFO] [stdout] | [INFO] [stdout] 80 | ts_code.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `ts_code.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/generator/custom.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | ts_code.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `ts_code.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/constants/opcodes.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | / pub mod opcodes { [INFO] [stdout] 3 | | // Memory Load or 32-bit ALU operations (Class 0) [INFO] [stdout] 4 | | pub const LDDW: u8 = 0x18; // Load double word immediate [INFO] [stdout] 5 | | pub const ADD32_IMM: u8 = 0x04; // 32-bit add immediate [INFO] [stdout] ... | [INFO] [stdout] 136 | | pub const MOV_REG: u8 = 0xbf; // Move register to register [INFO] [stdout] 137 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/constants/syscalls.rs:4:1 [INFO] [stdout] | [INFO] [stdout] 4 | / pub mod syscalls { [INFO] [stdout] 5 | | // Core Solana Syscalls [INFO] [stdout] 6 | | pub const SOL_PANIC: u32 = 0x686093bb; [INFO] [stdout] 7 | | pub const SOL_LOG: u32 = 0x3d082901; [INFO] [stdout] ... | [INFO] [stdout] 61 | | pub const SOL_BIG_INTEGER_MODULO: u32 = 0xf3a5e9de; [INFO] [stdout] 62 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/utils/account_analysis.rs:171:5 [INFO] [stdout] | [INFO] [stdout] 171 | i64::from_str_radix(program_id, 10).unwrap_or_default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `program_id.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] = note: `#[warn(clippy::from_str_radix_10)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/utils/error_analysis.rs:26:16 [INFO] [stdout] | [INFO] [stdout] 26 | if (potential_error_code >= 100 && potential_error_code < 10000) || [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(100..10000).contains(&potential_error_code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/utils/error_analysis.rs:27:16 [INFO] [stdout] | [INFO] [stdout] 27 | (potential_error_code >= 0x100 && potential_error_code <= 0xFFFF) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x100..=0xFFFF).contains(&potential_error_code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/utils/error_analysis.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | / if !error_codes.contains_key(&potential_error_code) { [INFO] [stdout] 34 | | error_codes.insert(potential_error_code, name); [INFO] [stdout] 35 | | } [INFO] [stdout] | |_________________^ help: try: `error_codes.entry(potential_error_code).or_insert(name);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `instructions` [INFO] [stdout] --> src/utils/error_analysis.rs:168:14 [INFO] [stdout] | [INFO] [stdout] 168 | for i in start..end { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 168 - for i in start..end { [INFO] [stdout] 168 + for in instructions.iter().take(end).skip(start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking solana-program-test v2.2.7 [INFO] [stdout] warning: called `unwrap` on `output_path` after checking its variant with `is_none` [INFO] [stdout] --> src/main.rs:188:34 [INFO] [stdout] | [INFO] [stdout] 184 | if output_path.is_none() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = output_path` [INFO] [stdout] ... [INFO] [stdout] 188 | println!("Saved to: {}", output_path.unwrap().display()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `output_path` after checking its variant with `is_none` [INFO] [stdout] --> src/main.rs:188:34 [INFO] [stdout] | [INFO] [stdout] 184 | if output_path.is_none() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = output_path` [INFO] [stdout] ... [INFO] [stdout] 188 | println!("Saved to: {}", output_path.unwrap().display()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Context` and `anyhow` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:7:22 [INFO] [stdout] | [INFO] [stdout] 7 | use anyhow::{Result, anyhow, Context}; [INFO] [stdout] | ^^^^^^ ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `debug` and `info` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:8:11 [INFO] [stdout] | [INFO] [stdout] 8 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `is_load`, `is_store`, and `mem_size` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | mem_size, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 30 | is_load, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 31 | is_store, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AnchorDiscriminator` and `DiscriminatorKind` [INFO] [stdout] --> src/analyzer/bytecode/account_analyzer.rs:6:38 [INFO] [stdout] | [INFO] [stdout] 6 | use super::discriminator_detection::{AnchorDiscriminator, DiscriminatorKind}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `VecDeque` [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:5:33 [INFO] [stdout] | [INFO] [stdout] 5 | use std::collections::{HashSet, VecDeque}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `analyze_control_flow` and `call_target` [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:9:20 [INFO] [stdout] | [INFO] [stdout] 9 | branch_target, call_target, analyze_control_flow, find_function_boundaries [INFO] [stdout] | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `debug`, `info`, and `warn` [INFO] [stdout] --> src/analyzer/bytecode/discriminator_detection.rs:4:11 [INFO] [stdout] | [INFO] [stdout] 4 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^^ ^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `ANCHOR_ACCOUNT_NAMESPACE`, `ANCHOR_DISCRIMINATOR_LENGTH`, `ANCHOR_DISCRIMINATOR_NAMESPACE`, and `anchor` [INFO] [stdout] --> src/analyzer/bytecode/discriminator_detection.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | anchor, spl_token, system_program, program_ids, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 10 | ANCHOR_DISCRIMINATOR_LENGTH, ANCHOR_DISCRIMINATOR_NAMESPACE, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 11 | ANCHOR_ACCOUNT_NAMESPACE [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `extract_discriminator_values` and `is_anchor_instruction_validation` [INFO] [stdout] --> src/analyzer/bytecode/discriminator_detection.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | is_anchor_instruction_validation, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 16 | extract_discriminator_values, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `debug` [INFO] [stdout] --> src/analyzer/bytecode/disassembler.rs:4:11 [INFO] [stdout] | [INFO] [stdout] 4 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `analyze_error_handling` [INFO] [stdout] --> src/analyzer/bytecode/error_analyzer.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | analyze_error_handling, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `debug` and `info` [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:4:11 [INFO] [stdout] | [INFO] [stdout] 4 | use log::{debug, info}; [INFO] [stdout] | ^^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty lines after doc comment [INFO] [stdout] --> src/analyzer/bytecode/heuristics.rs:47:1 [INFO] [stdout] | [INFO] [stdout] 47 | / /// - Obfuscated programs may intentionally hide instruction boundaries [INFO] [stdout] 48 | | [INFO] [stdout] 49 | | /// # Account Detection Heuristics [INFO] [stdout] 50 | | /// [INFO] [stdout] ... | [INFO] [stdout] 121 | | [INFO] [stdout] | |_^ [INFO] [stdout] 122 | pub fn _dummy() {} [INFO] [stdout] | ------------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty lines are unintentional, remove them [INFO] [stdout] help: if the doc comment should not document function `_dummy` then comment it out [INFO] [stdout] | [INFO] [stdout] 19 ~ // /// # Instruction Detection Heuristics [INFO] [stdout] 20 ~ // /// [INFO] [stdout] 21 ~ // /// The following heuristics are used to detect instructions in program bytecode: [INFO] [stdout] 22 ~ // /// [INFO] [stdout] 23 ~ // /// 1. **Function Entry Points**: We identify potential function entry points by looking for: [INFO] [stdout] 24 ~ // /// - Function prologues (stack setup instructions) [INFO] [stdout] 25 ~ // /// - References from the instruction dispatch table [INFO] [stdout] 26 ~ // /// - Call instructions targeting these addresses [INFO] [stdout] 27 ~ // /// [INFO] [stdout] 28 ~ // /// 2. **Discriminator Detection**: For Anchor programs, we look for: [INFO] [stdout] 29 ~ // /// - 8-byte discriminator comparisons at the beginning of functions [INFO] [stdout] 30 ~ // /// - Anchor-style discriminator generation patterns (Sha256 of "instruction:X") [INFO] [stdout] 31 ~ // /// [INFO] [stdout] 32 ~ // /// 3. **Instruction Boundaries**: We determine instruction boundaries by: [INFO] [stdout] 33 ~ // /// - Analyzing the control flow graph [INFO] [stdout] 34 ~ // /// - Identifying dispatch table patterns [INFO] [stdout] 35 ~ // /// - Looking for switch/case patterns on the first byte of instruction data [INFO] [stdout] 36 ~ // /// [INFO] [stdout] 37 ~ // /// ## Assumptions [INFO] [stdout] 38 ~ // /// [INFO] [stdout] 39 ~ // /// - Programs follow common Solana patterns for instruction dispatch [INFO] [stdout] 40 ~ // /// - Anchor programs use the standard 8-byte discriminator pattern [INFO] [stdout] 41 ~ // /// - Native programs typically use a single byte as instruction code [INFO] [stdout] 42 ~ // /// [INFO] [stdout] 43 ~ // /// ## Limitations [INFO] [stdout] 44 ~ // /// [INFO] [stdout] 45 ~ // /// - Custom dispatch mechanisms might not be detected [INFO] [stdout] 46 ~ // /// - Heavily optimized code may confuse the boundary detection [INFO] [stdout] 47 ~ // /// - Obfuscated programs may intentionally hide instruction boundaries [INFO] [stdout] 48 | [INFO] [stdout] 49 ~ // /// # Account Detection Heuristics [INFO] [stdout] 50 ~ // /// [INFO] [stdout] 51 ~ // /// The following heuristics are used to detect accounts and their properties: [INFO] [stdout] 52 ~ // /// [INFO] [stdout] 53 ~ // /// 1. **Account References**: We identify accounts by looking for: [INFO] [stdout] 54 ~ // /// - References to the accounts array parameter [INFO] [stdout] 55 ~ // /// - Index-based access patterns (accounts[i]) [INFO] [stdout] 56 ~ // /// - Anchor-style account deserialization [INFO] [stdout] 57 ~ // /// [INFO] [stdout] 58 ~ // /// 2. **Account Properties**: We determine account properties by: [INFO] [stdout] 59 ~ // /// - Analyzing is_signer and is_writable checks [INFO] [stdout] 60 ~ // /// - Looking for owner checks (AccountInfo::owner) [INFO] [stdout] 61 ~ // /// - Identifying PDA derivation patterns [INFO] [stdout] 62 ~ // /// [INFO] [stdout] 63 ~ // /// 3. **Account Structures**: We infer account data structures by: [INFO] [stdout] 64 ~ // /// - Analyzing memory access patterns to account data [INFO] [stdout] 65 ~ // /// - Looking for deserialization code patterns [INFO] [stdout] 66 ~ // /// - Identifying Anchor account discriminators [INFO] [stdout] 67 ~ // /// [INFO] [stdout] 68 ~ // /// ## Assumptions [INFO] [stdout] 69 ~ // /// [INFO] [stdout] 70 ~ // /// - Programs follow standard Solana patterns for account validation [INFO] [stdout] 71 ~ // /// - Account data follows common serialization patterns [INFO] [stdout] 72 ~ // /// - Programs check account constraints before using them [INFO] [stdout] 73 ~ // /// [INFO] [stdout] 74 ~ // /// ## Limitations [INFO] [stdout] 75 ~ // /// [INFO] [stdout] 76 ~ // /// - Custom validation logic may not be detected [INFO] [stdout] 77 ~ // /// - Complex account relationships might be missed [INFO] [stdout] 78 ~ // /// - Dynamic account usage patterns are difficult to analyze statically [INFO] [stdout] 79 | [INFO] [stdout] 80 ~ // /// # String Analysis Heuristics [INFO] [stdout] 81 ~ // /// [INFO] [stdout] 82 ~ // /// The following heuristics are used to extract meaningful names: [INFO] [stdout] 83 ~ // /// [INFO] [stdout] 84 ~ // /// 1. **Name Extraction**: We extract potential names from: [INFO] [stdout] 85 ~ // /// - String literals in the .rodata section [INFO] [stdout] 86 ~ // /// - Error messages and debug prints [INFO] [stdout] 87 ~ // /// - Anchor discriminator strings [INFO] [stdout] 88 ~ // /// [INFO] [stdout] 89 ~ // /// 2. **Name Classification**: We classify strings as: [INFO] [stdout] 90 ~ // /// - Instruction names (verb-based, command-like) [INFO] [stdout] 91 ~ // /// - Account names (noun-based, entity-like) [INFO] [stdout] 92 ~ // /// - Field names (property-like, attribute-like) [INFO] [stdout] 93 ~ // /// [INFO] [stdout] 94 ~ // /// 3. **Name Matching**: We match names to program elements by: [INFO] [stdout] 95 ~ // /// - Proximity in the binary [INFO] [stdout] 96 ~ // /// - Usage patterns in the code [INFO] [stdout] 97 ~ // /// - Similarity to common Solana naming patterns [INFO] [stdout] 98 ~ // /// [INFO] [stdout] 99 ~ // /// ## Assumptions [INFO] [stdout] 100 ~ // /// [INFO] [stdout] 101 ~ // /// - Programs contain meaningful string literals [INFO] [stdout] 102 ~ // /// - Names follow common programming conventions [INFO] [stdout] 103 ~ // /// - Similar functionality has similar naming across programs [INFO] [stdout] 104 ~ // /// [INFO] [stdout] 105 ~ // /// ## Limitations [INFO] [stdout] 106 ~ // /// [INFO] [stdout] 107 ~ // /// - Stripped binaries contain few or no strings [INFO] [stdout] 108 ~ // /// - Generic names may be misclassified [INFO] [stdout] 109 ~ // /// - Names might be misleading or intentionally obfuscated [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Context` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:31:22 [INFO] [stdout] | [INFO] [stdout] 31 | use anyhow::{Result, Context, anyhow}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `debug` and `warn` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:32:11 [INFO] [stdout] | [INFO] [stdout] 32 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `get_instruction_frequency` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:46:107 [INFO] [stdout] | [INFO] [stdout] 46 | ...DynamicAnalysisResult, get_account_access_patterns, get_instruction_frequency, AccessType}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ErrorAnalysis` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:47:57 [INFO] [stdout] | [INFO] [stdout] 47 | use crate::utils::error_analysis::{extract_error_codes, ErrorAnalysis}; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `info` and `warn` [INFO] [stdout] --> src/analyzer/patterns.rs:4:18 [INFO] [stdout] | [INFO] [stdout] 4 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `UiTransactionEncoding` [INFO] [stdout] --> src/analyzer/patterns.rs:6:33 [INFO] [stdout] | [INFO] [stdout] 6 | use solana_transaction_status::{UiTransactionEncoding, TransactionBinaryEncoding, UiMessage, UiInstruction, UiCompiledInstruction, Ui... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::models::instruction::Instruction` [INFO] [stdout] --> src/analyzer/patterns.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use crate::models::instruction::Instruction; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `BTreeMap` and `HashSet` [INFO] [stdout] --> src/analyzer/patterns.rs:11:33 [INFO] [stdout] | [INFO] [stdout] 11 | use std::collections::{HashMap, HashSet, BTreeMap}; [INFO] [stdout] | ^^^^^^^ ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/analyzer/patterns.rs:309:12 [INFO] [stdout] | [INFO] [stdout] 309 | if offset + 1 <= data.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `offset < data.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] = note: `#[warn(clippy::int_plus_one)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/analyzer/patterns.rs:634:12 [INFO] [stdout] | [INFO] [stdout] 634 | if offset + 1 <= first_sample.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `offset < first_sample.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `debug` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:3:11 [INFO] [stdout] | [INFO] [stdout] 3 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Serialize` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:5:13 [INFO] [stdout] | [INFO] [stdout] 5 | use serde::{Serialize, Deserialize}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `HashSet` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:7:33 [INFO] [stdout] | [INFO] [stdout] 7 | use std::collections::{HashMap, HashSet}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Sha256` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 10 | use sha2::{Sha256, Digest}; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ErrorExt` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:26:54 [INFO] [stdout] | [INFO] [stdout] 26 | use crate::errors::{ExtractorError, ExtractorResult, ErrorExt, ErrorContext}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `solana_sbpf::insn_builder::Instruction` [INFO] [stdout] --> src/analyzer/mod.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | use solana_sbpf::insn_builder::Instruction; // use this instead for impl on l107 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/monitor/transaction.rs:178:12 [INFO] [stdout] | [INFO] [stdout] 178 | if offset + 1 <= first_sample.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `offset < first_sample.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/monitor/transaction.rs:391:8 [INFO] [stdout] | [INFO] [stdout] 391 | if offset + 1 <= data_samples[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `offset < data_samples[0].len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/monitor/transaction.rs:449:8 [INFO] [stdout] | [INFO] [stdout] 449 | if offset + 1 <= data_samples[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `offset < data_samples[0].len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fs` [INFO] [stdout] --> src/generator/mod.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use std::fs; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `debug` and `error` [INFO] [stdout] --> src/generator/mod.rs:13:17 [INFO] [stdout] | [INFO] [stdout] 13 | use log::{info, debug, error}; [INFO] [stdout] | ^^^^^ ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Path` [INFO] [stdout] --> src/cache/mod.rs:4:17 [INFO] [stdout] | [INFO] [stdout] 4 | use std::path::{Path, PathBuf}; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `warn` [INFO] [stdout] --> src/cache/mod.rs:8:18 [INFO] [stdout] | [INFO] [stdout] 8 | use log::{debug, warn}; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Context`, `Result`, and `anyhow` [INFO] [stdout] --> src/utils/transaction_parser.rs:8:14 [INFO] [stdout] | [INFO] [stdout] 8 | use anyhow::{Result, anyhow, Context}; [INFO] [stdout] | ^^^^^^ ^^^^^^ ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `info` [INFO] [stdout] --> src/utils/transaction_parser.rs:9:18 [INFO] [stdout] | [INFO] [stdout] 9 | use log::{debug, info, warn}; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `solana_instruction::Instruction` [INFO] [stdout] --> src/utils/transaction_parser.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | use solana_instruction::Instruction; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ErrorExt` [INFO] [stdout] --> src/utils/transaction_parser.rs:21:54 [INFO] [stdout] | [INFO] [stdout] 21 | use crate::errors::{ExtractorError, ExtractorResult, ErrorExt, ErrorContext}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `solana_sbpf::static_analysis::Analysis` [INFO] [stdout] --> src/utils/account_analysis.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use solana_sbpf::static_analysis::Analysis; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `HashSet` [INFO] [stdout] --> src/utils/dynamic_analysis.rs:10:33 [INFO] [stdout] | [INFO] [stdout] 10 | use std::collections::{HashMap, HashSet}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated associated function `solana_hash::Hash::new`: Use 'Hash::new_from_array' instead [INFO] [stdout] --> src/analyzer/simulation/mod.rs:193:39 [INFO] [stdout] | [INFO] [stdout] 193 | tx.sign(&[&self.payer], Hash::new(&recent_blockhash)); [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(deprecated)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Digest` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:10:20 [INFO] [stdout] | [INFO] [stdout] 10 | use sha2::{Sha256, Digest}; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `pc` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:703:10 [INFO] [stdout] | [INFO] [stdout] 703 | for (pc, insn) in analysis.instructions.iter().enumerate() { [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_pc` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `instructions` [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:109:5 [INFO] [stdout] | [INFO] [stdout] 109 | instructions: &[SbfInstruction], [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_instructions` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `instructions` [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:192:5 [INFO] [stdout] | [INFO] [stdout] 192 | instructions: &[SbfInstruction], [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_instructions` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `functions` [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:194:5 [INFO] [stdout] | [INFO] [stdout] 194 | functions: &[Function], [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_functions` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/analyzer/bytecode/account_analyzer.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 104 | analysis: &Analysis, [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `instructions` [INFO] [stdout] --> src/analyzer/bytecode/account_analyzer.rs:105:5 [INFO] [stdout] | [INFO] [stdout] 105 | instructions: &[SbfInstruction] [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_instructions` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:241:49 [INFO] [stdout] | [INFO] [stdout] 241 | fn connect_blocks(blocks: &mut Vec, analysis: &Analysis) { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `program_id` [INFO] [stdout] --> src/analyzer/bytecode/disassembler.rs:349:5 [INFO] [stdout] | [INFO] [stdout] 349 | program_id: &str, [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_program_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `entry_point` [INFO] [stdout] --> src/analyzer/bytecode/disassembler.rs:390:24 [INFO] [stdout] | [INFO] [stdout] 390 | for (i, (name, entry_point)) in disassembled.functions.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_entry_point` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `program_id` [INFO] [stdout] --> src/analyzer/bytecode/disassembler.rs:513:5 [INFO] [stdout] | [INFO] [stdout] 513 | program_id: &str, [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_program_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/analyzer/bytecode/error_analyzer.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | analysis: &Analysis [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `program_id` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:115:5 [INFO] [stdout] | [INFO] [stdout] 115 | program_id: &str, [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_program_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `boundary` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:480:18 [INFO] [stdout] | [INFO] [stdout] 480 | for (i, &boundary) in boundaries.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_boundary` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `context` [INFO] [stdout] --> src/analyzer/patterns.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | let context = ErrorContext { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_context` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/analyzer/patterns.rs:171:21 [INFO] [stdout] | [INFO] [stdout] 171 | _ => { [INFO] [stdout] | ^ no value can reach this [INFO] [stdout] | [INFO] [stdout] note: multiple earlier patterns match some of the same values [INFO] [stdout] --> src/analyzer/patterns.rs:171:21 [INFO] [stdout] | [INFO] [stdout] 161 | TransactionBinaryEncoding::Base58 => { [INFO] [stdout] | --------------------------------- matches some of the same values [INFO] [stdout] ... [INFO] [stdout] 166 | TransactionBinaryEncoding::Base64 => { [INFO] [stdout] | --------------------------------- matches some of the same values [INFO] [stdout] ... [INFO] [stdout] 171 | _ => { [INFO] [stdout] | ^ collectively making this unreachable [INFO] [stdout] = note: `#[warn(unreachable_patterns)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `err` [INFO] [stdout] --> src/analyzer/patterns.rs:143:45 [INFO] [stdout] | [INFO] [stdout] 143 | ... Err(err) => { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_err` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `program_id` [INFO] [stdout] --> src/analyzer/patterns.rs:187:40 [INFO] [stdout] | [INFO] [stdout] 187 | fn extract_from_binary(tx_data: &[u8], program_id: &Pubkey, instruction_data: &mut Vec>) -> ExtractorResult<()> { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_program_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `discriminator` [INFO] [stdout] --> src/analyzer/patterns.rs:394:41 [INFO] [stdout] | [INFO] [stdout] 394 | ... let discriminator = extract_discriminator_raw(instruction); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_discriminator` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `accounts` [INFO] [stdout] --> src/analyzer/patterns.rs:397:41 [INFO] [stdout] | [INFO] [stdout] 397 | ... let accounts = instruction.accounts.iter() [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_accounts` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `parsed_instruction` [INFO] [stdout] --> src/analyzer/patterns.rs:445:45 [INFO] [stdout] | [INFO] [stdout] 445 | UiParsedInstruction::Parsed(parsed_instruction) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_parsed_instruction` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `total_readonly` [INFO] [stdout] --> src/analyzer/patterns.rs:502:17 [INFO] [stdout] | [INFO] [stdout] 502 | let total_readonly = num_readonly_signed + num_readonly_unsigned; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_total_readonly` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `discriminator` [INFO] [stdout] --> src/analyzer/patterns.rs:531:10 [INFO] [stdout] | [INFO] [stdout] 531 | for (discriminator, data_group) in grouped_data { [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_discriminator` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `discriminator` [INFO] [stdout] --> src/analyzer/patterns.rs:719:41 [INFO] [stdout] | [INFO] [stdout] 719 | ... let discriminator = extract_discriminator_raw(instruction); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_discriminator` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `accounts` [INFO] [stdout] --> src/analyzer/patterns.rs:722:41 [INFO] [stdout] | [INFO] [stdout] 722 | ... let accounts = instruction.accounts.iter() [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_accounts` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `transactions` [INFO] [stdout] --> src/analyzer/patterns.rs:763:5 [INFO] [stdout] | [INFO] [stdout] 763 | transactions: &[solana_transaction_status::EncodedTransaction], [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_transactions` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `transaction` [INFO] [stdout] --> src/analyzer/patterns.rs:1052:5 [INFO] [stdout] | [INFO] [stdout] 1052 | transaction: &solana_transaction_status::EncodedTransaction, [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_transaction` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `account_idx` [INFO] [stdout] --> src/analyzer/patterns.rs:1053:5 [INFO] [stdout] | [INFO] [stdout] 1053 | account_idx: usize [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_account_idx` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `context` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:158:13 [INFO] [stdout] | [INFO] [stdout] 158 | let context = ErrorContext { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_context` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `program_id` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:715:46 [INFO] [stdout] | [INFO] [stdout] 715 | async fn try_simulate_instruction(&self, program_id: &Pubkey, instruction_data: &[u8]) -> Result { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_program_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `instruction_data` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:715:67 [INFO] [stdout] | [INFO] [stdout] 715 | async fn try_simulate_instruction(&self, program_id: &Pubkey, instruction_data: &[u8]) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_instruction_data` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `pattern_analysis` [INFO] [stdout] --> src/analyzer/mod.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | pattern_analysis: PatternAnalysis // TODO: use this to further enrich the IDL [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_pattern_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `frequency` [INFO] [stdout] --> src/monitor/transaction.rs:70:42 [INFO] [stdout] | [INFO] [stdout] 70 | for (i, (is_signer, is_writable, frequency)) in accounts.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_frequency` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/utils/error_analysis.rs:69:65 [INFO] [stdout] | [INFO] [stdout] 69 | fn infer_error_name(code: u32, instructions: &[SbfInstruction], analysis: &Analysis) -> String { [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `analysis` [INFO] [stdout] --> src/utils/error_analysis.rs:152:5 [INFO] [stdout] | [INFO] [stdout] 152 | analysis: &Analysis [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_analysis` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `version` [INFO] [stdout] --> src/utils/error_analysis.rs:214:5 [INFO] [stdout] | [INFO] [stdout] 214 | version: SBPFVersion [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_version` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `version` [INFO] [stdout] --> src/utils/dynamic_analysis.rs:83:5 [INFO] [stdout] | [INFO] [stdout] 83 | version: SBPFVersion, [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_version` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `config` [INFO] [stdout] --> src/utils/dynamic_analysis.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 84 | config: &Config, [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_config` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `program_pubkey` [INFO] [stdout] --> src/utils/mod.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | program_pubkey: &Pubkey, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_program_pubkey` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `extract_anchor_instructions` is never used [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:345:4 [INFO] [stdout] | [INFO] [stdout] 345 | fn extract_anchor_instructions( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `extract_native_instructions` is never used [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:434:4 [INFO] [stdout] | [INFO] [stdout] 434 | fn extract_native_instructions( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `find_block_containing` is never used [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:280:4 [INFO] [stdout] | [INFO] [stdout] 280 | fn find_block_containing(pc: usize, blocks: &[BasicBlock]) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `add_standard_error_codes` is never used [INFO] [stdout] --> src/analyzer/bytecode/error_analyzer.rs:97:4 [INFO] [stdout] | [INFO] [stdout] 97 | fn add_standard_error_codes(error_codes: &mut HashMap) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `infer_error_name` is never used [INFO] [stdout] --> src/analyzer/bytecode/error_analyzer.rs:122:4 [INFO] [stdout] | [INFO] [stdout] 122 | fn infer_error_name(code: u32, instructions: &[SbfInstruction]) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `position` is never read [INFO] [stdout] --> src/analyzer/patterns.rs:1047:9 [INFO] [stdout] | [INFO] [stdout] 1039 | struct TransactionAccount { [INFO] [stdout] | ------------------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 1047 | pub position: usize, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `TransactionAccount` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `id` and `jsonrpc` are never read [INFO] [stdout] --> src/analyzer/simulation/mod.rs:63:5 [INFO] [stdout] | [INFO] [stdout] 61 | struct SimulateResponse { [INFO] [stdout] | ---------------- fields in this struct [INFO] [stdout] 62 | result: SimulateResult, [INFO] [stdout] 63 | id: u64, [INFO] [stdout] | ^^ [INFO] [stdout] 64 | jsonrpc: String, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `SimulateResponse` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `context` is never read [INFO] [stdout] --> src/analyzer/simulation/mod.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 69 | struct SimulateResult { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] 70 | context: RpcContext, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `SimulateResult` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `slot` is never read [INFO] [stdout] --> src/analyzer/simulation/mod.rs:77:5 [INFO] [stdout] | [INFO] [stdout] 76 | struct RpcContext { [INFO] [stdout] | ---------- field in this struct [INFO] [stdout] 77 | slot: u64, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RpcContext` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `executable`, `lamports`, and `rent_epoch` are never read [INFO] [stdout] --> src/analyzer/simulation/mod.rs:93:5 [INFO] [stdout] | [INFO] [stdout] 91 | struct AccountInfo { [INFO] [stdout] | ----------- fields in this struct [INFO] [stdout] 92 | data: Vec, [INFO] [stdout] 93 | executable: bool, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 94 | lamports: u64, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 95 | owner: String, [INFO] [stdout] 96 | rent_epoch: u64, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `AccountInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `extract_instruction_from_transaction` is never used [INFO] [stdout] --> src/analyzer/simulation/mod.rs:755:4 [INFO] [stdout] | [INFO] [stdout] 755 | fn extract_instruction_from_transaction(transaction_data: &[u8], program_id: &Pubkey) -> ExtractorResult { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `discriminator`, `account_patterns`, `data_patterns`, and `frequency` are never read [INFO] [stdout] --> src/monitor/transaction.rs:301:5 [INFO] [stdout] | [INFO] [stdout] 300 | struct TransactionPattern { [INFO] [stdout] | ------------------ fields in this struct [INFO] [stdout] 301 | discriminator: u8, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 302 | account_patterns: Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] 303 | data_patterns: Vec, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 304 | frequency: usize, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `TransactionPattern` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `index`, `is_signer`, `is_writable`, and `frequency` are never read [INFO] [stdout] --> src/monitor/transaction.rs:310:5 [INFO] [stdout] | [INFO] [stdout] 309 | struct AccountPattern { [INFO] [stdout] | -------------- fields in this struct [INFO] [stdout] 310 | index: usize, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 311 | is_signer: bool, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 312 | is_writable: bool, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] 313 | frequency: usize, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `AccountPattern` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `offset`, `size`, `type_hint`, and `frequency` are never read [INFO] [stdout] --> src/monitor/transaction.rs:319:5 [INFO] [stdout] | [INFO] [stdout] 318 | struct DataPattern { [INFO] [stdout] | ----------- fields in this struct [INFO] [stdout] 319 | offset: usize, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 320 | size: usize, [INFO] [stdout] | ^^^^ [INFO] [stdout] 321 | type_hint: String, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 322 | frequency: usize, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `DataPattern` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `generate_typescript` is never used [INFO] [stdout] --> src/generator/custom.rs:14:8 [INFO] [stdout] | [INFO] [stdout] 14 | pub fn generate_typescript(idl: &IDL) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `ts_type_for` is never used [INFO] [stdout] --> src/generator/custom.rs:47:4 [INFO] [stdout] | [INFO] [stdout] 47 | fn ts_type_for(ty: &str) -> &str { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `generate_typescript_with_patterns` is never used [INFO] [stdout] --> src/generator/custom.rs:59:4 [INFO] [stdout] | [INFO] [stdout] 59 | fn generate_typescript_with_patterns(idl: &IDL) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:112:21 [INFO] [stdout] | [INFO] [stdout] 112 | let class = (data[0] & 0x07) as u8; // bits 0-2 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `(data[0] & 0x07)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:383:17 [INFO] [stdout] | [INFO] [stdout] 383 | / if self.imm == 0 { [INFO] [stdout] 384 | | return Err("Division by zero".to_string()); [INFO] [stdout] 385 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 382 ~ opcodes::UDIV32_IMM | opcodes::UDIV64_IMM [INFO] [stdout] 383 ~ if self.imm == 0 => { [INFO] [stdout] 384 | return Err("Division by zero".to_string()); [INFO] [stdout] 385 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:388:17 [INFO] [stdout] | [INFO] [stdout] 388 | / if self.imm < 0 || self.imm >= 32 { [INFO] [stdout] 389 | | return Err(format!("Invalid 32-bit shift amount {}", self.imm)); [INFO] [stdout] 390 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 387 ~ opcodes::LSH32_IMM | opcodes::RSH32_IMM | opcodes::ARSH32_IMM [INFO] [stdout] 388 ~ if (self.imm < 0 || self.imm >= 32) => { [INFO] [stdout] 389 | return Err(format!("Invalid 32-bit shift amount {}", self.imm)); [INFO] [stdout] 390 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:393:17 [INFO] [stdout] | [INFO] [stdout] 393 | / if self.imm < 0 || self.imm >= 64 { [INFO] [stdout] 394 | | return Err(format!("Invalid 64-bit shift amount {}", self.imm)); [INFO] [stdout] 395 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 392 ~ opcodes::LSH64_IMM | opcodes::RSH64_IMM | opcodes::ARSH64_IMM [INFO] [stdout] 393 ~ if (self.imm < 0 || self.imm >= 64) => { [INFO] [stdout] 394 | return Err(format!("Invalid 64-bit shift amount {}", self.imm)); [INFO] [stdout] 395 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/analyzer/bytecode/parser.rs:447:18 [INFO] [stdout] | [INFO] [stdout] 447 | imm: insn.imm as i64, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `insn.imm` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:449:5 [INFO] [stdout] | [INFO] [stdout] 449 | / if instructions.len() >= 3 { [INFO] [stdout] 450 | | if instructions[0].is_load() && [INFO] [stdout] 451 | | instructions[0].mem_size() == Some(8) && [INFO] [stdout] 452 | | (instructions[1].opcode == opcodes::JEQ_REG || [INFO] [stdout] ... | [INFO] [stdout] 458 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 449 ~ if instructions.len() >= 3 [INFO] [stdout] 450 ~ && instructions[0].is_load() && [INFO] [stdout] 451 | instructions[0].mem_size() == Some(8) && [INFO] [stdout] ... [INFO] [stdout] 456 | return true; [INFO] [stdout] 457 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:588:9 [INFO] [stdout] | [INFO] [stdout] 588 | if !error_codes.contains_key(&2000) { error_codes.insert(2000, "ConstraintMut".to_string()); } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `error_codes.entry(2000).or_insert_with(|| "ConstraintMut".to_string());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:589:9 [INFO] [stdout] | [INFO] [stdout] 589 | if !error_codes.contains_key(&2001) { error_codes.insert(2001, "ConstraintHasOne".to_string()); } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `error_codes.entry(2001).or_insert_with(|| "ConstraintHasOne".to_string());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:590:9 [INFO] [stdout] | [INFO] [stdout] 590 | if !error_codes.contains_key(&2002) { error_codes.insert(2002, "ConstraintSigner".to_string()); } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `error_codes.entry(2002).or_insert_with(|| "ConstraintSigner".to_string());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:609:12 [INFO] [stdout] | [INFO] [stdout] 609 | if (code >= 2000 && code < 3000) && s.contains("Constraint") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(2000..3000).contains(&code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:613:12 [INFO] [stdout] | [INFO] [stdout] 613 | if (code >= 3000 && code < 4000) && s.contains("Account") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(3000..4000).contains(&code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:738:40 [INFO] [stdout] | [INFO] [stdout] 738 | let account_name = s[8..].to_string(); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/analyzer/bytecode/pattern.rs:737:17 [INFO] [stdout] | [INFO] [stdout] 737 | if s.starts_with("account:") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 737 ~ if let Some() = s.strip_prefix("account:") { [INFO] [stdout] 738 ~ let account_name = .to_string(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/analyzer/bytecode/account_analyzer.rs:103:15 [INFO] [stdout] | [INFO] [stdout] 103 | accounts: &mut Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 103 - accounts: &mut Vec, [INFO] [stdout] 103 + accounts: &mut [Account], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:76:68 [INFO] [stdout] | [INFO] [stdout] 76 | let has_comparison = self.instructions.iter().take(10).any(|insn| [INFO] [stdout] | ____________________________________________________________________^ [INFO] [stdout] 77 | | is_conditional_branch(insn) [INFO] [stdout] | |_______________________________________^ help: replace the closure with the function itself: `is_conditional_branch` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:241:27 [INFO] [stdout] | [INFO] [stdout] 241 | fn connect_blocks(blocks: &mut Vec, analysis: &Analysis) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 241 - fn connect_blocks(blocks: &mut Vec, analysis: &Analysis) { [INFO] [stdout] 241 + fn connect_blocks(blocks: &mut [BasicBlock], analysis: &Analysis) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i16` -> `i16`) [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:253:37 [INFO] [stdout] | [INFO] [stdout] 253 | let target_offset = last_insn.offset as i16; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `last_insn.offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:267:28 [INFO] [stdout] | [INFO] [stdout] 267 | if source < target { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 268 | | // Add connection from source to target [INFO] [stdout] 269 | | blocks[source].successors.push(target); [INFO] [stdout] 270 | | blocks[target].predecessors.push(source); [INFO] [stdout] 271 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:271:16 [INFO] [stdout] | [INFO] [stdout] 271 | } else { [INFO] [stdout] | ________________^ [INFO] [stdout] 272 | | // Add connection from source to target [INFO] [stdout] 273 | | blocks[source].successors.push(target); [INFO] [stdout] 274 | | blocks[target].predecessors.push(source); [INFO] [stdout] 275 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:399:22 [INFO] [stdout] | [INFO] [stdout] 399 | (i > 0 && blocks[i-1].instructions.last().map_or(false, |insn| insn.opcode == opcodes::EXIT)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 399 - (i > 0 && blocks[i-1].instructions.last().map_or(false, |insn| insn.opcode == opcodes::EXIT)) { [INFO] [stdout] 399 + (i > 0 && blocks[i-1].instructions.last().is_some_and(|insn| insn.opcode == opcodes::EXIT)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/analyzer/bytecode/cfg.rs:455:9 [INFO] [stdout] | [INFO] [stdout] 455 | / if insn.is_branch() || insn.is_return() { [INFO] [stdout] 456 | | if i + 1 < instructions.len() { [INFO] [stdout] 457 | | block_starts.insert(i + 1); [INFO] [stdout] 458 | | } [INFO] [stdout] 459 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 455 ~ if (insn.is_branch() || insn.is_return()) { [INFO] [stdout] 456 ~ && i + 1 < instructions.len() { [INFO] [stdout] 457 | block_starts.insert(i + 1); [INFO] [stdout] 458 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/analyzer/bytecode/discriminator_detection.rs:154:16 [INFO] [stdout] | [INFO] [stdout] 154 | if syscall_id >= 0x100000 && syscall_id <= 0x1FFFFFF { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x100000..=0x1FFFFFF).contains(&syscall_id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/analyzer/bytecode/disassembler.rs:299:53 [INFO] [stdout] | [INFO] [stdout] 299 | } else if insn.contains(" stw") { [INFO] [stdout] | _____________________________________________________^ [INFO] [stdout] 300 | | 4 [INFO] [stdout] 301 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/analyzer/bytecode/disassembler.rs:301:28 [INFO] [stdout] | [INFO] [stdout] 301 | } else { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 302 | | 4 // Default [INFO] [stdout] 303 | | }; [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/analyzer/bytecode/instruction_analyzer.rs:73:23 [INFO] [stdout] | [INFO] [stdout] 73 | .find(|d| d.code.map_or(false, |code| code as usize == i)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 73 - .find(|d| d.code.map_or(false, |code| code as usize == i)); [INFO] [stdout] 73 + .find(|d| d.code.is_some_and(|code| code as usize == i)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 8]` which implements the `Copy` trait [INFO] [stdout] --> src/analyzer/bytecode/instruction_analyzer.rs:91:46 [INFO] [stdout] | [INFO] [stdout] 91 | instruction.discriminator = Some(disc.bytes.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `disc.bytes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `instructions` [INFO] [stdout] --> src/analyzer/bytecode/error_analyzer.rs:51:14 [INFO] [stdout] | [INFO] [stdout] 51 | for i in start..end { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 51 - for i in start..end { [INFO] [stdout] 51 + for in instructions.iter().take(end).skip(start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:139:5 [INFO] [stdout] | [INFO] [stdout] 139 | confidence.max(0.0).min(1.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `confidence.clamp(0.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:183:8 [INFO] [stdout] | [INFO] [stdout] 183 | if name.chars().next().map_or(false, |c| c.is_uppercase()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 183 - if name.chars().next().map_or(false, |c| c.is_uppercase()) { [INFO] [stdout] 183 + if name.chars().next().is_some_and(|c| c.is_uppercase()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:188:5 [INFO] [stdout] | [INFO] [stdout] 188 | confidence.max(0.0).min(1.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `confidence.clamp(0.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:204:25 [INFO] [stdout] | [INFO] [stdout] 204 | let is_camel_case = name.chars().next().map_or(false, |c| c.is_lowercase()) && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 204 - let is_camel_case = name.chars().next().map_or(false, |c| c.is_lowercase()) && [INFO] [stdout] 204 + let is_camel_case = name.chars().next().is_some_and(|c| c.is_lowercase()) && [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:220:25 [INFO] [stdout] | [INFO] [stdout] 220 | let is_camel_case = name.chars().next().map_or(false, |c| c.is_lowercase()) && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 220 - let is_camel_case = name.chars().next().map_or(false, |c| c.is_lowercase()) && [INFO] [stdout] 220 + let is_camel_case = name.chars().next().is_some_and(|c| c.is_lowercase()) && [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/analyzer/bytecode/string_analyzer.rs:247:5 [INFO] [stdout] | [INFO] [stdout] 247 | confidence.max(0.0).min(1.0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `confidence.clamp(0.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:96:1 [INFO] [stdout] | [INFO] [stdout] 96 | / impl Default for BytecodeAnalysis { [INFO] [stdout] 97 | | fn default() -> Self { [INFO] [stdout] 98 | | Self { [INFO] [stdout] 99 | | instructions: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 110 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 64 + #[derive(Default)] [INFO] [stdout] 65 | pub struct BytecodeAnalysis { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:309:54 [INFO] [stdout] | [INFO] [stdout] 309 | fn match_native_instruction_codes(instruction_codes: &mut Vec<(u8, Option)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 309 - fn match_native_instruction_codes(instruction_codes: &mut Vec<(u8, Option)>) { [INFO] [stdout] 309 + fn match_native_instruction_codes(instruction_codes: &mut [(u8, Option)]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's keys [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:456:31 [INFO] [stdout] | [INFO] [stdout] 456 | for (s, _) in &string_analysis.instruction_names { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 456 - for (s, _) in &string_analysis.instruction_names { [INFO] [stdout] 456 + for s in string_analysis.instruction_names.keys() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `instructions` [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:542:14 [INFO] [stdout] | [INFO] [stdout] 542 | for i in start_idx..(start_idx + 50).min(instructions.len()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 542 - for i in start_idx..(start_idx + 50).min(instructions.len()) { [INFO] [stdout] 542 + for in instructions.iter().take((start_idx + 50).min(instructions.len())).skip(start_idx) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:557:23 [INFO] [stdout] | [INFO] [stdout] 557 | offset += insn.size as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `insn.size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:611:31 [INFO] [stdout] | [INFO] [stdout] 611 | } else if is_writable { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 612 | | format!("account_{}", idx) [INFO] [stdout] 613 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/analyzer/bytecode/mod.rs:613:16 [INFO] [stdout] | [INFO] [stdout] 613 | } else { [INFO] [stdout] | ________________^ [INFO] [stdout] 614 | | format!("account_{}", idx) [INFO] [stdout] 615 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/analyzer/anchor.rs:248:75 [INFO] [stdout] | [INFO] [stdout] 248 | let prefix_len = if string.starts_with("ERROR: ") { 7 } else { 7 }; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/analyzer/anchor.rs:248:86 [INFO] [stdout] | [INFO] [stdout] 248 | let prefix_len = if string.starts_with("ERROR: ") { 7 } else { 7 }; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/analyzer/anchor.rs:282:21 [INFO] [stdout] | [INFO] [stdout] 282 | / if !error_codes.contains_key(&error_code) { [INFO] [stdout] 283 | | error_codes.insert(error_code, format!("CustomError{}", error_code - 6000)); [INFO] [stdout] 284 | | } [INFO] [stdout] | |_____________________^ help: try: `error_codes.entry(error_code).or_insert_with(|| format!("CustomError{}", error_code - 6000));` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/analyzer/patterns.rs:427:5 [INFO] [stdout] | [INFO] [stdout] 427 | patterns.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 427 - patterns.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [INFO] [stdout] 427 + patterns.sort_by_key(|b| std::cmp::Reverse(b.frequency)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/analyzer/patterns.rs:609:17 [INFO] [stdout] | [INFO] [stdout] 609 | slice[4..].iter().any(|&b| b == 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `slice[4..].contains(&0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/analyzer/patterns.rs:752:5 [INFO] [stdout] | [INFO] [stdout] 752 | patterns.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 752 - patterns.sort_by(|a, b| b.frequency.cmp(&a.frequency)); [INFO] [stdout] 752 + patterns.sort_by_key(|b| std::cmp::Reverse(b.frequency)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/analyzer/patterns.rs:992:5 [INFO] [stdout] | [INFO] [stdout] 992 | / match transaction { [INFO] [stdout] 993 | | solana_transaction_status::EncodedTransaction::Json(ui_transaction) => { [INFO] [stdout] 994 | | // Process JSON-encoded transaction [INFO] [stdout] 995 | | let ui_message = &ui_transaction.message; [INFO] [stdout] ... | [INFO] [stdout] 1031 | | _ => {} [INFO] [stdout] 1032 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 992 ~ if let solana_transaction_status::EncodedTransaction::Json(ui_transaction) = transaction { [INFO] [stdout] 993 + // Process JSON-encoded transaction [INFO] [stdout] 994 + let ui_message = &ui_transaction.message; [INFO] [stdout] 995 + [INFO] [stdout] 996 + // Extract accounts based on message type [INFO] [stdout] 997 + match ui_message { [INFO] [stdout] 998 + UiMessage::Parsed(parsed_message) => { [INFO] [stdout] 999 + // Find program instructions [INFO] [stdout] 1000 + for instruction in &parsed_message.instructions { [INFO] [stdout] 1001 + if let Some(program_id_str) = get_program_id(instruction, ui_message) { [INFO] [stdout] 1002 + if program_id_str == program_id.to_string() { [INFO] [stdout] 1003 + // Extract accounts for this instruction [INFO] [stdout] 1004 + if let Some(account_indices) = get_instruction_accounts(instruction) { [INFO] [stdout] 1005 + for (idx, account_idx) in account_indices.iter().enumerate() { [INFO] [stdout] 1006 + let account_idx = account_idx.parse::()?; [INFO] [stdout] 1007 + if account_idx < parsed_message.account_keys.len() { [INFO] [stdout] 1008 + let account_key = &parsed_message.account_keys[account_idx]; [INFO] [stdout] 1009 + let is_signer = account_key.signer; [INFO] [stdout] 1010 + let is_writable = account_key.writable; [INFO] [stdout] 1011 + [INFO] [stdout] 1012 + accounts.push(TransactionAccount { [INFO] [stdout] 1013 + pubkey: account_key.pubkey.clone(), [INFO] [stdout] 1014 + is_signer, [INFO] [stdout] 1015 + is_writable, [INFO] [stdout] 1016 + position: idx, [INFO] [stdout] 1017 + }); [INFO] [stdout] 1018 + } [INFO] [stdout] 1019 + } [INFO] [stdout] 1020 + } [INFO] [stdout] 1021 + } [INFO] [stdout] 1022 + } [INFO] [stdout] 1023 + } [INFO] [stdout] 1024 + }, [INFO] [stdout] 1025 + // Handle other message types... [INFO] [stdout] 1026 + _ => {} [INFO] [stdout] 1027 + } [INFO] [stdout] 1028 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/analyzer/patterns.rs:998:13 [INFO] [stdout] | [INFO] [stdout] 998 | / match ui_message { [INFO] [stdout] 999 | | UiMessage::Parsed(parsed_message) => { [INFO] [stdout] 1000 | | // Find program instructions [INFO] [stdout] 1001 | | for instruction in &parsed_message.instructions { [INFO] [stdout] ... | [INFO] [stdout] 1027 | | _ => {} [INFO] [stdout] 1028 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 998 ~ if let UiMessage::Parsed(parsed_message) = ui_message { [INFO] [stdout] 999 + // Find program instructions [INFO] [stdout] 1000 + for instruction in &parsed_message.instructions { [INFO] [stdout] 1001 + if let Some(program_id_str) = get_program_id(instruction, ui_message) { [INFO] [stdout] 1002 + if program_id_str == program_id.to_string() { [INFO] [stdout] 1003 + // Extract accounts for this instruction [INFO] [stdout] 1004 + if let Some(account_indices) = get_instruction_accounts(instruction) { [INFO] [stdout] 1005 + for (idx, account_idx) in account_indices.iter().enumerate() { [INFO] [stdout] 1006 + let account_idx = account_idx.parse::()?; [INFO] [stdout] 1007 + if account_idx < parsed_message.account_keys.len() { [INFO] [stdout] 1008 + let account_key = &parsed_message.account_keys[account_idx]; [INFO] [stdout] 1009 + let is_signer = account_key.signer; [INFO] [stdout] 1010 + let is_writable = account_key.writable; [INFO] [stdout] 1011 + [INFO] [stdout] 1012 + accounts.push(TransactionAccount { [INFO] [stdout] 1013 + pubkey: account_key.pubkey.clone(), [INFO] [stdout] 1014 + is_signer, [INFO] [stdout] 1015 + is_writable, [INFO] [stdout] 1016 + position: idx, [INFO] [stdout] 1017 + }); [INFO] [stdout] 1018 + } [INFO] [stdout] 1019 + } [INFO] [stdout] 1020 + } [INFO] [stdout] 1021 + } [INFO] [stdout] 1022 + } [INFO] [stdout] 1023 + } [INFO] [stdout] 1024 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/analyzer/simulation/mod.rs:207:21 [INFO] [stdout] | [INFO] [stdout] 207 | let error = if let Some(err) = &result.value.err { [INFO] [stdout] | _____________________^ [INFO] [stdout] 208 | | Some(format!("{:?}", err)) [INFO] [stdout] 209 | | } else { [INFO] [stdout] 210 | | None [INFO] [stdout] 211 | | }; [INFO] [stdout] | |_________^ help: try: `result.value.err.as_ref().map(|err| format!("{:?}", err))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/analyzer/simulation/mod.rs:258:71 [INFO] [stdout] | [INFO] [stdout] 258 | fn generate_mock_accounts(&self, instruction: &IdlInstruction) -> anyhow::Result<(Vec, HashMap>)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/analyzer/simulation/mod.rs:764:18 [INFO] [stdout] | [INFO] [stdout] 764 | .map_err(|e| anyhow::Error::from(e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `anyhow::Error::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Analyzer` [INFO] [stdout] --> src/analyzer/mod.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | / pub fn new() -> Self { [INFO] [stdout] 31 | | Self {} [INFO] [stdout] 32 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 28 + impl Default for Analyzer { [INFO] [stdout] 29 + fn default() -> Self { [INFO] [stdout] 30 + Self::new() [INFO] [stdout] 31 + } [INFO] [stdout] 32 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/monitor/rpc.rs:288:48 [INFO] [stdout] | [INFO] [stdout] 288 | ... if data.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!data.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/monitor/rpc.rs:317:64 [INFO] [stdout] | [INFO] [stdout] 317 | ... if program_data.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!program_data.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/monitor/transaction.rs:35:18 [INFO] [stdout] | [INFO] [stdout] 35 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/monitor/transaction.rs:153:17 [INFO] [stdout] | [INFO] [stdout] 153 | slice[4..].iter().any(|&b| b == 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `slice[4..].contains(&0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/monitor/transaction.rs:252:17 [INFO] [stdout] | [INFO] [stdout] 252 | / if *instruction.program_id(decoded.message.static_account_keys()) == *program_id { [INFO] [stdout] 253 | | if !instruction.data.is_empty() { [INFO] [stdout] 254 | | let discriminator = instruction.data[0]; [INFO] [stdout] 255 | | grouped_txs.entry(discriminator) [INFO] [stdout] ... | [INFO] [stdout] 259 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 252 ~ if *instruction.program_id(decoded.message.static_account_keys()) == *program_id [INFO] [stdout] 253 ~ && !instruction.data.is_empty() { [INFO] [stdout] 254 | let discriminator = instruction.data[0]; [INFO] [stdout] ... [INFO] [stdout] 257 | .push(tx); [INFO] [stdout] 258 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/monitor/transaction.rs:256:30 [INFO] [stdout] | [INFO] [stdout] 256 | ... .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/monitor/transaction.rs:338:17 [INFO] [stdout] | [INFO] [stdout] 338 | / if *instruction.program_id(decoded.message.static_account_keys()) == *program_id { [INFO] [stdout] 339 | | if !instruction.data.is_empty() && instruction.data[0] == discriminator { [INFO] [stdout] 340 | | // Skip the discriminator byte [INFO] [stdout] 341 | | if instruction.data.len() > 1 { [INFO] [stdout] ... | [INFO] [stdout] 345 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 338 ~ if *instruction.program_id(decoded.message.static_account_keys()) == *program_id [INFO] [stdout] 339 ~ && !instruction.data.is_empty() && instruction.data[0] == discriminator { [INFO] [stdout] 340 | // Skip the discriminator byte [INFO] [stdout] ... [INFO] [stdout] 343 | } [INFO] [stdout] 344 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/models/instruction.rs:89:29 [INFO] [stdout] | [INFO] [stdout] 89 | if self.is_writable { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 90 | | if self.is_signer { [INFO] [stdout] 91 | | solana_instruction::AccountMeta::new(*pubkey, true) [INFO] [stdout] 92 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 95 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/models/instruction.rs:95:16 [INFO] [stdout] | [INFO] [stdout] 95 | } else { [INFO] [stdout] | ________________^ [INFO] [stdout] 96 | | if self.is_signer { [INFO] [stdout] 97 | | solana_instruction::AccountMeta::new(*pubkey, true) [INFO] [stdout] 98 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 101 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/generator/custom.rs:80:9 [INFO] [stdout] | [INFO] [stdout] 80 | ts_code.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `ts_code.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/generator/custom.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | ts_code.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `ts_code.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/constants/opcodes.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | / pub mod opcodes { [INFO] [stdout] 3 | | // Memory Load or 32-bit ALU operations (Class 0) [INFO] [stdout] 4 | | pub const LDDW: u8 = 0x18; // Load double word immediate [INFO] [stdout] 5 | | pub const ADD32_IMM: u8 = 0x04; // 32-bit add immediate [INFO] [stdout] ... | [INFO] [stdout] 136 | | pub const MOV_REG: u8 = 0xbf; // Move register to register [INFO] [stdout] 137 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/constants/syscalls.rs:4:1 [INFO] [stdout] | [INFO] [stdout] 4 | / pub mod syscalls { [INFO] [stdout] 5 | | // Core Solana Syscalls [INFO] [stdout] 6 | | pub const SOL_PANIC: u32 = 0x686093bb; [INFO] [stdout] 7 | | pub const SOL_LOG: u32 = 0x3d082901; [INFO] [stdout] ... | [INFO] [stdout] 61 | | pub const SOL_BIG_INTEGER_MODULO: u32 = 0xf3a5e9de; [INFO] [stdout] 62 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/utils/account_analysis.rs:171:5 [INFO] [stdout] | [INFO] [stdout] 171 | i64::from_str_radix(program_id, 10).unwrap_or_default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `program_id.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] = note: `#[warn(clippy::from_str_radix_10)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/utils/error_analysis.rs:26:16 [INFO] [stdout] | [INFO] [stdout] 26 | if (potential_error_code >= 100 && potential_error_code < 10000) || [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(100..10000).contains(&potential_error_code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/utils/error_analysis.rs:27:16 [INFO] [stdout] | [INFO] [stdout] 27 | (potential_error_code >= 0x100 && potential_error_code <= 0xFFFF) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x100..=0xFFFF).contains(&potential_error_code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/utils/error_analysis.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | / if !error_codes.contains_key(&potential_error_code) { [INFO] [stdout] 34 | | error_codes.insert(potential_error_code, name); [INFO] [stdout] 35 | | } [INFO] [stdout] | |_________________^ help: try: `error_codes.entry(potential_error_code).or_insert(name);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `instructions` [INFO] [stdout] --> src/utils/error_analysis.rs:168:14 [INFO] [stdout] | [INFO] [stdout] 168 | for i in start..end { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 168 - for i in start..end { [INFO] [stdout] 168 + for in instructions.iter().take(end).skip(start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 3m 52s [INFO] running `Command { std: "docker" "inspect" "d2b5cfe7a3e94755632bd625a042b5d6349814a66e38128c26dd0349919318bd", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d2b5cfe7a3e94755632bd625a042b5d6349814a66e38128c26dd0349919318bd", kill_on_drop: false }` [INFO] [stdout] d2b5cfe7a3e94755632bd625a042b5d6349814a66e38128c26dd0349919318bd