Skip to main content

A package for decoding and analyzing EVM transactions and logs

Project description

EVM Decoder

EVM Decoder is a Python package for decoding and analyzing Ethereum Virtual Machine (EVM) transactions and logs. It provides tools to help developers and researchers understand and work with EVM-based blockchain data.

Features

  • Decode EVM transaction input data
  • Decode EVM event logs
  • Analyze balance changes in transactions
  • Support for custom ABI and fixed types
  • Retrieve chain information for various EVM-compatible networks

Installation

You can install the EVM Decoder package using pip:

bash
pip install evm-decoder

Usage

It can decode logs: event_data = { 'topics': [ '0x0c2a2f565c7774c59e49ef6b3c255329f4d254147e06e724d3a8569bb7bd21ad', None, None, None ], 'data': '0x000000000000000000000000000000000000000000000000000388f27d8d3000000000000000000000000000c68bff79073939c96c8edb1c539b5362be1f64d1' }

Here's a quick example of how to use EVM Decoder:

python from evm_decoder import DecoderManager, AnalyzerManager Initialize managers decoder_manager = DecoderManager() analyzer_manager = AnalyzerManager() Example transaction data transaction_data = { 'input': '0x23b872dd000000000000000000000000...', 'from': '0xb8faa80fe04a4afd30c89f40e4fcdc6dafb274d9', 'to': '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', 'value': '0', 'chain_id': 1, 'logs': [...] } Decode the transaction decode_result = decoder_manager.decode(transaction_data) print("Transaction decode result:", decode_result) Analyze the transaction analysis_result = analyzer_manager.analyze_transaction(transaction_data, {}) print("Transaction analysis result:", analysis_result)

For more detailed examples, check the examples directory in the repository.

Configuration

EVM Decoder uses a configuration file to set up decoders. You can customize this file to add support for specific contracts or event types. The default configuration file is located at evm_decoder/config/decoder_config.json.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Thanks to all contributors who have helped to improve this project.
  • This project makes use of several open-source libraries, including Web3.py and eth-abi.

Contact

If you have any questions or feedback, please open an issue on the GitHub repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

evm_decoder-0.2.2.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

evm_decoder-0.2.2-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file evm_decoder-0.2.2.tar.gz.

File metadata

  • Download URL: evm_decoder-0.2.2.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for evm_decoder-0.2.2.tar.gz
Algorithm Hash digest
SHA256 6c7a761179a8a7b9869661e4e35e8f9503fb8e669347ac0fa8c5d353a3f70bac
MD5 c5a4b64b8f52553df1f46fc51ff72037
BLAKE2b-256 a85174d7d78e50c283cebf07d218a74cafcf8b5ff65fa7c0d737557dfc2c0423

See more details on using hashes here.

File details

Details for the file evm_decoder-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: evm_decoder-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for evm_decoder-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 829b5f19c44c347e8a8910971750857d940a0b0530c7400d2dde4c745745bfac
MD5 983758d98c7dfcccd0c3762ab2524e24
BLAKE2b-256 6538c1320787621dd38ed1a077bedc758c537a255b6d41e48015d23e7a4e382f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page