Skip to content

Commit ceaca9e

Browse files
authored
Merge pull request #595 from crytic/dev
Sync Master <> Dev
2 parents 7ce1189 + aeeae0c commit ceaca9e

File tree

7 files changed

+60
-6
lines changed

7 files changed

+60
-6
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ jobs:
6363
solc-select use 0.5.7 --always-install
6464
- name: Set up nix
6565
if: matrix.type == 'dapp'
66-
uses: cachix/install-nix-action@v30
66+
uses: cachix/install-nix-action@v31
6767
- name: Set up cachix
6868
if: matrix.type == 'dapp'
69-
uses: cachix/cachix-action@v15
69+
uses: cachix/cachix-action@v16
7070
with:
7171
name: dapp
7272
- name: Install Foundry

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
path: dist/
4646

4747
- name: publish
48-
uses: pypa/[email protected].3
48+
uses: pypa/[email protected].4
4949

5050
- name: sign
5151
uses: sigstore/[email protected]

CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @montyly @0xalpharush @bohendo
1+
* @elopez @bohendo @smonicas

crytic_compile/platform/etherscan.py

+15
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@
9797
"sepoliaera.zksync": ("300", "sepolia-era.zksync.network"),
9898
"xai": ("660279", "xaiscan.io"),
9999
"sepolia.xai": ("37714555429", "sepolia.xaiscan.io"),
100+
"xdc": ("50", "xdcscan.com"),
101+
"testnet.xdc": ("51", "testnet.xdcscan.com"),
102+
"apechain": ("33139", "apescan.io"),
103+
"curtis.apechain": ("33111", "curtis.apescan.io"),
104+
"world": ("480", "worldscan.org"),
105+
"sepolia.world": ("4801", "sepolia.worldscan.org"),
106+
"sophon": ("50104", "sophscan.xyz"),
107+
"testnet.sophon": ("531050104", "testnet.sophscan.xyz"),
108+
"sonic": ("146", "sonicscan.org"),
109+
"testnet.sonic": ("57054", "testnet.sonicscan.org"),
110+
"unichain": ("130", "uniscan.xyz"),
111+
"sepolia.unichain": ("1301", "sepolia.uniscan.xyz"),
112+
"abstract": ("2741", "abscan.org"),
113+
"sepolia.abstract": ("11124", "sepolia.abscan.org"),
114+
"berachain": ("80094", "berascan.com"),
100115
}
101116

102117
SUPPORTED_NETWORK = {**SUPPORTED_NETWORK_V1, **SUPPORTED_NETWORK_V2}

crytic_compile/platform/foundry.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def is_dependency(self, path: str) -> bool:
165165
"""
166166
if path in self._cached_dependencies:
167167
return self._cached_dependencies[path]
168-
ret = "lib" in Path(path).parts
168+
ret = "lib" in Path(path).parts or "node_modules" in Path(path).parts
169169
self._cached_dependencies[path] = ret
170170
return ret
171171

scripts/ci_test_solc_multi_file.sh

+39
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,51 @@
22

33
DIR=$(mktemp -d)
44

5+
normalize_file() {
6+
JQ_SCRIPT=$(cat <<'EOF'
7+
def sort_deps:
8+
if type == "object" then
9+
# Process each key-value pair
10+
with_entries(
11+
if .key == "contractDependencies" and (.value | type == "array") then
12+
.value = (.value | sort)
13+
else
14+
.value = (.value | sort_deps)
15+
end
16+
)
17+
elif type == "array" then
18+
# Process each array element recursively
19+
map(sort_deps)
20+
else
21+
.
22+
end;
23+
24+
sort_deps
25+
EOF
26+
)
27+
28+
jq "$JQ_SCRIPT" "$1" > "$1.mod"
29+
mv "$1.mod" "$1"
30+
}
31+
532
cp -r tests/solc-multi-file "$DIR"
633
cd "$DIR/solc-multi-file" || exit 255
734
crytic-compile --compile-remove-metadata --export-formats solc,truffle A.sol
835

936
cd - || exit 255
1037
node tests/process_combined_solc.js "$DIR/solc-multi-file/crytic-export/combined_solc.json" "$DIR"
38+
39+
case "$(uname -sr)" in
40+
#for some reason, contractDependencies appear in random order in Windows
41+
#so we sort them for consistency in the tests
42+
CYGWIN*|MINGW*|MSYS*)
43+
echo "Testing on Windows, doing extra JSON normalization"
44+
for f in "$DIR/solc-multi-file/crytic-export/"*.json tests/expected/solc-multi-file/*.json; do
45+
normalize_file "$f"
46+
done
47+
;;
48+
esac
49+
1150
DIFF=$(diff -r "$DIR/solc-multi-file/crytic-export" tests/expected/solc-multi-file)
1251
if [ "$?" != "0" ] || [ "$DIFF" != "" ]
1352
then

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
description="Util to facilitate smart contracts compilation.",
1212
url="https://github.com/crytic/crytic-compile",
1313
author="Trail of Bits",
14-
version="0.3.8",
14+
version="0.3.9",
1515
packages=find_packages(),
1616
# Python 3.12.0 on Windows suffers from https://github.com/python/cpython/issues/109590
1717
# breaking some of our integrations. The issue is fixed in 3.12.1

0 commit comments

Comments
 (0)