@@ -7,19 +7,14 @@ cd "$DIR" || exit 255
7
7
8
8
solc-select use 0.4.25 --always-install
9
9
10
- delay_etherscan () {
11
- # Perform a small sleep when API key is not available (e.g. on PR CI from external contributor)
12
- if [ " $GITHUB_ETHERSCAN " = " " ]; then
13
- sleep 5s
14
- else
15
- # Always sleep 2 second in the CI
16
- # We have a lot of concurrent github action so this is needed
17
- sleep 2s
18
- fi
19
- }
10
+ # Etherscan now _requires_ an API key, so skip the tests if it's not available
11
+ if [ " $ETHERSCAN_API_KEY " = " " ]; then
12
+ echo " API key not available, skipping etherscan tests"
13
+ exit 0
14
+ fi
20
15
21
16
echo " ::group::Etherscan mainnet"
22
- crytic-compile 0x7F37f78cBD74481E593F9C737776F7113d76B315 --compile-remove-metadata --etherscan-apikey " $GITHUB_ETHERSCAN "
17
+ crytic-compile 0x7F37f78cBD74481E593F9C737776F7113d76B315 --compile-remove-metadata --etherscan-apikey " $ETHERSCAN_API_KEY "
23
18
24
19
if [ $? -ne 0 ]
25
20
then
28
23
fi
29
24
echo " ::endgroup::"
30
25
31
- delay_etherscan
32
-
33
26
# From crytic/slither#1154
27
+ # Try without an explicit API key argument, to verify reading `ETHERSCAN_API_KEY` from env works fine
34
28
echo " ::group::Etherscan #3"
35
- crytic-compile 0xcfc1E0968CA08aEe88CbF664D4A1f8B881d90f37 --compile-remove-metadata --etherscan-apikey " $GITHUB_ETHERSCAN "
29
+ crytic-compile 0xcfc1E0968CA08aEe88CbF664D4A1f8B881d90f37 --compile-remove-metadata
36
30
37
31
if [ $? -ne 0 ]
38
32
then
41
35
fi
42
36
echo " ::endgroup::"
43
37
44
- delay_etherscan
45
-
46
38
# From crytic/crytic-compile#415
47
39
echo " ::group::Etherscan #4"
48
- crytic-compile 0x19c7d0fbf906c282dedb5543d098f43dfe9f856f --compile-remove-metadata --etherscan-apikey " $GITHUB_ETHERSCAN "
40
+ crytic-compile 0x19c7d0fbf906c282dedb5543d098f43dfe9f856f --compile-remove-metadata --etherscan-apikey " $ETHERSCAN_API_KEY "
49
41
50
42
if [ $? -ne 0 ]
51
43
then
54
46
fi
55
47
echo " ::endgroup::"
56
48
57
- delay_etherscan
58
-
59
49
# From crytic/crytic-compile#150
60
50
echo " ::group::Etherscan #5"
61
- crytic-compile 0x2a311e451491091d2a1d3c43f4f5744bdb4e773a --compile-remove-metadata --etherscan-apikey " $GITHUB_ETHERSCAN "
51
+ crytic-compile 0x2a311e451491091d2a1d3c43f4f5744bdb4e773a --compile-remove-metadata --etherscan-apikey " $ETHERSCAN_API_KEY "
62
52
63
53
if [ $? -ne 0 ]
64
54
then
74
64
fi
75
65
echo " ::endgroup::"
76
66
77
- delay_etherscan
78
-
79
67
# From crytic/crytic-compile#151
80
68
echo " ::group::Etherscan #6"
81
- crytic-compile 0x4c808e3c011514d5016536af11218eec537eb6f5 --compile-remove-metadata --etherscan-apikey " $GITHUB_ETHERSCAN "
69
+ crytic-compile 0x4c808e3c011514d5016536af11218eec537eb6f5 --compile-remove-metadata --etherscan-apikey " $ETHERSCAN_API_KEY "
82
70
83
71
if [ $? -ne 0 ]
84
72
then
87
75
fi
88
76
echo " ::endgroup::"
89
77
90
- delay_etherscan
91
-
92
78
# via-ir test for crytic/crytic-compile#517
93
79
echo " ::group::Etherscan #7"
94
- crytic-compile 0x9AB6b21cDF116f611110b048987E58894786C244 --compile-remove-metadata --etherscan-apikey " $GITHUB_ETHERSCAN "
80
+ crytic-compile 0x9AB6b21cDF116f611110b048987E58894786C244 --compile-remove-metadata --etherscan-apikey " $ETHERSCAN_API_KEY "
95
81
96
82
if [ $? -ne 0 ]
97
83
then
@@ -102,7 +88,7 @@ echo "::endgroup::"
102
88
103
89
# From crytic/crytic-compile#544
104
90
echo " ::group::Etherscan #8"
105
- crytic-compile 0x9AB6b21cDF116f611110b048987E58894786C244 --etherscan-apikey " $GITHUB_ETHERSCAN "
91
+ crytic-compile 0x9AB6b21cDF116f611110b048987E58894786C244 --etherscan-apikey " $ETHERSCAN_API_KEY "
106
92
107
93
if [ $? -ne 0 ]
108
94
then
0 commit comments