crytic/slither

slither-optimize: Tool to hint code size optimizations

Open

#809 opened on Mar 25, 2021

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Python (886 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (4,769 stars)
PR merge metrics
 (Avg merge 54d 9h) (2 merged PRs in 30d)

Description

More and more people are reaching the code size limit, even with optimizers enabled. We can create a tool based on slither that will highlight some optimizations to reduce the code size.

Example:

  • Replace modifiers with internal calls (we need to investigate the limit when this becomes efficient)
  • Regroup duplicate code with internal functions
  • Find if a parameter is always the same in all the internal calls
  • How to split a contract into multiple ones (see https://github.com/crytic/slither/issues/471)
  • ...

We can also create automatic patches for some rules (ex: modifier to internal calls)

Contributor guide