Python wrapper and version management tool for the solc Solidity compiler.
77
Evaluation — 77%
↑ 1.05xAgent success when using this tile
Build a helper that compiles in-memory Solidity source strings into combined JSON outputs and optionally persists them.
Counter, calling the compiler returns a mapping keyed by Counter with abi (list) and bin (hex string) entries; bytecode must not be empty. @testAlpha and Beta, the combined JSON data includes separate entries for both names, each with its requested outputs populated. @testabi, bin, and metadata, the returned data includes only those keys for each contract and omits unrequested combined-json fields. @testcombined.json inside that directory while still returning the parsed data; writing to an existing directory overwrites the file. @test@generates
from pathlib import Path
from typing import Any, Dict, Iterable, Optional
def compile_combined_json(
source: str,
outputs: Iterable[str],
output_dir: Optional[Path] = None,
) -> Dict[str, Dict[str, Any]]:
"""
Compile the provided Solidity source string using the active compiler and return
combined-json outputs keyed by contract name.
outputs: list of combined-json fields to include (e.g., "abi", "bin", "metadata").
output_dir: optional directory where the combined-json artifact will be written.
Raises a descriptive exception when compilation fails.
"""Solidity compiler wrapper providing combined-json outputs for in-memory sources. @satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-py-solc-xevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10