CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-py-solc-x

Python wrapper and version management tool for the solc Solidity compiler.

77

1.05x

Evaluation77%

1.05x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-5/

Standard JSON Solidity Compiler Helper

Utility for compiling Solidity sources through the official standard JSON input/output interface while optionally persisting the compiler output.

Capabilities

Compiles basic input

  • Given a standard JSON input for a simple Counter contract targeting 0.8.x with outputSelection requesting ABI and bytecode, the returned output contains a non-empty ABI and deployed bytecode for Counter. @test

Supports imports with allow paths

  • When the standard JSON input includes an import of a sibling library and allow_paths includes that library location, compilation succeeds and the output contains entries for both the main contract and the imported library. @test

Writes compiler output when requested

  • When output_dir is provided, the full standard JSON compiler output is written to output_dir/standard-output.json; overwriting an existing file only occurs when overwrite is true, and the function still returns the parsed output. @test

Surfaces compiler errors

  • For invalid standard JSON input (such as a syntax error in a source file), an exception is raised containing the compiler's error message text. @test

Implementation

@generates

API

def compile_with_standard_json(
    standard_input: dict,
    *,
    allow_paths: list[str] | None = None,
    output_dir: str | None = None,
    overwrite: bool = False
) -> dict:
    """
    Compiles Solidity contracts using the standard JSON input/output format.
    Applies allow_paths for imports, optionally writes the compiler output to output_dir,
    and returns the parsed compiler output dictionary.
    Raises an exception containing compiler error messages when compilation fails.
    """

Dependencies { .dependencies }

py-solc-x { .dependency }

Provides managed solc installation/selection and helpers for compiling via the standard JSON interface.

Install with Tessl CLI

npx tessl i tessl/pypi-py-solc-x

tile.json