❯ ~/.local/bin/brownie compile
Brownie v1.16.3 - Python development framework for Ethereum
File "brownie/_cli/__main__.py", line 64, in main
importlib.import_module(f"brownie._cli.{cmd}").main()
File "brownie/_cli/compile.py", line 50, in main
proj = project.load()
File "brownie/project/main.py", line 746, in load
return Project(name, project_path)
File "brownie/project/main.py", line 180, in __init__
self.load()
File "brownie/project/main.py", line 214, in load
self._build._add_contract(build_json)
File "brownie/project/build.py", line 61, in _add_contract
self._generate_revert_map(
File "brownie/project/build.py", line 79, in _generate_revert_map
path_str = source_map[data["path"]]
KeyError: None
How can it be fixed?
Looks like the Royalties contract has this opcode setup weird
def _generate_revert_map(self, pcMap: Dict, source_map: Dict, language: str) -> None:
# Adds a contract's dev revert strings to the revert map and it's pcMap
marker = "//" if language == "Solidity" else "#"
for pc, data in (
(k, v)
for k, v in pcMap.items()
if v["op"] in ("REVERT", "INVALID") or "jump_revert" in v
):
if "path" not in data:
continue
path_str = source_map[data["path"]]
Basically: path IS in data, but its value is None, which isn't a key in source_map.
I am working around the issue with this:
# if "path" not in data:
# continue
if not data.get("path"):
continue
path_str = source_map[data["path"]]
Environment information
brownie
Version: v1.16.3ganache-cli
Version: N/Asolc
Version: x.x.xpy-solc-x
.pragma solidity 0.4.24
What was wrong?
How can it be fixed?
Looks like the Royalties contract has this opcode setup weird
the
"path": null
is why we get a keyNone
.This is where the error happens:
Basically:
path
IS in data, but its value isNone
, which isn't a key insource_map
.I am working around the issue with this:
Attached the contract in question. RecordLabel.txt