Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add entry-points printer to identify all externally accessible state-changing functions #2616

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

nisedo
Copy link

@nisedo nisedo commented Dec 13, 2024

Description

This PR adds a new printer that identifies all externally accessible state-changing functions (entry points) of Solidity smart contracts.
The printer helps in security analysis by providing a clear overview of possible external interactions and assists auditors in identifying all workflows that need to be reviewed during security assessments.

Key features:

  • Filters out view/pure functions, constructors, and special functions (receive/fallback)
  • Excludes contracts from utility/testing directories (lib/, node_modules/, mock/)
  • Shows inheritance information for each contract
  • Displays function modifiers and inherited function origins
  • Color-coded output for better readability

The printer can be used with:
slither <contract> --print entry-points

Example output:

Screenshot 2024-12-13 at 10 11 50

The implementation can be found in:
slither/printers/summary/entry_points.py

Note

Currently, this printer only supports Solidity files. Support for Vyper contracts will be implemented in a future update.

@CLAassistant
Copy link

CLAassistant commented Dec 13, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants