Skip to content

Commit

Permalink
Reduced size
Browse files Browse the repository at this point in the history
  • Loading branch information
forefy committed Feb 4, 2024
1 parent c6d3b77 commit 1165bd8
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 1,232 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Upload Python Package to PyPi

on:
release:
types: [published]

jobs:
build-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Build dists
run: |
python -m pip install --upgrade pip
pip install build
- name: Upload dists
uses: actions/upload-artifact@v3
with:
name: eburger-dists
path: dist/

publish:
runs-on: ubuntu-latest

environment: release

permissions:
id-token: write
contents: write

needs:
- build-release

steps:
- name: Fetch dists
uses: actions/download-artifact@v3
with:
name: eburger-dists
path: dist/

- name: publish
uses: pypa/[email protected]
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ Running scanners won't win you competitions. spin up custom templates tailored t
## Comparison table
Comparison of actively maintained / popular solidity smart contract static analyzers

| Static Analyzer | Language | Visualization Graph | 2 Minutes to write a custom template with ChatGPT | Many findings that are already found before the contest began | Would want to eat |
|--------------------------------------------------------|-----------------|------------------------|-------------------------------------------------------|---------------------------------------------------------------|-------------------|
| [eBurger](https://github.com/forefy/eburger) | Python || | ||
| [Slither](https://github.com/crytic/slither) | Python | | || |
| [4naly3er](https://github.com/Picodes/4naly3er) | TypeScript 🤮 | | || |
| [mythril](https://github.com/Consensys/mythril) | Python | | | | |
| [aderyn](https://github.com/Cyfrin/aderyn) | Rust | | | | |
| Static Analyzer | Language | 2 Minutes to write a custom template with ChatGPT | Many findings that are already found before the contest began | Would want to eat |
|--------------------------------------------------------|-----------------|-------------------------------------------------------|---------------------------------------------------------------|-------------------|
| [eBurger](https://github.com/forefy/eburger) | Python || ||
| [Slither](https://github.com/crytic/slither) | Python | || |
| [4naly3er](https://github.com/Picodes/4naly3er) | TypeScript 🤮 | || |
| [mythril](https://github.com/Consensys/mythril) | Python | | | |
| [aderyn](https://github.com/Cyfrin/aderyn) | Rust | | | |


Forgot one or made a mistake? open a pull request or an issue :)
Expand All @@ -36,10 +36,8 @@ Here's a demo video

https://github.com/forefy/eburger/assets/152717707/65bf6a6d-adbc-4664-84d4-73ac641a8307

Above example will also generate an AST, pythonified AST and a visual call flow graph under the folder `.eburger`.
Besides `eburger-output.json`, above example will also generate extended info under the folder `.eburger`.

Here's an example of an interactive graph
![eBurger](static/network_graph.png?raw=true "eBurger Network Graph")

## How to install
These commands will make `eburger` available from anywhere:
Expand All @@ -57,7 +55,7 @@ Simplest:
```bash
cd MyProject/
eburger
cat eburger-results.json
cat eburger-output.json
```
..

Expand All @@ -84,7 +82,6 @@ For documentation refer to the [Wiki](https://github.com/forefy/eburger/wiki/Tem
- YAML template support to query contract structure and raise insights for any matches
- Fast learning curve for adding templates, ability to customize templates to the current ongoing audit project
- Foundry and Hardhat support ❣️
- Call Flow Graph inspired by naming conventions of Solidity - Extensive control on graph layout, ability to search specific segments and highlight by parameter, function, contract etc
- View only the code related to the contract and not all the libraries in the world
- Community and free support via [Discord](https://discord.gg/WaVMpBtxdB)

Expand Down
9 changes: 1 addition & 8 deletions eburger/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@
from eburger.serializer import parse_solidity_ast, reduce_json
from eburger.utils.outputs import (
calculate_nsloc,
draw_graph,
draw_nsloc_table,
save_as_json,
save_python_ast,
)
from eburger.yaml_parser import process_files_concurrently

Expand Down Expand Up @@ -203,12 +201,7 @@ def main():
save_as_json(output_filename, solc_compile_res_parsed)

# Parse AST
G = nx.MultiDiGraph()
ast_roots, G = parse_solidity_ast(ast_json, G)

# Draw graph
draw_graph(settings.outputs_dir / filename, G)
save_python_ast(filename, ast_roots)
ast_roots = parse_solidity_ast(ast_json)

# Parse YAML templates
if args.template_paths:
Expand Down
Loading

0 comments on commit 1165bd8

Please sign in to comment.