2021-04-15 00:37:46 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
2023-01-20 10:41:00 +00:00
|
|
|
, crytic-compile
|
2022-04-27 09:35:20 +00:00
|
|
|
, fetchFromGitHub
|
2021-04-15 00:37:46 +00:00
|
|
|
, makeWrapper
|
2023-01-20 10:41:00 +00:00
|
|
|
, packaging
|
2021-04-15 00:37:46 +00:00
|
|
|
, prettytable
|
2023-01-20 10:41:00 +00:00
|
|
|
, pythonOlder
|
2021-04-15 00:37:46 +00:00
|
|
|
, setuptools
|
|
|
|
, solc
|
2023-08-04 22:07:22 +00:00
|
|
|
, web3
|
2021-12-19 01:06:50 +00:00
|
|
|
, withSolc ? false
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "slither-analyzer";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "0.9.6";
|
2022-04-27 09:35:20 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "crytic";
|
|
|
|
repo = "slither";
|
2022-10-06 18:32:54 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-c6H7t+aPPWn1i/30G9DLOmwHhdHHHbcP3FRVVjk1XR4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
crytic-compile
|
2023-01-20 10:41:00 +00:00
|
|
|
packaging
|
2021-05-03 20:48:10 +00:00
|
|
|
prettytable
|
|
|
|
setuptools
|
2023-08-04 22:07:22 +00:00
|
|
|
web3
|
2021-05-03 20:48:10 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
postFixup = lib.optionalString withSolc ''
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapProgram $out/bin/slither \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ solc ]}"
|
|
|
|
'';
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
# No Python tests
|
|
|
|
doCheck = false;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Static Analyzer for Solidity";
|
|
|
|
longDescription = ''
|
|
|
|
Slither is a Solidity static analysis framework written in Python 3. It
|
|
|
|
runs a suite of vulnerability detectors, prints visual information about
|
|
|
|
contract details, and provides an API to easily write custom analyses.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/trailofbits/slither";
|
2023-01-20 10:41:00 +00:00
|
|
|
changelog = "https://github.com/crytic/slither/releases/tag/${version}";
|
2021-02-13 14:23:35 +00:00
|
|
|
license = licenses.agpl3Plus;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ arturcygan fab hellwolf ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|