Skip to content

Commit

Permalink
Merge pull request #86 from bizzyvinci/docs
Browse files Browse the repository at this point in the history
Docs
  • Loading branch information
0xKitsune authored Mar 6, 2023
2 parents d63ef0b + 67f7068 commit 2c4196a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ A Solidity static analyzer to identify contract vulnerabilities and gas efficien
- [Installation](#installation)
- [Usage](#usage)
- [Identified Issues](https://github.com/0xKitsune/solstat/tree/main/docs)
- [⚡Optimizations](https://github.com/0xKitsune/solstat/blob/main/docs/indentified-optimizations.md)
- [🪲Vulnerabilities](https://github.com/0xKitsune/solstat/blob/main/docs/indentified-vulnerabilities.md)
- [⚡Optimizations](https://github.com/0xKitsune/solstat/blob/main/docs/identified-optimizations.md)
- [🪲Vulnerabilities](https://github.com/0xKitsune/solstat/blob/main/docs/identified-vulnerabilities.md)
- [👍Quality Assurance](https://github.com/0xKitsune/solstat/blob/main/docs/identified-quality-assurance.md)
- [Example Reports](https://github.com/0xKitsune/solstat-reports)
- [Contributing](#contributing)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
 
## ⚡Identified Gas Optimizations
Below are the currently identified optimizations that solstat identifies. If you would like to check out a list of patterns that are ready to be implemented and you would like to add them to the repo, you can check out the [Contribution.md](https://github.com/0xKitsune/solstat/blob/main/Contributing.md#potential-optimizations-vulnerability-and-qa-additions)!
Below are the currently identified optimizations that solstat identifies. If you would like to check out a list of patterns that are ready to be implemented and you would like to add them to the repo, you can check out the [Contribution.md](https://github.com/0xKitsune/solstat/blob/main/docs/Contributing.md#potential-optimizations-vulnerability-and-qa-additions)!

| Optimization | Description |
| ------------------------- | ------------------------------------------------------- |
Expand All @@ -9,8 +9,8 @@ Below are the currently identified optimizations that solstat identifies. If you
| assign_update_array_value | When updating a value in an array with arithmetic, using `array[index] += amount` is cheaper than `array[index] = array[index] + amount`. This optimization also catches other arithmetic, bitwise and other operations. |
| bool_equals_bool | Instead of `if (x == bool)`, use `if(x)` or when applicable, use assembly with `iszero(iszero(x))`. |
| cache_array_length | Cache array length during for loops. |
| constant_variable | Mark storage variables as `constant` if they never change and are not marked as constants.|
| immutable_variable | Mark storage variables as `immutable` if variables are assigned during deployment and never change afterwards.|
| constant_variables | Mark storage variables as `constant` if they never change and are not marked as constants.|
| immutable_variables | Mark storage variables as `immutable` if variables are assigned during deployment and never change afterwards.|
| increment_decrement | Use `unchecked{++i}` instead of `i++`, or `++i` (or use assembly when applicable). This also applies to decrementing as well.|
| memory_to_calldata | Use `calldata` for function arguments marked as `memory` that do not get mutated.|
| multiple_require | Use multiple require() statements instead of require(expression && expression && ...). |
Expand All @@ -22,8 +22,8 @@ Below are the currently identified optimizations that solstat identifies. If you
| safe_math_post_080 | Identifies when SafeMath is being used if the contract using solidity >= 0.8.0. Using SafeMath when using version >= 0.8.0 is redundant and will incur additional gas costs. |
| safe_math_pre_080 | Identifies when SafeMath is being used if the contract using solidity < 0.8.0. Consider using assembly with overflow/undeflow protection for math (add, sub, mul, div) instead of SafeMath. |
| shift_math | Right shift or Left shift instead of dividing or multiplying by powers of two. |
| short_revert_string | Use revert strings that fit in one word. |
| solidity_keccak256 | Use assembly to hash instead of Solidity. |
| solidity_math | Use assembly for math (add, sub, mul, div). |
| sstore | Use assembly to write storage values. |
| string_error | Use custom errors instead of string error messages for contracts using Solidity version >= 0.8.4.|
| short_revert_string | Use revert strings that fit in one word. |
9 changes: 6 additions & 3 deletions docs/identified-quality-assurance.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
&nbsp;
## 👍 Identified QA
Below are the currently identified QA that solstat identifies. If you would like to check out a list of patterns that are ready to be implemented and you would like to add them to the repo, you can check out the [Contribution.md](https://github.com/0xKitsune/solstat/blob/main/Contributing.md#potential-optimizations-vulnerability-and-qa-additions)!
Below are the currently identified QA that solstat identifies. If you would like to check out a list of patterns that are ready to be implemented and you would like to add them to the repo, you can check out the [Contribution.md](https://github.com/0xKitsune/solstat/blob/main/docs/Contributing.md#potential-optimizations-vulnerability-and-qa-additions)!

<!-- | Quality Assurance | Description |
| ------------------------- | ------------------------------------------------------- | -->
| Quality Assurance | Description |
| ------------------------- | ------------------------------------------------------- |
| constructor_order | Constructor must be placed before any other function |
| private_func_leading_underscore | Use leading underscore for private functions |
| private_vars_leading_underscore | Use leading underscore for private variables |
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
&nbsp;
## 🪲 Identified Vulnerabilities
Below are the currently identified vulnerabilities that solstat identifies. If you would like to check out a list of patterns that are ready to be implemented and you would like to add them to the repo, you can check out the [Contribution.md](https://github.com/0xKitsune/solstat/blob/main/Contributing.md#potential-optimizations-vulnerability-and-qa-additions)!
Below are the currently identified vulnerabilities that solstat identifies. If you would like to check out a list of patterns that are ready to be implemented and you would like to add them to the repo, you can check out the [Contribution.md](https://github.com/0xKitsune/solstat/blob/main/docs/Contributing.md#potential-optimizations-vulnerability-and-qa-additions)!

| Vulnerability | Description |
| ------------------------- | ------------------------------------------------------- |
| divide_before_multiply | Use multiplication symbol before division symbol |
| floating_pragma | Use locked pragma rather than floating pragma |
| unprotected_selfdestruct | Add sufficient access control to methods that call `selfdestruct` |
| unsafe_erc20_operation | Use `safeTransfer()`, `safeTransferFrom()`, `safeApprove()` instead of ERC20 `transfer()`, `transferFrom()`, `approve()`. |

0 comments on commit 2c4196a

Please sign in to comment.