diff --git a/brownie/network/contract.py b/brownie/network/contract.py index cb348d6aa..cedc684b0 100644 --- a/brownie/network/contract.py +++ b/brownie/network/contract.py @@ -1,5 +1,6 @@ #!/usr/bin/python3 +import io import json import os import re @@ -159,10 +160,7 @@ def __init__(self, project: Any, build: Dict) -> None: compiler._get_solc_remappings(config["solc"]["remappings"]), ) ) - compiler_settings = { - "evmVersion": config["evm_version"], - "optimizer": config["solc"]["optimizer"], - } + compiler_settings = {"optimizer": config["solc"]["optimizer"]} self._flattener = Flattener(source_fp, self._name, remaps, compiler_settings) def __iter__(self) -> Iterator: @@ -401,9 +399,9 @@ def publish_source(self, contract: Any, silent: bool = False) -> bool: "module": "contract", "action": "verifysourcecode", "contractaddress": address, - "sourceCode": contract_info["flattened_source"], - "codeformat": "solidity-single-file", - "contractname": contract_info["contract_name"], + "sourceCode": io.StringIO(json.dumps(self._flattener.standard_input_json)), + "codeformat": "solidity-standard-json-input", + "contractname": f"{self._flattener.contract_file}:{self._flattener.contract_name}", "compilerversion": f"v{contract_info['compiler_version']}", "optimizationUsed": 1 if contract_info["optimizer_enabled"] else 0, "runs": contract_info["optimizer_runs"],