From b35eba1db791a3aa739b1fdc64e2ddfe1038ee57 Mon Sep 17 00:00:00 2001 From: Ben Hauser Date: Mon, 28 Dec 2020 20:51:41 +0100 Subject: [PATCH] fix: handle malformed calldata in subcalls --- brownie/network/transaction.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/brownie/network/transaction.py b/brownie/network/transaction.py index 93c2a4784..7247ceb14 100644 --- a/brownie/network/transaction.py +++ b/brownie/network/transaction.py @@ -776,11 +776,13 @@ def _expand_trace(self) -> None: self._subcalls[-1]["value"] = int(step["stack"][-3], 16) if calldata and last_map[trace[i]["depth"]].get("function"): fn = last_map[trace[i]["depth"]]["function"] - zip_ = zip(fn.abi["inputs"], fn.decode_input(calldata)) - self._subcalls[-1].update( - inputs={i[0]["name"]: i[1] for i in zip_}, # type:ignore - function=fn._input_sig, - ) + self._subcalls[-1]["function"] = fn._input_sig + try: + zip_ = zip(fn.abi["inputs"], fn.decode_input(calldata)) + inputs = {i[0]["name"]: i[1] for i in zip_} # type: ignore + self._subcalls[-1]["inputs"] = inputs + except Exception: + self._subcalls[-1]["calldata"] = calldata.hex() elif calldata: self._subcalls[-1]["calldata"] = calldata.hex()