def METHOD_NAME(contract_address: str, directory: bytes) -> dict:
    with open(os.path.join(directory, "metadata.json"), 'r') as metadata_file:
        metadata = json.load(metadata_file)
    sources = dict()
    for source_name in os.listdir(directory):
        if source_name == "metadata.json": continue
        with open(os.path.join(directory, source_name), 'r') as source_file:
            source = source_file.read()
            sources[source_name] = source
    data = dict()
    data["contract_address"] = contract_address
    data["contract_name"] = metadata["ContractName"]
    data["compiler_version"] = metadata["CompilerVersion"]
    data["optimizations"] = metadata["OptimizationUsed"]
    data["optimization_runs"] = metadata["Runs"]
    data["sources"] = sources
    return data