diff --git a/pyproject.toml b/pyproject.toml index ac50c5d1..47153503 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ skip_gitignore = true [tool.poetry] name = "horus-compile" -version = "0.0.6.3" +version = "0.0.6.4" authors = ["Nethermind "] description = "Use formally verified annotations in your Cairo code" classifiers = [ diff --git a/src/horus/__init__.py b/src/horus/__init__.py index c0e38b11..49ae9c52 100644 --- a/src/horus/__init__.py +++ b/src/horus/__init__.py @@ -1 +1 @@ -__version__ = "0.0.6.3" +__version__ = "0.0.6.4" diff --git a/src/horus/compiler/contract_definition.py b/src/horus/compiler/contract_definition.py index 5f086e5f..6648e51a 100644 --- a/src/horus/compiler/contract_definition.py +++ b/src/horus/compiler/contract_definition.py @@ -1,7 +1,7 @@ from __future__ import annotations from dataclasses import field -from typing import Dict, List +from typing import Dict, List, Optional import marshmallow.fields as mfields import marshmallow_dataclass @@ -12,6 +12,7 @@ from starkware.cairo.lang.compiler.scoped_name import ScopedName, ScopedNameAsStr from starkware.starknet.services.api.contract_class import ContractClass +import horus from horus.compiler.var_names import * from horus.utils import z3And @@ -100,6 +101,9 @@ class FunctionAnnotations: @marshmallow_dataclass.dataclass(frozen=True) class HorusDefinition(ContractClass): + horus_version: Optional[str] = field( + metadata=dict(marshmallow_field=mfields.String()), default=horus.__version__ + ) specifications: Dict[ScopedName, FunctionAnnotations] = field( metadata=dict( marshmallow_field=mfields.Dict( diff --git a/src/horus/compiler/horus_compile.py b/src/horus/compiler/horus_compile.py index 9b097d7d..7edead82 100644 --- a/src/horus/compiler/horus_compile.py +++ b/src/horus/compiler/horus_compile.py @@ -62,6 +62,7 @@ def assemble_horus_contract( return HorusDefinition( **contract_definition.__dict__, + horus_version=horus.__version__, specifications=preprocessed_program.specifications, invariants=preprocessed_program.invariants, storage_vars=preprocessed_program.storage_vars,