(
bytecode_path: Path, reports: FileReport, contract: Optional[str] = None
)
| 66 | |
| 67 | |
| 68 | def 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 | |
| 80 | def add_preamble(source_path: Path, preamble: str = DEFAULT_PREAMBLE): |
no outgoing calls