File tree Expand file tree Collapse file tree 5 files changed +82
-3
lines changed Expand file tree Collapse file tree 5 files changed +82
-3
lines changed Original file line number Diff line number Diff line change 105105 "prettier:ts" : " prettier --write 'test/**/*.ts'" ,
106106 "prettier:sol" : " prettier --write 'contracts/*.sol'" ,
107107 "analyze" : " scripts/analyze" ,
108- "flatten" : " scripts/flatten" ,
108+ "myth" : " scripts/myth" ,
109+ "flatten" : " scripts/flatten && scripts/clean" ,
109110 "typechain" : " hardhat typechain" ,
110111 "verify" : " hardhat verify" ,
111112 "size" : " hardhat size-contracts"
Original file line number Diff line number Diff line change 33# # Before running:
44# This tool requires to have solc installed.
55# Ensure that you have the binaries installed by pip3 in your path.
6- # Install: https://github.com/crytic/slither#how-to-install
7- # Usage: https://github.com/crytic/slither/wiki/Usage
6+ # Install:
7+ # - https://github.com/crytic/slither#how-to-install
8+ # Usage:
9+ # - https://github.com/crytic/slither/wiki/Usage
810
911mkdir -p reports
1012
@@ -21,6 +23,9 @@ slither . \
2123 --exclude similar-names,naming-convention \
2224 --disable-color \
2325 & > reports/analyzer-report.sarif && \
26+ echo " Slither report generated at ./reports/analyzer-report.sarif"
27+ echo " Checking ERC compliance..."
2428slither-check-erc build/flatten/GraphToken.sol GraphToken & > reports/analyzer-report-erc.log
29+ echo " Compliance report generated at ./reports/analyzer-report-erc.log"
2530
2631echo " Done!"
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ OUT_DIR=" build/flatten"
4+
5+ mkdir -p ${OUT_DIR}
6+
7+ echo " Cleaning flattened contracts..."
8+
9+ FLATTENED_FILES=(
10+ " $OUT_DIR /Controller.sol"
11+ " $OUT_DIR /GraphGovernance.sol"
12+ " $OUT_DIR /GNS.sol"
13+ " $OUT_DIR /ServiceRegistry.sol"
14+ " $OUT_DIR /Curation.sol"
15+ " $OUT_DIR /GraphCurationToken.sol"
16+ " $OUT_DIR /Staking.sol"
17+ " $OUT_DIR /RewardsManager.sol"
18+ " $OUT_DIR /GraphToken.sol"
19+ " $OUT_DIR /EpochManager.sol"
20+ " $OUT_DIR /GraphProxy.sol"
21+ " $OUT_DIR /GDAI.sol"
22+ " $OUT_DIR /GSRManager.sol"
23+ )
24+
25+ for path in ${FLATTENED_FILES[@]} ; do
26+ echo " Clean > ${path} "
27+ sed -i \
28+ -e " s|pragma solidity.*||g" \
29+ -e " s|// SPDX-License-Identifier:.*||g" \
30+ -e ' s|pragma experimental ABIEncoderV2;|//pragma experimental ABIEncoderV2;|g' \
31+ -e ' 1s|^|pragma experimental ABIEncoderV2;\n|' $path
32+ done
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # # Before running:
4+ # This tool requires to have solc installed.
5+ # Ensure that you have the binaries installed by pip3 in your path.
6+ # Install:
7+ # - https://github.com/ConsenSys/mythril#installation-and-setup
8+ # Usage:
9+ # - https://github.com/ConsenSys/mythril#usage
10+
11+ pip3 install --user mythril && \
12+ yarn build && \
13+ mkdir -p reports/myth
14+
15+ echo " Myth Analysis..."
16+
17+ start_time=" $( date -u +%s) "
18+
19+ for filename in build/flatten/* .sol; do
20+ step_start_time=" $( date -u +%s) "
21+ echo " Scanning $filename ..."
22+ myth analyze \
23+ --parallel-solving \
24+ --execution-timeout 30 \
25+ --solver-timeout 6000 \
26+ -o markdown " $filename " \
27+ & > " reports/myth/$( basename " $filename " .sol) -report.md" && \
28+
29+ end_time=" $( date -u +%s) "
30+ total_elapsed=" $(( $end_time - $start_time )) "
31+ step_elapsed=" $(( $end_time - $step_start_time )) "
32+ echo " > Took $step_elapsed seconds. Total elapsed: $total_elapsed seconds."
33+ done
34+
35+ echo " Done!"
Original file line number Diff line number Diff line change 1+ {
2+ "hardhat_artifacts_directory" : " ./build/contracts" ,
3+ "filter_paths" : " contracts/bancor/.*|contracts/tests/.*|contracts/staking/libs/Cobbs.*|contracts/staking/libs/LibFixedMath.*|contracts/staking/libs/MathUtils.*" ,
4+ "detectors_to_exclude" : " similar-names,naming-convention" ,
5+ "exclude_dependencies" : true
6+ }
You can’t perform that action at this time.
0 commit comments