crytic / crytic/slither

Include _get_source_code into Function class

Open
#2,234 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

### Describe the desired feature

even if not used by any printer because of how cli formatting works with PrettyTables, it's actually a useful method to have accessible when working with Python API directly, currently this method is located only in

https://github.com/crytic/slither/blob/e3dcf1ecd3e9de60da046de471c5663ab637993a/slither/printers/summary/constructor_calls.py#L11

forcing any python script to import it using the following path

`from slither.printers.summary.constructor_calls import _get_source_code
`

`_get_source_code` function would be better located inside of a [Function class](https://github.com/crytic/slither/blob/master/slither/core/declarations/function.py). increased function visibility in the codebase will also save developers time on asking chatgpt how to regex solidity function.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.