2021-04-15 00:37:46 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, makeWrapper
|
|
|
|
, pythonOlder
|
|
|
|
, crytic-compile
|
|
|
|
, prettytable
|
|
|
|
, setuptools
|
|
|
|
, solc
|
2021-12-19 01:06:50 +00:00
|
|
|
, withSolc ? false
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "slither-analyzer";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "0.8.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "sha256-77045eB7KvHBb0j61qz4zJTtEprg4/aH6MrPlQY1wiM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
crytic-compile
|
|
|
|
prettytable
|
|
|
|
setuptools
|
|
|
|
];
|
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";
|
2021-02-13 14:23:35 +00:00
|
|
|
license = licenses.agpl3Plus;
|
2021-05-03 20:48:10 +00:00
|
|
|
maintainers = with maintainers; [ arturcygan fab ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|