Skip to main content

Add your description here

Project description

Solc Event Extractor

Solc Event Extractor is a Python library for extracting metadata (events and functions) from Solidity contracts. It allows you to parse Solidity source files or URLs pointing to Solidity code and retrieve detailed information about contract events and functions.

Features

  • Extracts events and functions from Solidity contracts.
  • Supports both local files and URLs.
  • Handles different Solidity compiler versions.
  • Provides detailed metadata including inputs, outputs, and state mutability.

Installation

You can install the library via pip:

bash uv pip install solc-event-extractor

Usage

In order to use the library, provide a raw github contract path or filepath to a .sol file. Make sure that the correct solidity version is also selected.

from solc_event_extractor import extract_contract_details

contract_source = 'path/to/your/contract.sol'
details = extract_contract_details(contract_source, version='0.8.26')

if details:
    print("Events:")
    for event in details['events']:
        print(f" - {event.name}: {event.signature}")

    print("\nFunctions:")
    for function in details['functions']:
        print(f" - {function.name}: {function.signature}")
else:
    print("Failed to extract contract details.")

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

solc_event_extractor-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

solc_event_extractor-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file solc_event_extractor-0.1.0.tar.gz.

File metadata

  • Download URL: solc_event_extractor-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for solc_event_extractor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 10a3c138ec42bb0326e764cb8325c639caed805b143922b528cfaee76c0ab5ce
MD5 efbbb16edcfc45c92b264893cd171b91
BLAKE2b-256 0d7e004259c46b7c5ec8e87ee573bdde1a4cd411b9982f59bec65e77f825bcd0

See more details on using hashes here.

File details

Details for the file solc_event_extractor-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for solc_event_extractor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f23e0233c89966391703d8393c346e80c64c4d2eb6973c306350f10adf3c33a7
MD5 c25ea8af059949778dcf53544c10eb82
BLAKE2b-256 0192d5bda6e67b793f88a0a2e7def58b7d39e6b9dc51d65091ac9965c8dcaec9

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