def validate_deployments_tx_receipt(
    deployments: Dict[str, Any], w3: Web3, allow_missing_data: bool = False
) -> None:
    """
    Validate that address and block hash found in deployment data match what is found on-chain.
    :allow_missing_data: by default, enforces validation of address and blockHash.
    """
    # todo: provide hook to lazily look up tx receipt via binary search if missing data
    for name, data in deployments.items():
        if "transaction" in data:
            tx_hash = data["transaction"]
            tx_receipt = w3.eth.getTransactionReceipt(tx_hash)
            # tx_address will be None if contract created via contract factory
            tx_address = tx_receipt["contractAddress"]

            if tx_address is None and allow_missing_data is False:
                raise ValidationError(
                    "No contract address found in tx receipt. Unable to verify "
                    "address found in tx receipt matches address in manifest's deployment data. "
                    "If this validation is not necessary, please enable `allow_missing_data` arg. "
                )

            if tx_address is not None and not is_same_address(
                tx_address, data["address"]
            ):
                raise ValidationError(
                    f"Error validating tx_receipt for {name} deployment. "
                    f"Address found in manifest's deployment data: {data['address']} "
                    f"Does not match address found on tx_receipt: {tx_address}."
                )

            if "block" in data:
                if tx_receipt["blockHash"] != to_bytes(hexstr=data["block"]):
                    raise ValidationError(
                        f"Error validating tx_receipt for {name} deployment. "
                        f"Block found in manifest's deployment data: {data['block']} does not "
                        f"Does not match block found on tx_receipt: {tx_receipt['blockHash']}."
                    )
            elif allow_missing_data is False:
                raise ValidationError(
                    "No block hash found in deployment data. "
                    "Unable to verify block hash on tx receipt. "
                    "If this validation is not necessary, please enable `allow_missing_data` arg."
                )
        elif allow_missing_data is False:
            raise ValidationError(
                "No transaction hash found in deployment data. "
                "Unable to validate tx_receipt. "
                "If this validation is not necessary, please enable `allow_missing_data` arg."
            )