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)
    with open(os.path.join(directory, "main.sol"), 'r') as source_file:
        source = source_file.read()
    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["source"] = source
    return data