Skip to content

Commit 6c05713

Browse files
committed
Add slither security analysis package
1 parent 25a45f9 commit 6c05713

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
1. Create `packages/slither/default.nix` implementing a Nix expression using `python3Packages.buildPythonApplication`.
2+
3+
* Fetch the PyPI release `slither-analyzer` (e.g. version `0.11.3`).
4+
* Include propagated dependencies such as `packaging`, `prettytable`, `pycryptodome`, `crytic-compile`, `web3`, `eth-abi`, `eth-typing`, and `eth-utils`.
5+
* Set `mainProgram = "slither"` in `meta`.
6+
2. Register the package in `packages/all-packages.nix` inside `legacyPackages.metacraft-labs`.
7+
3. Optionally list the new package in `README.md` under a “Security and Static Analysis” section.
8+
9+
Make sure that the package works

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ via one of the flake output categories:
8383
| -------------------------- | ---------------------------------------------- | ------------------- |
8484
| [pistache]([pistache-url]) | A high-performance REST toolkit written in C++ | x86_64-linux |
8585

86+
### Security and Static Analysis
87+
88+
| package name | description | supported platforms |
89+
| ------------ | ----------- | ------------------- |
90+
| [slither]([slither-url]) | Static analysis framework for Solidity | x86_64-linux, x86_64-darwin |
91+
8692
[cosmos-url]: https://github.com/hyphacoop/testnets/blob/master/local/previous-local-testnets/v7-theta/priv_validator_key.json
8793
[emscripten-url]: https://github.com/emscripten-core/emscripten
8894
[avalanche-url]: https://github.com/ava-labs/avalanche-cli
@@ -112,6 +118,7 @@ via one of the flake output categories:
112118
[rapidsnark-url]: https://github.com/iden3/rapidsnark-old
113119
[wasmd-url]: https://github.com/CosmWasm/wasmd
114120
[polkadot-fast-url]: https://github.com/paritytech/polkadot/blob/52209dcfe546ff39cc031b92d64e787e7e8264d4/Cargo.toml#L228
121+
[slither-url]: https://github.com/crytic/slither
115122

116123
## Usage examples
117124

packages/all-packages.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@
185185
};
186186

187187
inherit corepack-shims;
188+
slither = callPackage ./slither { };
188189
}
189190
// lib.optionalAttrs hostPlatform.isLinux rec {
190191
kurtosis = callPackage ./kurtosis/default.nix { };

packages/slither/default.nix

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{ lib, python3Packages }:
2+
3+
python3Packages.buildPythonApplication rec {
4+
pname = "slither";
5+
version = "0.11.3";
6+
7+
src = python3Packages.fetchPypi {
8+
pname = "slither_analyzer";
9+
inherit version;
10+
sha256 = "09953ddb89d9ab182aa5826bda6fa3da482c82b5ffa371e34b35ba766044616e";
11+
};
12+
13+
propagatedBuildInputs = with python3Packages; [
14+
packaging
15+
prettytable
16+
pycryptodome
17+
crytic-compile
18+
web3
19+
eth-abi
20+
eth-typing
21+
eth-utils
22+
];
23+
24+
doCheck = false;
25+
26+
meta = with lib; {
27+
description = "Static analysis framework for Solidity";
28+
homepage = "https://github.com/crytic/slither";
29+
license = licenses.agpl3;
30+
mainProgram = "slither";
31+
platforms = platforms.all;
32+
};
33+
}

0 commit comments

Comments
 (0)