Skip to content

Commit 0108c41

Browse files
committed
Merge branch 'master' into add-via-ir
2 parents 8baef08 + a5318b4 commit 0108c41

File tree

11 files changed

+51
-37
lines changed

11 files changed

+51
-37
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
with:
7171
node-version: ${{ matrix.node-version || '20' }}
7272
- name: Set up Python ${{ matrix.python }}
73-
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
73+
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
7474
with:
7575
python-version: ${{ matrix.python }}
7676
activate-environment: true
@@ -80,7 +80,7 @@ jobs:
8080
solc-select use 0.5.7 --always-install
8181
- name: Set up nix
8282
if: matrix.type == 'dapp'
83-
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31
83+
uses: cachix/install-nix-action@2126ae7fc54c9df00dd18f7f18754393182c73cd # v31.9.1
8484
- name: Set up cachix
8585
if: matrix.type == 'dapp'
8686
uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16

.github/workflows/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
persist-credentials: false
3434
- name: Setup Pages
3535
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
36-
- uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
36+
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
3737
with:
3838
python-version: "3.10"
3939
activate-environment: true

.github/workflows/linter.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2323
with:
2424
persist-credentials: false
25-
- uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v2
25+
- uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v2
2626
with:
2727
args: "check"
28-
- uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v2
28+
- uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v2
2929
with:
3030
args: "format --check"
3131

@@ -36,7 +36,7 @@ jobs:
3636
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3737
with:
3838
persist-credentials: false
39-
- uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
39+
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
4040
with:
4141
python-version: "3.10"
4242
- run: uv sync --extra lint
@@ -59,7 +59,7 @@ jobs:
5959
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6060
with:
6161
persist-credentials: false
62-
- uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
62+
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
6363
- run: uv tool run yamllint -c .yamllint .github/workflows/
6464

6565
actionlint:

.github/workflows/onchain.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
persist-credentials: false
3131
- name: Set up Python 3.10
32-
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
32+
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
3333
with:
3434
python-version: "3.10"
3535
activate-environment: true

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
persist-credentials: false
1818

1919
- name: Set up Python
20-
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
20+
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
2121
with:
2222
python-version: "3.10"
2323

.github/workflows/pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
persist-credentials: false
2929
- name: Set up Python ${{ matrix.python }}
30-
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
30+
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
3131
with:
3232
python-version: ${{ matrix.python }}
3333

crytic_compile/crytic_compile.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,10 @@ def _init_platform(self, target: str, **kwargs: str) -> AbstractPlatform:
606606
(p(target) for p in platforms if p.NAME.lower() == compile_force_framework.lower()),
607607
None,
608608
)
609+
if not platform:
610+
raise ValueError(
611+
f"The framework specified {compile_force_framework} does not exist"
612+
)
609613

610614
if not platform:
611615
matching_platforms = [p for p in platforms if p.is_supported(target, **kwargs)]

crytic_compile/platform/foundry.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ def __init__(self, target: str, **_kwargs: str):
6161
# if we are initializing this, it is indeed a foundry project and thus has a root path
6262
assert project_root is not None
6363
self._project_root: Path = project_root
64+
self._config: PlatformConfig | None = None
65+
66+
def _get_config(self) -> PlatformConfig | None:
67+
"""Get cached platform config, loading it if needed."""
68+
if self._config is None:
69+
self._config = self.config(self._project_root)
70+
return self._config
6471

6572
def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None:
6673
"""Compile
@@ -106,7 +113,7 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None:
106113

107114
compile_all = kwargs.get("foundry_compile_all", False)
108115

109-
foundry_config = self.config(self._project_root)
116+
foundry_config = self._get_config()
110117

111118
if not targeted_build and not compile_all and foundry_config:
112119
compilation_command += [
@@ -250,7 +257,14 @@ def is_dependency(self, path: str) -> bool:
250257
"""
251258
if path in self._cached_dependencies:
252259
return self._cached_dependencies[path]
253-
ret = "lib" in Path(path).parts or "node_modules" in Path(path).parts
260+
path_parts = Path(path).parts
261+
config = self._get_config()
262+
libs_path = (config.libs_path if config else None) or []
263+
ret = (
264+
"lib" in path_parts
265+
or "node_modules" in path_parts
266+
or any(lib in path_parts for lib in libs_path)
267+
)
254268
self._cached_dependencies[path] = ret
255269
return ret
256270

crytic_compile/platform/solc.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ def _build_contract_data(compilation_unit: "CompilationUnit") -> dict:
4040
for filename, source_unit in compilation_unit.source_units.items():
4141
for contract_name in source_unit.contracts_names:
4242
libraries = source_unit.libraries_names_and_patterns(contract_name)
43-
abi = str(source_unit.abi(contract_name))
44-
abi = abi.replace("'", '"')
45-
abi = abi.replace("True", "true")
46-
abi = abi.replace("False", "false")
43+
abi = json.dumps(source_unit.abi(contract_name))
4744
exported_name = combine_filename_name(filename.absolute, contract_name)
4845
contracts[exported_name] = {
4946
"srcmap": ";".join(source_unit.srcmap_init(contract_name)),

scripts/ci_test_brownie.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -euo pipefail
33

44
# https://github.com/eth-brownie/brownie/pull/1873#issuecomment-2927669459
5-
pip install -U setuptools
5+
pip install -U 'setuptools<81'
66

77
pip install eth-brownie
88
brownie bake token

0 commit comments

Comments
 (0)