diff --git a/src/ape/api/compiler.py b/src/ape/api/compiler.py index 71d6a6fa0f..383f37f463 100644 --- a/src/ape/api/compiler.py +++ b/src/ape/api/compiler.py @@ -194,7 +194,8 @@ def _create_contract_from_call( return None, calldata # NOTE: Handling when providers give us odd address values. - raw_addr = HexBytes(data["address"]).hex().replace("0x", "") + # NOTE: `or ""` because sometimes the address key exists and is None. + raw_addr = HexBytes(data.get("address") or "").hex().replace("0x", "") zeroes = max(40 - len(raw_addr), 0) * "0" addr = f"0x{zeroes}{raw_addr}"