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

Disk Solidity Compilation With Remappings

Compile Solidity entry files from disk while resolving imported libraries through explicit remapping rules, returning ABI and bytecode details and writing compiler outputs to disk.

Capabilities

Compiles contracts with remapped imports

  • Given an entry Solidity file that imports @lib/Math.sol remapped to a local vendor folder, compilation succeeds and returns ABI and bytecode entries for the entry contract and the remapped library. @test

Writes artifacts to disk

  • When an output directory is provided, a combined JSON output containing ABI and deployed bytecode for each compiled contract is written to that directory, creating it if missing and optionally overwriting existing files when requested. @test

Fails on unresolved imports

  • If an import such as @lib/Util.sol cannot be resolved by the supplied remappings and allow paths, the compile step raises a clear error that mentions the unresolved import path. @test

Implementation

@generates

API

from pathlib import Path
from typing import Any, Dict, Iterable, List

def compile_with_remappings(
    sources: List[Path],
    import_remappings: Dict[str, str],
    allow_paths: Iterable[Path],
    output_dir: Path,
    overwrite: bool = False,
) -> Dict[str, Any]:
    """
    Compiles Solidity source files on disk using the provided import remappings and allow paths.
    Writes compiler output (including ABI and bytecode) into output_dir, optionally overwriting existing files.
    Returns contract metadata keyed by fully qualified contract identifiers.
    Raises a compilation error when imports cannot be resolved.
    """

Dependencies { .dependencies }

py-solc-x { .dependency }

Python wrapper for the Solidity compiler that supports on-disk compilation with import remappings.

Install with Tessl CLI

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

tile.json