Skip to content

Commit

Permalink
fix: use standard-json-input for source code verification
Browse files Browse the repository at this point in the history
  • Loading branch information
skellet0r committed Oct 11, 2021
1 parent 26096f3 commit 8b99c49
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions brownie/network/contract.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/python3

import io
import json
import os
import re
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"],
Expand Down

0 comments on commit 8b99c49

Please sign in to comment.