Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-Becker committed Sep 2, 2024
1 parent 262baf3 commit d85fe74
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions examples/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,8 @@

This Python script demonstrates how to use the `heimdall` CLI tool to decompile smart contracts via Python. It provides a simple class structure to define arguments and manage the decompilation process, with support for customizing various decompilation options.

## Overview

The script utilizes the `heimdall decompile` command to decompile a target contract and retrieve its Solidity and Yul source code, along with its ABI. For ease of use, the script abstracts the command-line interface of `heimdall` into a Python class, allowing users to easily invoke the decompilation process programmatically.

### Key Components

- **DecompileArgs**: A class to define the arguments for the decompilation process, such as the target contract address, RPC URL, and other flags.
- **DecompiledContract**: A class to represent the output of the decompilation, including the Solidity/Yul source code and ABI.
- **Decompiler**: A class that abstracts the `heimdall decompile` command, handling argument parsing and command execution.
- **is_heimdall_installed**: A utility function to check if the `heimdall` CLI tool is installed on the system.
_Note: This is just an example for the decompile module, but a similar approach will work for all heimdall modules._

## Usage

1. **Install `heimdall`**: Ensure that the `heimdall` CLI tool is installed on your system.

```bash
which heimdall

2. **Run the Script**: Execute the Python script to decompile a target contract.
## Overview

```bash
python main.py
```
The script utilizes the `heimdall decompile` command to decompile a target contract and retrieve its Solidity and Yul source code, along with its ABI. For ease of use, the script abstracts the command-line interface of `heimdall` into a Python class, allowing users to easily call the decompilation process in their Python scripts.

0 comments on commit d85fe74

Please sign in to comment.