@@ -7,19 +7,14 @@ cd "$DIR" || exit 255
77
88solc-select use 0.4.25 --always-install
99
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
2015
2116echo " ::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 "
2318
2419if [ $? -ne 0 ]
2520then
2823fi
2924echo " ::endgroup::"
3025
31- delay_etherscan
32-
3326# From crytic/slither#1154
27+ # Try without an explicit API key argument, to verify reading `ETHERSCAN_API_KEY` from env works fine
3428echo " ::group::Etherscan #3"
35- crytic-compile 0xcfc1E0968CA08aEe88CbF664D4A1f8B881d90f37 --compile-remove-metadata --etherscan-apikey " $GITHUB_ETHERSCAN "
29+ crytic-compile 0xcfc1E0968CA08aEe88CbF664D4A1f8B881d90f37 --compile-remove-metadata
3630
3731if [ $? -ne 0 ]
3832then
4135fi
4236echo " ::endgroup::"
4337
44- delay_etherscan
45-
4638# From crytic/crytic-compile#415
4739echo " ::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 "
4941
5042if [ $? -ne 0 ]
5143then
5446fi
5547echo " ::endgroup::"
5648
57- delay_etherscan
58-
5949# From crytic/crytic-compile#150
6050echo " ::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 "
6252
6353if [ $? -ne 0 ]
6454then
7464fi
7565echo " ::endgroup::"
7666
77- delay_etherscan
78-
7967# From crytic/crytic-compile#151
8068echo " ::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 "
8270
8371if [ $? -ne 0 ]
8472then
8775fi
8876echo " ::endgroup::"
8977
90- delay_etherscan
91-
9278# via-ir test for crytic/crytic-compile#517
9379echo " ::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 "
9581
9682if [ $? -ne 0 ]
9783then
@@ -102,7 +88,7 @@ echo "::endgroup::"
10288
10389# From crytic/crytic-compile#544
10490echo " ::group::Etherscan #8"
105- crytic-compile 0x9AB6b21cDF116f611110b048987E58894786C244 --etherscan-apikey " $GITHUB_ETHERSCAN "
91+ crytic-compile 0x9AB6b21cDF116f611110b048987E58894786C244 --etherscan-apikey " $ETHERSCAN_API_KEY "
10692
10793if [ $? -ne 0 ]
10894then
0 commit comments