MCPcopy Create free account
hub / github.com/argotorg/solidity / save_bytecode

Function save_bytecode

scripts/common/cmdline_helpers.py:68–77  ·  view source on GitHub ↗
(
    bytecode_path: Path, reports: FileReport, contract: Optional[str] = None
)

Source from the content-addressed store, hash-verified

66
67
68def save_bytecode(
69 bytecode_path: Path, reports: FileReport, contract: Optional[str] = None
70):
71 with open(bytecode_path, "w", encoding="utf8") as f:
72 for report in reports.contract_reports:
73 if contract is None or report.contract_name == contract:
74 bytecode = (
75 report.bytecode if report.bytecode is not None else "<NO BYTECODE>"
76 )
77 f.write(f"{report.contract_name}: {bytecode}\n")
78
79
80def add_preamble(source_path: Path, preamble: str = DEFAULT_PREAMBLE):

Callers 2

Calls

no outgoing calls

Tested by 2