1 unstable release

0.2.0 Dec 13, 2022

#2100 in Development tools

Download history 4/week @ 2024-02-19 14/week @ 2024-02-26 4/week @ 2024-03-04 6/week @ 2024-03-11 70/week @ 2024-03-25 19/week @ 2024-04-01

89 downloads per month
Used in 2 crates (via substrace_lints)

MIT license

490KB
10K SLoC

Substrace: Experimental Static Analysis for Substrate Projects

Substrace is a tool for linting substrate projects for specific gotchas and other errors.

Installing

Install through cargo install substrace. Run using cargo substrace.

Content

Currently the following lints are used:

  • missing_security_doc: checks for the presence Security headers on storage maps using suspicious hashing functions, such as Twox64Concat.
  • panics: ensures that clippy has been properly configured to avoid panics in code.
  • missing_transactional: ensures that extrinsics are marked with the #[transactional] label
  • extrinsics_must_be_tagged: ensures that extrinsics are marked with the #[pallet::call_index(...)] label

More lints will be added in the future, initially targetting checks that ensure storage consistencies. Currently in the works:

  • storage_iter_insert: checks that storage isn't simultaniously being mutated whilst iteration is active.
  • enable_singlepass_benchmarks: checks that benchmarks are run when calling cargo test
  • xcm_config_check: checks that the xcm config does not make the same mistake as the Karura bug

Dependencies

~510KB