2021-04-15 00:37:46 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
2022-04-27 09:35:20 +00:00
|
|
|
, fetchFromGitHub
|
2021-04-15 00:37:46 +00:00
|
|
|
, 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";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "0.8.3";
|
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "crytic";
|
|
|
|
repo = "slither";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-Kh5owlkRB9hDlfIRiS+aNFe4YtZj38CLeE3Fe+R7diM=";
|
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
|
|
|
};
|
|
|
|
}
|