Skip to content

Commit

Permalink
Merge pull request #139 from JoranHonig/master
Browse files Browse the repository at this point in the history
Add entry point for napalm
  • Loading branch information
ndkirillov authored May 6, 2024
2 parents 91562ba + 3581c9a commit 2d386c8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
entry_points={
"slither_analyzer.plugin": "slither slitherin-plugins=slitherin:make_plugin",
"console_scripts": ["slitherin=slitherin.cli:main"],
"napalm.collection": ["slitherin=slitherin.napalm:entry_point"],
},
include_package_data=True,
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
SolidityFunction,
)

from ...consts import ARBITRUM_KEY
from slitherin.consts import ARBITRUM_KEY


class ArbitrumPrevrandaoDifficulty(AbstractDetector):
Expand Down
2 changes: 1 addition & 1 deletion slitherin/detectors/arbitrum/block_number_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
SolidityFunction,
)

from ...consts import ARBITRUM_KEY
from slitherin.consts import ARBITRUM_KEY


class ArbitrumBlockNumberTimestamp(AbstractDetector):
Expand Down
2 changes: 1 addition & 1 deletion slitherin/detectors/read_only_reentrancy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from slither.core.declarations import Function
from slither.core.cfg.node import NodeType, Node, Contract
from slither.detectors.abstract_detector import DetectorClassification
from .reentrancy.reentrancy import (
from slitherin.detectors.reentrancy.reentrancy import (
Reentrancy,
to_hashable,
AbstractState,
Expand Down
18 changes: 18 additions & 0 deletions slitherin/napalm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import napalm.package
import slitherin as slitherin


def entry_point():
"""This is the entry point for the napalm package.
It provisions your detection modules and provides them to napalm.
It returns a dictionary of Collections, keyed by the name of the collection.
"""
_include = ("detectors",)

return [
collection
for collection in napalm.package.entry_point(slitherin)
if collection.collection_name in _include
]

0 comments on commit 2d386c8

Please sign in to comment.