Skip to content

Commit e5706e9

Browse files
authoredJul 22, 2024
Create Test-07-22-2024.md
Slither analysis summary Signed-off-by: Pavon Dunbar <[email protected]>
1 parent e19c0dd commit e5706e9

File tree

1 file changed

+131
-0
lines changed

1 file changed

+131
-0
lines changed
 

‎SlitherTest/Test-07-22-2024.md

+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Slither Analysis Report
2+
3+
The following test was conducted by Pavon Dunbar using Slither.
4+
5+
## Slither High Level Summary
6+
7+
- **Total number of contracts in source files**: 10
8+
- **Source lines of code (SLOC) in source files**: 570
9+
- **Number of assembly lines**: 0
10+
- **Number of optimization issues**: 0
11+
- **Number of informational issues**: 30
12+
- **Number of low issues**: 1
13+
- **Number of medium issues**: 0
14+
- **Number of high issues**: 0
15+
16+
**ERCs**: ERC20
17+
18+
| Name | # Functions | ERCs | ERC20 Info | Complex Code | Features |
19+
|--------------|-------------|------|--------------------|--------------|-------------------------|
20+
| IWETH | 8 | ERC20| No Minting | No | Receive ETH |
21+
| | | | Approve Race Cond. | | |
22+
| AMM | 53 | | | No | Receive ETH, Send ETH, Tokens interaction |
23+
| IERC20Permit | 3 | | | No | |
24+
| SafeERC20 | 7 | | | No | Send ETH, Tokens interaction |
25+
| Address | 8 | | | No | Send ETH, Delegatecall, Assembly |
26+
27+
AMM.sol analyzed (10 contracts)
28+
29+
30+
## Slither Detailed Summary
31+
32+
The following issues were detected in the `AMM.sol` contract using Slither:
33+
34+
## Detectors
35+
36+
### 1. Local Variable Shadowing
37+
- **Location:** `AMM._approve(address,address,uint256).owner` (AMM.sol#97) shadows:
38+
- `Ownable.owner()` (lib/openzeppelin-contracts/contracts/access/Ownable.sol#56-58) (function)
39+
- **Reference:** [Local Variable Shadowing](https://github.com/crytic/slither/wiki/Detector-Documentation#local-variable-shadowing)
40+
41+
### 2. Assembly Usage
42+
- **Location:** `Address._revert(bytes)` (lib/openzeppelin-contracts/contracts/utils/Address.sol#146-158) uses assembly
43+
- INLINE ASM (lib/openzeppelin-contracts/contracts/utils/Address.sol#151-154)
44+
- **Reference:** [Assembly Usage](https://github.com/crytic/slither/wiki/Detector-Documentation#assembly-usage)
45+
46+
### 3. Different Pragma Directives
47+
- **Details:**
48+
- **Version constraint 0.8.25 is used by:**
49+
- `0.8.25` (AMM.sol#2)
50+
- **Version constraint ^0.8.20 is used by:**
51+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/access/Ownable.sol#4)
52+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol#4)
53+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol#4)
54+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol#4)
55+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/utils/Address.sol#4)
56+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/utils/Context.sol#4)
57+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/utils/Pausable.sol#4)
58+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol#4)
59+
- **Reference:** [Different Pragma Directives](https://github.com/crytic/slither/wiki/Detector-Documentation#different-pragma-directives-are-used)
60+
61+
### 4. Dead Code
62+
- **Details:**
63+
- `AMM._calculateAmountOut(AMM.SwapInfo)` (AMM.sol#350-354) is never used and should be removed
64+
- `AMM._transferTokensToContract(AMM.AddLiquidityParams)` (AMM.sol#228-231) is never used and should be removed
65+
- `Context._contextSuffixLength()` (lib/openzeppelin-contracts/contracts/utils/Context.sol#25-27) is never used and should be removed
66+
- `Context._msgData()` (lib/openzeppelin-contracts/contracts/utils/Context.sol#21-23) is never used and should be removed
67+
- `ReentrancyGuard._reentrancyGuardEntered()` (lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol#81-83) is never used and should be removed
68+
- **Reference:** [Dead Code](https://github.com/crytic/slither/wiki/Detector-Documentation#dead-code)
69+
70+
### 5. Incorrect Versions of Solidity
71+
- **Details:**
72+
- **Version constraint 0.8.25 contains known severe issues:** [Solidity Bugs](https://solidity.readthedocs.io/en/latest/bugs.html)
73+
- It is used by: `0.8.25` (AMM.sol#2)
74+
- **Version constraint ^0.8.20 contains known severe issues:** [Solidity Bugs](https://solidity.readthedocs.io/en/latest/bugs.html)
75+
- VerbatimInvalidDeduplication
76+
- FullInlinerNonExpressionSplitArgumentEvaluationOrder
77+
- MissingSideEffectsOnSelectorAccess
78+
- It is used by:
79+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/access/Ownable.sol#4)
80+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol#4)
81+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol#4)
82+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol#4)
83+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/utils/Address.sol#4)
84+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/utils/Context.sol#4)
85+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/utils/Pausable.sol#4)
86+
- `^0.8.20` (lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol#4)
87+
- **Reference:** [Incorrect Versions of Solidity](https://github.com/crytic/slither/wiki/Detector-Documentation#incorrect-versions-of-solidity)
88+
89+
### 6. Low-Level Calls
90+
- **Details:**
91+
- Low-level call in `SafeERC20._callOptionalReturnBool(IERC20,bytes)` (lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol#110-117)
92+
- `(success,returndata) = address(token).call(data)` (lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol#115)
93+
- Low-level call in `Address.sendValue(address,uint256)` (lib/openzeppelin-contracts/contracts/utils/Address.sol#41-50)
94+
- `(success,None) = recipient.call{value: amount}()` (lib/openzeppelin-contracts/contracts/utils/Address.sol#46)
95+
- Low-level call in `Address.functionCallWithValue(address,bytes,uint256)` (lib/openzeppelin-contracts/contracts/utils/Address.sol#83-89)
96+
- `(success,returndata) = target.call{value: value}(data)` (lib/openzeppelin-contracts/contracts/utils/Address.sol#87)
97+
- Low-level call in `Address.functionStaticCall(address,bytes)` (lib/openzeppelin-contracts/contracts/utils/Address.sol#95-98)
98+
- `(success,returndata) = target.staticcall(data)` (lib/openzeppelin-contracts/contracts/utils/Address.sol#96)
99+
- Low-level call in `Address.functionDelegateCall(address,bytes)` (lib/openzeppelin-contracts/contracts/utils/Address.sol#104-107)
100+
- `(success,returndata) = target.delegatecall(data)` (lib/openzeppelin-contracts/contracts/utils/Address.sol#105)
101+
- **Reference:** [Low-Level Calls](https://github.com/crytic/slither/wiki/Detector-Documentation#low-level-calls)
102+
103+
### 7. Conformance to Solidity Naming Conventions
104+
- **Details:**
105+
- Parameter `AMM.setSwapFee(uint256)._swapFee` (AMM.sol#106) is not in mixedCase
106+
- Parameter `AMM.createPair(address,address)._token0` (AMM.sol#124) is not in mixedCase
107+
- Parameter `AMM.createPair(address,address)._token1` (AMM.sol#124) is not in mixedCase
108+
- Parameter `AMM.getPairInfo(uint256)._pairId` (AMM.sol#145) is not in mixedCase
109+
- Parameter `AMM.getBalance(uint256,address)._pairId` (AMM.sol#151) is not in mixedCase
110+
- Parameter `AMM.getBalance(uint256,address)._account` (AMM.sol#151) is not in mixedCase
111+
- Parameter `AMM.addLiquidity(uint256,uint256,uint256)._pairId` (AMM.sol#171) is not in mixedCase
112+
- Parameter `AMM.addLiquidity(uint256,uint256,uint256)._amount0` (AMM.sol#171) is not in mixedCase
113+
- Parameter `AMM.addLiquidity(uint256,uint256,uint256)._amount1` (AMM.sol#171) is not in mixedCase
114+
- Parameter `AMM.swap(uint256,address,uint256)._pairId` (AMM.sol#258) is not in mixedCase
115+
- Parameter `AMM.swap(uint256,address,uint256)._tokenIn` (AMM.sol#258) is not in mixedCase
116+
- Parameter `AMM.swap(uint256,address,uint256)._amountIn` (AMM.sol#258) is not in mixedCase
117+
- Parameter `AMM.removeLiquidity(uint256,uint256)._pairId` (AMM.sol#306) is not in mixedCase
118+
- Parameter `AMM.removeLiquidity(uint256,uint256)._shares` (AMM.sol#306) is not in mixedCase
119+
- Function `IERC20Permit.DOMAIN_SEPARATOR()` (lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol#89) is not in mixedCase
120+
- **Reference:** [Conformance to Solidity Naming Conventions](https://github.com/crytic/slither/wiki/Detector-Documentation#conformance-to-solidity-naming-conventions)
121+
122+
### 8. Unused Imports
123+
- **Details:**
124+
- The following unused import(s) in `lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol` should be removed:
125+
- `import {IERC20Permit} from "../extensions/IERC20Permit.sol";` (lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol#7)
126+
- **Reference:** [Unused Imports](https://github.com/crytic/slither/wiki/Detector-Documentation#unused-imports)
127+
128+
## Summary
129+
- **Contracts Analyzed:** 10
130+
- **Detectors Run:** 94
131+
- **Issues Found:** 31

0 commit comments

Comments
 (0)
Please sign in to comment.