Skip to content

Commit

Permalink
solana: add 'dylint' security linting tool
Browse files Browse the repository at this point in the history
Add support for the dylint tool. Configures Cargo.toml to use lints
designed to help identify issues in Solana/Anchor code.
  • Loading branch information
johnsaigle committed Feb 29, 2024
1 parent 22bde0c commit 85b522b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions solana/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ codegen-units = 1
opt-level = 3
incremental = false
codegen-units = 1

# Linting tool for vulnerable anchor patterns
[workspace.metadata.dylint]
libraries = [
{ git = "https://github.com/crytic/solana-lints", pattern = "lints/*" },
]
5 changes: 5 additions & 0 deletions solana/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ node_modules: package-lock.json
clean:
anchor clean
rm -rf .anchor node_modules

# To run, install dependencies: `cargo install cargo-dylint dylint-link`
.PHONY: lint
lint:
cargo dylint --all --workspace

0 comments on commit 85b522b

Please sign in to comment.