SherlockChain - A Streamlined AI Analysis Framework For Solidity, Vyper And Plutus Contracts

AVvXsEh9nzWSS1hE7esXaMOdUelXmjDo5-ThIuSuE7vkp1D-FcEKtDh4Eqn7rUrgHUsfk1vS0c5xEzqt57-iKLI-Gh6KYJ4wMbglcKasUBoIU5MJBtOkJds9n0-IIVRIdFYS0bTSb7d5rpTRhodN4M3QKNCQaqvhrOY_M6nfHa8-oYL-amXcbawGeIdgIXiupO5P=w640-h640

SherlockChain is a powerful smart contract analysis framework that combines the capabilities of the renowned Slither tool with advanced AI-powered features. Developed by a team of security experts and AI researchers, SherlockChain offers unparalleled insights and vulnerability detection for Solidity, Vyper and Plutus smart contracts.

Key Features​

  • Comprehensive Vulnerability Detection: SherlockChain's suite of detectors identifies a wide range of vulnerabilities, including high-impact issues like reentrancy, unprotected upgrades, and more.
  • AI-Powered Analysis: Integrated AI models enhance the accuracy and precision of vulnerability detection, providing developers with actionable insights and recommendations.
  • Seamless Integration: SherlockChain seamlessly integrates with popular development frameworks like Hardhat, Foundry, and Brownie, making it easy to incorporate into your existing workflow.
  • Intuitive Reporting: SherlockChain generates detailed reports with clear explanations and code snippets, helping developers quickly understand and address identified issues.
  • Customizable Analyses: The framework's flexible API allows users to write custom analyses and detectors, tailoring the tool to their specific needs.
  • Continuous Monitoring: SherlockChain can be integrated into your CI/CD pipeline, providing ongoing monitoring and alerting for your smart contract codebase.

Installation​

To install SherlockChain, follow these steps:
코드:
git clone https://github.com/0xQuantumCoder/SherlockChain.git
cd SherlockChain
pip install .

AI-Powered Features​

SherlockChain's AI integration brings several advanced capabilities to the table:
  1. Intelligent Vulnerability Prioritization: AI models analyze the context and potential impact of detected vulnerabilities, providing developers with a prioritized list of issues to address.
  2. Automated Remediation Suggestions: The AI component suggests potential fixes and code modifications to address identified vulnerabilities, accelerating the remediation process.
  3. Proactive Security Auditing: SherlockChain's AI models continuously monitor your codebase, proactively identifying emerging threats and providing early warning signals.
  4. Natural Language Interaction: Users can interact with SherlockChain using natural language, allowing them to query the tool, request specific analyses, and receive detailed responses. he --help command in the SherlockChain framework provides a comprehensive overview of all the available options and features. It includes information on:
  5. Vulnerability Detection: The --detect and --exclude-detectors options allow users to specify which vulnerability detectors to run, including both built-in and AI-powered detectors.
  6. Reporting: The --report-format, --report-output, and various --report-* options control how the analysis results are reported, including the ability to generate reports in different formats (JSON, Markdown, SARIF, etc.).
  7. Filtering: The --filter-* options enable users to filter the reported issues based on severity, impact, confidence, and other criteria.
  8. AI Integration: The --ai-* options allow users to configure and control the AI-powered features of SherlockChain, such as prioritizing high-impact vulnerabilities, enabling specific AI detectors, and managing AI model configurations.
  9. Integration with Development Frameworks: Options like --truffle and --truffle-build-directory facilitate the integration of SherlockChain into popular development frameworks like Truffle.
  10. Miscellaneous Options: Additional options for compiling contracts, listing detectors, and customizing the analysis process.
The --help command provides a detailed explanation of each option, its purpose, and how to use it, making it a valuable resource for users to quickly understand and leverage the full capabilities of the SherlockChain framework.
Example usage:
sherlockchain --help
This will display the comprehensive usage guide for the SherlockChain framework, including all available options and their descriptions.
코드:
usage: sherlockchain [-h] [--version] [--solc-remaps SOLC_REMAPS] [--solc-settings SOLC_SETTINGS]
                    [--solc-version SOLC_VERSION] [--truffle] [--truffle-build-directory TRUFFLE_BUILD_DIRECTORY]
                    [--truffle-config-file TRUFFLE_CONFIG_FILE] [--compile] [--list-detectors]
                    [--list-detectors-info] [--detect DETECTORS] [--exclude-detectors EXCLUDE_DETECTORS]
                    [--print-issues] [--json] [--markdown] [--sarif] [--text] [--zip] [--output OUTPUT]
                    [--filter-paths FILTER_PATHS] [--filter-paths-exclude FILTER_PATHS_EXCLUDE]
                    [--filter-contracts FILTER_CONTRACTS] [--filter-contracts-exclude FILTER_CONTRACTS_EXCLUDE]
                    [--filter-severity FILTER_SEVERITY] [--filter-impact FILTER_IMPACT]
                    [--filter-confidence FILTER_CONFIDENCE] [--filter-check-suicidal]
                    [--filter-check-upgradeable] [--f   ilter-check-erc20] [--filter-check-erc721]
                    [--filter-check-reentrancy] [--filter-check-gas-optimization] [--filter-check-code-quality]
                    [--filter-check-best-practices] [--filter-check-ai-detectors] [--filter-check-all]
                    [--filter-check-none] [--check-all] [--check-suicidal] [--check-upgradeable]
                    [--check-erc20] [--check-erc721] [--check-reentrancy] [--check-gas-optimization]
                    [--check-code-quality] [--check-best-practices] [--check-ai-detectors] [--check-none]
                    [--check-all-detectors] [--check-all-severity] [--check-all-impact] [--check-all-confidence]
                    [--check-all-categories] [--check-all-filters] [--check-all-options] [--check-all]
                    [--check-none] [--report-format {json,markdown,sarif,text,zip}] [--report-output OUTPUT]
                    [--report-severity REPORT_SEVERITY] [--report-impact R   EPORT_IMPACT]
                    [--report-confidence REPORT_CONFIDENCE] [--report-check-suicidal]
                    [--report-check-upgradeable] [--report-check-erc20] [--report-check-erc721]
                    [--report-check-reentrancy] [--report-check-gas-optimization] [--report-check-code-quality]
                    [--report-check-best-practices] [--report-check-ai-detectors] [--report-check-all]
                    [--report-check-none] [--report-all] [--report-suicidal] [--report-upgradeable]
                    [--report-erc20] [--report-erc721] [--report-reentrancy] [--report-gas-optimization]
                    [--report-code-quality] [--report-best-practices] [--report-ai-detectors] [--report-none]
                    [--report-all-detectors] [--report-all-severity] [--report-all-impact]
                    [--report-all-confidence] [--report-all-categories] [--report-all-filters]
                    [--report-all-options] [-   -report-all] [--report-none] [--ai-enabled] [--ai-disabled]
                    [--ai-priority-high] [--ai-priority-medium] [--ai-priority-low] [--ai-priority-all]
                    [--ai-priority-none] [--ai-confidence-high] [--ai-confidence-medium] [--ai-confidence-low]
                    [--ai-confidence-all] [--ai-confidence-none] [--ai-detectors-all] [--ai-detectors-none]
                    [--ai-detectors-specific AI_DETECTORS_SPECIFIC] [--ai-detectors-exclude AI_DETECTORS_EXCLUDE]
                    [--ai-models-path AI_MODELS_PATH] [--ai-models-update] [--ai-models-download]
                    [--ai-models-list] [--ai-models-info] [--ai-models-version] [--ai-models-check]
                    [--ai-models-upgrade] [--ai-models-remove] [--ai-models-clean] [--ai-models-reset]
                    [--ai-models-backup] [--ai-models-restore] [--ai-models-export] [--ai-models-import]
                    [--ai-models-config AI_MODELS_CONFIG]    [--ai-models-config-update] [--ai-models-config-reset]
                    [--ai-models-config-export] [--ai-models-config-import] [--ai-models-config-list]
                    [--ai-models-config-info] [--ai-models-config-version] [--ai-models-config-check]
                    [--ai-models-config-upgrade] [--ai-models-config-remove] [--ai-models-config-clean]
                    [--ai-models-config-reset] [--ai-models-config-backup] [--ai-models-config-restore]
                    [--ai-models-config-export] [--ai-models-config-import] [--ai-models-config-path AI_MODELS_CONFIG_PATH]
                    [--ai-models-config-file AI_MODELS_CONFIG_FILE] [--ai-models-config-url AI_MODELS_CONFIG_URL]
                    [--ai-models-config-name AI_MODELS_CONFIG_NAME] [--ai-models-config-description AI_MODELS_CONFIG_DESCRIPTION]
                    [--ai-models-config-version-major AI_MODELS_CONFIG_VERSION_MAJOR]
                    [--ai-models-config-   version-minor AI_MODELS_CONFIG_VERSION_MINOR]
                    [--ai-models-config-version-patch AI_MODELS_CONFIG_VERSION_PATCH]
                    [--ai-models-config-author AI_MODELS_CONFIG_AUTHOR]
                    [--ai-models-config-license AI_MODELS_CONFIG_LICENSE]
                    [--ai-models-config-url-documentation AI_MODELS_CONFIG_URL_DOCUMENTATION]
                    [--ai-models-config-url-source AI_MODELS_CONFIG_URL_SOURCE]
                    [--ai-models-config-url-issues AI_MODELS_CONFIG_URL_ISSUES]
                    [--ai-models-config-url-changelog AI_MODELS_CONFIG_URL_CHANGELOG]
                    [--ai-models-config-url-support AI_MODELS_CONFIG_URL_SUPPORT]
                    [--ai-models-config-url-website AI_MODELS_CONFIG_URL_WEBSITE]
                    [--ai-models-config-url-logo AI_MODELS_CONFIG_URL_LOGO]
                    [--ai-models-config-url-icon AI_MODELS_CONFIG_URL_ICON]
                       [--ai-models-config-url-banner AI_MODELS_CONFIG_URL_BANNER]
                    [--ai-models-config-url-screenshot AI_MODELS_CONFIG_URL_SCREENSHOT]
                    [--ai-models-config-url-video AI_MODELS_CONFIG_URL_VIDEO]
                    [--ai-models-config-url-demo AI_MODELS_CONFIG_URL_DEMO]
                    [--ai-models-config-url-documentation-api AI_MODELS_CONFIG_URL_DOCUMENTATION_API]
                    [--ai-models-config-url-documentation-user AI_MODELS_CONFIG_URL_DOCUMENTATION_USER]
                    [--ai-models-config-url-documentation-developer AI_MODELS_CONFIG_URL_DOCUMENTATION_DEVELOPER]
                    [--ai-models-config-url-documentation-faq AI_MODELS_CONFIG_URL_DOCUMENTATION_FAQ]
                    [--ai-models-config-url-documentation-tutorial AI_MODELS_CONFIG_URL_DOCUMENTATION_TUTORIAL]
                    [--ai-models-config-url-documentation-guide AI_MODELS_CONFIG_URL_DOCUMENTATION_GUIDE]
                       [--ai-models-config-url-documentation-whitepaper AI_MODELS_CONFIG_URL_DOCUMENTATION_WHITEPAPER]
                    [--ai-models-config-url-documentation-roadmap AI_MODELS_CONFIG_URL_DOCUMENTATION_ROADMAP]
                    [--ai-models-config-url-documentation-blog AI_MODELS_CONFIG_URL_DOCUMENTATION_BLOG]
                    [--ai-models-config-url-documentation-community AI_MODELS_CONFIG_URL_DOCUMENTATION_COMMUNITY]
This comprehensive usage guide provides information on all the available options and features of the SherlockChain framework, including:
  • Vulnerability detection options: --detect, --exclude-detectors
  • Reporting options: --report-format, --report-output, --report-*
  • Filtering options: --filter-*
  • AI integration options: --ai-*
  • Integration with development frameworks: --truffle, --truffle-build-directory
  • Miscellaneous options: --compile, --list-detectors, --list-detectors-info
By reviewing this comprehensive usage guide, you can quickly understand how to leverage the full capabilities of the SherlockChain framework to analyze your smart contracts and identify potential vulnerabilities. This will help you ensure the security and reliability of your DeFi protocol before deployment.

AI-Powered Detectors​

NumDetectorWhat it DetectsImpactConfidence
1ai-anomaly-detectionDetect anomalous code patterns using advanced AI modelsHighHigh
2ai-vulnerability-predictionPredict potential vulnerabilities using machine learningHighHigh
3ai-code-optimizationSuggest code optimizations based on AI-driven analysisMediumHigh
4ai-contract-complexityAssess contract complexity and maintainability using AIMediumHigh
5ai-gas-optimizationIdentify gas-optimizing opportunities with AIMediumMedium
## Detectors
NumDetectorWhat it DetectsImpactConfidence
1abiencoderv2-arrayStorage abiencoderv2 arrayHighHigh
2arbitrary-send-erc20transferFrom uses arbitrary fromHighHigh
3array-by-referenceModifying storage array by valueHighHigh
4encode-packed-collisionABI encodePacked CollisionHighHigh
5incorrect-shiftThe order of parameters in a shift instruction is incorrect.HighHigh
6multiple-constructorsMultiple constructor schemesHighHigh
7name-reusedContract's name reusedHighHigh
8protected-varsDetected unprotected variablesHighHigh
9public-mappings-nestedPublic mappings with nested variablesHighHigh
10rtloRight-To-Left-Override control character is usedHighHigh
11shadowing-stateState variables shadowingHighHigh
12suicidalFunctions allowing anyone to destruct the contractHighHigh
13uninitialized-stateUninitialized state variablesHighHigh
14uninitialized-storageUninitialized storage variablesHighHigh
15unprotected-upgradeUnprotected upgradeable contractHighHigh
16codexUse Codex to find vulnerabilities.HighLow
17arbitrary-send-erc20-permittransferFrom uses arbitrary from with permitHighMedium
18arbitrary-send-ethFunctions that send Ether to arbitrary destinationsHighMedium
19controlled-array-lengthTainted array length assignmentHighMedium
20controlled-delegatecallControlled delegatecall destinationHighMedium
21delegatecall-loopPayable functions using delegatecall inside a loopHighMedium
22incorrect-expIncorrect exponentiationHighMedium
23incorrect-returnIf a return is incorrectly used in assembly mode.HighMedium
24msg-value-loopmsg.value inside a loopHighMedium
25reentrancy-ethReentrancy vulnerabilities (theft of ethers)HighMedium
26return-leaveIf a return is used instead of a leave.HighMedium
27storage-arraySigned storage integer array compiler bugHighMedium
28unchecked-transferUnchecked tokens transferHighMedium
29weak-prngWeak PRNGHighMedium
30domain-separator-collisionDetects ERC20 tokens that have a function whose signature collides with EIP-2612's DOMAIN_SEPARATOR()MediumHigh
31enum-conversionDetect dangerous enum conversionMediumHigh
32erc20-interfaceIncorrect ERC20 interfacesMediumHigh
33erc721-interfaceIncorrect ERC721 interfacesMediumHigh
34incorrect-equalityDangerous strict equalitiesMediumHigh
35locked-etherContracts that lock etherMediumHigh
36mapping-deletionDeletion on mapping containing a structureMediumHigh
37shadowing-abstractState variables shadowing from abstract contractsMediumHigh
38tautological-compareComparing a variable to itself always returns true or false, depending on comparisonMediumHigh
39tautologyTautology or contradictionMediumHigh
40write-after-writeUnused writeMediumHigh
41boolean-cstMisuse of Boolean constantMediumMedium
42constant-function-asmConstant functions using assembly codeMediumMedium
43constant-function-stateConstant functions changing the stateMediumMedium
44divide-before-multiplyImprecise arithmetic operations orderMediumMedium
45out-of-order-retryableOut-of-order retryable transactionsMediumMedium
46reentrancy-no-ethReentrancy vulnerabilities (no theft of ethers)MediumMedium
47reused-constructorReused base constructorMediumMedium
48tx-originDangerous usage of tx.originMediumMedium
49unchecked-lowlevelUnchecked low-level callsMediumMedium
50unchecked-sendUnchecked sendMediumMedium
51uninitialized-localUninitialized local variablesMediumMedium
52unused-returnUnused return valuesMediumMedium
53incorrect-modifierModifiers that can return the default valueLowHigh
54shadowing-builtinBuilt-in symbol shadowingLowHigh
55shadowing-localLocal variables shadowingLowHigh
56uninitialized-fptr-cstUninitialized function pointer calls in constructorsLowHigh
57variable-scopeLocal variables used prior their declarationLowHigh
58void-cstConstructor called not implementedLowHigh
59calls-loopMultiple calls in a loopLowMedium
60events-accessMissing Events Access ControlLowMedium
61events-mathsMissing Events ArithmeticLowMedium
62incorrect-unaryDangerous unary expressionsLowMedium
63missing-zero-checkMissing Zero Address ValidationLowMedium
64reentrancy-benignBenign reentrancy vulnerabilitiesLowMedium
65reentrancy-eventsReentrancy vulnerabilities leading to out-of-order EventsLowMedium
66return-bombA low level callee may consume all callers gas unexpectedly.LowMedium
67timestampDangerous usage of block.timestampLowMedium
68assemblyAssembly usageInformationalHigh
69assert-state-changeAssert state changeInformationalHigh
70boolean-equalComparison to boolean constantInformationalHigh
71cyclomatic-complexityDetects functions with high (> 11) cyclomatic complexityInformationalHigh
72deprecated-standardsDeprecated Solidity StandardsInformationalHigh
73erc20-indexedUn-indexed ERC20 event parametersInformationalHigh
74function-init-stateFunction initializing state variablesInformationalHigh
75incorrect-using-forDetects using-for statement usage when no function from a given library matches a given typeInformationalHigh
76low-level-callsLow level callsInformationalHigh
77missing-inheritanceMissing inheritanceInformationalHigh
78naming-conventionConformity to Solidity naming conventionsInformationalHigh
79pragmaIf different pragma directives are usedInformationalHigh
80redundant-statementsRedundant statementsInformationalHigh
81solc-versionIncorrect Solidity versionInformationalHigh
82unimplemented-functionsUnimplemented functionsInformationalHigh
83unused-importDetects unused importsInformationalHigh
84unused-stateUnused state variablesInformationalHigh
85costly-loopCostly operations in a loopInformationalMedium
86dead-codeFunctions that are not usedInformationalMedium
87reentrancy-unlimited-gasReentrancy vulnerabilities through send and transferInformationalMedium
88similar-namesVariable names are too similarInformationalMedium
89too-many-digitsConformance to numeric notation best practicesInformationalMedium
90cache-array-lengthDetects for loops that use length member of some storage array in their loop condition and don't modify it.OptimizationHigh
91constable-statesState variables that could be declared constantOptimizationHigh
92external-functionPublic function that could be declared externalOptimizationHigh
93immutable-statesState variables that could be declared immutableOptimizationHigh
94var-read-using-thisContract reads its own variable using thisOptimizationHigh
 
뒤로
상단