certora-cli 7.17.2__tar.gz → 7.20.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {certora_cli-7.17.2/certora_cli.egg-info → certora_cli-7.20.3}/PKG-INFO +3 -2
- certora_cli-7.20.3/README.md +1 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/Compiler/CompilerCollectorFactory.py +36 -52
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/Compiler/CompilerCollectorVy.py +3 -3
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraBuild.py +167 -338
- certora_cli-7.20.3/certora_cli/EVMVerifier/certoraBuildDataClasses.py +321 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraCloudIO.py +89 -62
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraContext.py +68 -1
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraContextAttributes.py +46 -20
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraContextValidator.py +37 -11
- certora_cli-7.20.3/certora_cli/EVMVerifier/certoraSourceFinders.py +405 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/Mutate/mutateApp.py +2 -2
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/Shared/certoraAttrUtil.py +1 -1
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/Shared/certoraUtils.py +41 -9
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/Shared/certoraValidateFuncs.py +16 -10
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/certoraRun.py +3 -1
- {certora_cli-7.17.2 → certora_cli-7.20.3/certora_cli.egg-info}/PKG-INFO +3 -2
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli.egg-info/SOURCES.txt +2 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli.egg-info/requires.txt +1 -0
- certora_cli-7.20.3/certora_jars/CERTORA-CLI-VERSION-METADATA.json +1 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_jars/Typechecker.jar +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/setup.py +3 -3
- certora_cli-7.17.2/README.md +0 -1
- certora_cli-7.17.2/certora_jars/CERTORA-CLI-VERSION-METADATA.json +0 -1
- {certora_cli-7.17.2 → certora_cli-7.20.3}/LICENSE +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/MANIFEST.in +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_bins/__init__.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/Compiler/CompilerCollector.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/Compiler/CompilerCollectorSol.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/Compiler/CompilerCollectorSolBased.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/Compiler/CompilerCollectorYul.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/Compiler/__init__.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/__init__.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraBuildCacheManager.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraCollectRunMetadata.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraCompilerParameters.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraConfigIO.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraContextClass.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraContractFuncs.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraExtensionInfo.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraJobList.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraMiniSpecParser.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraNodeFilters.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraType.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/certoraVerifyGenerator.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EquivalenceCheck/Eq_default.conf +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EquivalenceCheck/Eq_mc_no_out_template.spec +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EquivalenceCheck/Eq_mc_template.spec +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EquivalenceCheck/Eq_sanity.conf +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EquivalenceCheck/Eq_template.spec +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EquivalenceCheck/__init__.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EquivalenceCheck/equivCheck.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EquivalenceCheck/sanity.spec +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/Mutate/__init__.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/Mutate/mutateAttributes.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/Mutate/mutateConstants.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/Mutate/mutateUtil.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/Mutate/mutateValidate.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/Shared/ExpectedComparator.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/Shared/__init__.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/Shared/certoraLogging.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/__init__.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/certoraEqCheck.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/certoraMutate.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli.egg-info/dependency_links.txt +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli.egg-info/entry_points.txt +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli.egg-info/top_level.txt +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/certora_jars/__init__.py +0 -0
- {certora_cli-7.17.2 → certora_cli-7.20.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: certora-cli
|
|
3
|
-
Version: 7.
|
|
3
|
+
Version: 7.20.3
|
|
4
4
|
Summary: Runner for the Certora Prover
|
|
5
5
|
Home-page: https://pypi.org/project/certora-cli
|
|
6
6
|
Author: Certora
|
|
@@ -20,5 +20,6 @@ Requires-Dist: sly
|
|
|
20
20
|
Requires-Dist: tabulate
|
|
21
21
|
Requires-Dist: tqdm
|
|
22
22
|
Requires-Dist: StrEnum
|
|
23
|
+
Requires-Dist: tomli
|
|
23
24
|
|
|
24
|
-
Commit
|
|
25
|
+
Commit 7b9a1c7. Build and Run scripts for executing the Certora Prover on Solidity smart contracts.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Commit 7b9a1c7. Build and Run scripts for executing the Certora Prover on Solidity smart contracts.
|
|
@@ -1,42 +1,47 @@
|
|
|
1
1
|
import os
|
|
2
|
-
import shutil
|
|
3
2
|
|
|
4
|
-
from Shared
|
|
3
|
+
from Shared import certoraUtils as Util
|
|
5
4
|
from pathlib import Path
|
|
6
5
|
from functools import lru_cache
|
|
7
|
-
from typing import
|
|
6
|
+
from typing import Set, Callable
|
|
8
7
|
import re
|
|
9
8
|
import logging
|
|
10
9
|
from EVMVerifier.Compiler.CompilerCollector import CompilerLang, CompilerCollector
|
|
11
10
|
from EVMVerifier.Compiler.CompilerCollectorSol import CompilerCollectorSol, CompilerLangSol
|
|
12
11
|
from EVMVerifier.Compiler.CompilerCollectorYul import CompilerLangYul, CompilerCollectorYul
|
|
13
12
|
from EVMVerifier.Compiler.CompilerCollectorVy import CompilerCollectorVy, CompilerLangVy
|
|
14
|
-
from Shared.certoraUtils import
|
|
13
|
+
from Shared.certoraUtils import match_path_to_mapping_key, remove_file, get_certora_config_dir
|
|
15
14
|
from EVMVerifier.certoraContextClass import CertoraContext
|
|
16
15
|
|
|
17
16
|
# logger for running the Solidity compiler and reporting any errors it emits
|
|
18
17
|
compiler_logger = logging.getLogger("compiler")
|
|
19
18
|
|
|
20
19
|
|
|
21
|
-
def get_relevant_compiler(contract_file_path: Path,
|
|
20
|
+
def get_relevant_compiler(contract_file_path: Path, context: CertoraContext) -> str:
|
|
22
21
|
"""
|
|
23
22
|
@param contract_file_path: the contract that we are working on
|
|
24
|
-
@param
|
|
25
|
-
@
|
|
26
|
-
@return: the name of the compiler executable we want to run on this contract (as a string, could be a path
|
|
23
|
+
@param context: context object
|
|
24
|
+
@return: the name of the compiler executable we want to run on this file (as a string, could be a path
|
|
27
25
|
or a resolvable executable name)
|
|
28
26
|
"""
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
match
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
if context.solc_map:
|
|
28
|
+
match = match_path_to_mapping_key(contract_file_path, context.solc_map)
|
|
29
|
+
if match:
|
|
30
|
+
return match
|
|
31
|
+
else:
|
|
32
|
+
raise RuntimeError(f'cannot match compiler to {contract_file_path} from solc_map')
|
|
33
|
+
|
|
34
|
+
if Util.is_vyper_file(str(contract_file_path)):
|
|
35
|
+
if context.vyper:
|
|
36
|
+
return context.vyper
|
|
37
|
+
else:
|
|
38
|
+
return Util.DEFAULT_VYPER_COMPILER
|
|
39
|
+
elif Util.is_solidity_file(str(contract_file_path)):
|
|
40
|
+
if context.solc:
|
|
41
|
+
return context.solc
|
|
42
|
+
else:
|
|
43
|
+
return Util.DEFAULT_SOLC_COMPILER
|
|
44
|
+
raise RuntimeError(f'cannot match compiler to {contract_file_path}')
|
|
40
45
|
|
|
41
46
|
|
|
42
47
|
class CompilerCollectorFactory:
|
|
@@ -50,12 +55,8 @@ class CompilerCollectorFactory:
|
|
|
50
55
|
We added context as first step of making it the only parameters (the other params already appear in Context)
|
|
51
56
|
"""
|
|
52
57
|
|
|
53
|
-
def __init__(self, context: CertoraContext
|
|
54
|
-
compiler_mappings: Dict[str, str]):
|
|
58
|
+
def __init__(self, context: CertoraContext):
|
|
55
59
|
self.context = context
|
|
56
|
-
self._default_compiler = default_compiler
|
|
57
|
-
self._compiler_mappings = compiler_mappings
|
|
58
|
-
|
|
59
60
|
self._stdout_paths_to_clean: Set[Path] = set()
|
|
60
61
|
self._stderr_paths_to_clean: Set[Path] = set()
|
|
61
62
|
|
|
@@ -80,46 +81,29 @@ class CompilerCollectorFactory:
|
|
|
80
81
|
else:
|
|
81
82
|
raise RuntimeError(f'expected {path} to represent a Solidity, Yul, or Vyper file')
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
def get_vyper_compiler(contract_file_path: Path, default_compiler: str, compiler_mappings: Dict[str, str]) -> str:
|
|
85
|
-
"""
|
|
86
|
-
@param contract_file_path: the contract that we wish to compile
|
|
87
|
-
@param default_compiler: the default compiler for the contract
|
|
88
|
-
@param compiler_mappings: mappings from context mapping files to the relevant compiler executable
|
|
89
|
-
@return: the name of the compiler executable to run
|
|
90
|
-
"""
|
|
91
|
-
vyper_location = shutil.which(VYPER, os.F_OK)
|
|
92
|
-
if vyper_location is not None:
|
|
93
|
-
# has vyper. use it
|
|
94
|
-
compiler = VYPER
|
|
95
|
-
else:
|
|
96
|
-
compiler = default_compiler
|
|
97
|
-
|
|
98
|
-
vyper_exec = get_relevant_compiler(contract_file_path, compiler, compiler_mappings)
|
|
99
|
-
return vyper_exec
|
|
100
|
-
|
|
101
|
-
def __get_vyper_version(self, contract_file_path: Path) -> CompilerVersion:
|
|
84
|
+
def __get_vyper_version(self, contract_file_path: Path) -> Util.CompilerVersion:
|
|
102
85
|
"""
|
|
103
86
|
@param contract_file_path: the contract that we are working on
|
|
104
87
|
@return: the running Vyper version
|
|
105
88
|
"""
|
|
106
|
-
vyper_exec_to_run =
|
|
89
|
+
vyper_exec_to_run = get_relevant_compiler(contract_file_path, self.context)
|
|
107
90
|
version = self.__get_compiler_exe_version(vyper_exec_to_run, self.__version_string_handler_vyper)
|
|
108
91
|
return version
|
|
109
92
|
|
|
110
|
-
def __get_solc_version(self, contract_file_path: Path) -> CompilerVersion:
|
|
93
|
+
def __get_solc_version(self, contract_file_path: Path) -> Util.CompilerVersion:
|
|
111
94
|
"""
|
|
112
95
|
@param contract_file_path: the contract that we are working on
|
|
113
96
|
@return: the running solc version
|
|
114
97
|
"""
|
|
115
98
|
compiler_logger.debug(f"visiting contract file {contract_file_path}")
|
|
116
|
-
solc_path = get_relevant_compiler(contract_file_path, self.
|
|
99
|
+
solc_path = get_relevant_compiler(contract_file_path, self.context)
|
|
117
100
|
version = self.__get_compiler_exe_version(solc_path, self.__version_string_handler_solc)
|
|
118
101
|
return version
|
|
119
102
|
|
|
120
103
|
@lru_cache(maxsize=32)
|
|
121
104
|
def __get_compiler_exe_version(self, compiler_name: str,
|
|
122
|
-
version_string_handler:
|
|
105
|
+
version_string_handler:
|
|
106
|
+
Callable[[str], Util.CompilerVersion]) -> Util.CompilerVersion:
|
|
123
107
|
"""
|
|
124
108
|
@param compiler_name: name of the solc we want to run on this contract
|
|
125
109
|
@return: the running compiler version
|
|
@@ -130,7 +114,7 @@ class CompilerCollectorFactory:
|
|
|
130
114
|
self._stdout_paths_to_clean.add(stdout_path)
|
|
131
115
|
self._stderr_paths_to_clean.add(stderr_path)
|
|
132
116
|
|
|
133
|
-
run_compiler_cmd(
|
|
117
|
+
Util.run_compiler_cmd(
|
|
134
118
|
f"{compiler_name} --version",
|
|
135
119
|
wd=Path(os.getcwd()),
|
|
136
120
|
output_file_name=out_name)
|
|
@@ -140,8 +124,8 @@ class CompilerCollectorFactory:
|
|
|
140
124
|
return version_string_handler(version_string)
|
|
141
125
|
|
|
142
126
|
@staticmethod
|
|
143
|
-
def __version_string_handler_vyper(version_string: str) -> CompilerVersion:
|
|
144
|
-
version_matches = re.findall(version_triplet_regex(), version_string, re.MULTILINE)
|
|
127
|
+
def __version_string_handler_vyper(version_string: str) -> Util.CompilerVersion:
|
|
128
|
+
version_matches = re.findall(Util.version_triplet_regex(), version_string, re.MULTILINE)
|
|
145
129
|
if len(version_matches) != 1:
|
|
146
130
|
msg = f"Couldn't extract Vyper version from output {version_string}, giving up"
|
|
147
131
|
compiler_logger.debug(msg)
|
|
@@ -150,8 +134,8 @@ class CompilerCollectorFactory:
|
|
|
150
134
|
return int(match[0]), int(match[1]), int(match[2])
|
|
151
135
|
|
|
152
136
|
@staticmethod
|
|
153
|
-
def __version_string_handler_solc(version_string: str) -> CompilerVersion:
|
|
154
|
-
version_matches = re.findall(version_triplet_regex(prefix="Version: "), version_string, re.MULTILINE)
|
|
137
|
+
def __version_string_handler_solc(version_string: str) -> Util.CompilerVersion:
|
|
138
|
+
version_matches = re.findall(Util.version_triplet_regex(prefix="Version: "), version_string, re.MULTILINE)
|
|
155
139
|
if len(version_matches) != 1:
|
|
156
140
|
msg = f"Couldn't extract Solidity version from output {version_string}, giving up"
|
|
157
141
|
compiler_logger.debug(msg)
|
{certora_cli-7.17.2 → certora_cli-7.20.3}/certora_cli/EVMVerifier/Compiler/CompilerCollectorVy.py
RENAMED
|
@@ -11,7 +11,7 @@ from typing import Any, Dict, List, Set, Tuple, Optional
|
|
|
11
11
|
import EVMVerifier.certoraType as CT
|
|
12
12
|
from Crypto.Hash import keccak
|
|
13
13
|
from EVMVerifier.Compiler.CompilerCollector import CompilerCollector, CompilerLang, CompilerLangFunc
|
|
14
|
-
from Shared.certoraUtils import Singleton,
|
|
14
|
+
from Shared.certoraUtils import Singleton, DEFAULT_VYPER_COMPILER, CompilerVersion
|
|
15
15
|
from Shared.certoraUtils import print_failed_to_run, get_certora_config_dir
|
|
16
16
|
|
|
17
17
|
ast_logger = logging.getLogger("ast")
|
|
@@ -24,11 +24,11 @@ class CompilerLangVy(CompilerLang, metaclass=Singleton):
|
|
|
24
24
|
|
|
25
25
|
@property
|
|
26
26
|
def name(self) -> str:
|
|
27
|
-
return
|
|
27
|
+
return DEFAULT_VYPER_COMPILER.capitalize() # yes, Vyper wants to be spelled "Vyper" in the json input
|
|
28
28
|
|
|
29
29
|
@property
|
|
30
30
|
def compiler_name(self) -> str:
|
|
31
|
-
return
|
|
31
|
+
return DEFAULT_VYPER_COMPILER
|
|
32
32
|
|
|
33
33
|
@staticmethod
|
|
34
34
|
def normalize_func_hash(func_hash: str) -> str:
|