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-3/

Solidity Compiler Version Selector

A utility module for reporting and switching the default Solidity compiler version managed by a package-provided solc installation manager.

Capabilities

Report active compiler

  • When the default compiler is set to 0.8.20, querying the active compiler returns "0.8.20". @test

Switch to explicit version

  • Given installed compilers including 0.8.17 and 0.8.23, setting the default to 0.8.17 returns "0.8.17" and subsequent queries report that version. @test
  • Attempting to set an unavailable version raises a clear error message. @test

Select from pragma

  • With installed compilers 0.7.6, 0.8.11, and 0.8.21 available, selecting for pragma "^0.8.0" chooses 0.8.21 as the new default and reports it. @test
  • If no installed compiler satisfies a pragma such as ">=0.9.0", the selector raises an error explaining the missing support. @test

Implementation

@generates

API

def get_active_compiler() -> str:
    """Return the default Solidity compiler version string currently in use."""


def set_compiler_version(version: str) -> str:
    """
    Set the default Solidity compiler to the given installed version string.
    Returns the version string selected.
    Raises an error if the requested version is not available.
    """


def select_version_for_pragma(pragma: str) -> str:
    """
    Choose the highest installed compiler version that satisfies a Solidity pragma expression
    (e.g., "^0.8.0"), set it as the default, and return the version string.
    Raises an error when no installed version satisfies the pragma.
    """

Dependencies { .dependencies }

py-solc-x { .dependency }

Provides access to managed Solidity compiler installations and version selection utilities.

Install with Tessl CLI

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

tile.json