Skip to content

Commit

Permalink
cli/reportgen
Browse files Browse the repository at this point in the history
  • Loading branch information
TilakMaddy committed Aug 18, 2024
1 parent 253f76c commit 43f3adb
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 80 deletions.
31 changes: 10 additions & 21 deletions reports/report.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"files_summary": {
"total_source_units": 86,
<<<<<<< HEAD
"total_sloc": 2906
=======
"total_sloc": 2890
>>>>>>> dev
"total_source_units": 88,
"total_sloc": 3151
},
"files_details": {
"files_details": [
Expand Down Expand Up @@ -364,12 +360,8 @@
]
},
"issue_count": {
<<<<<<< HEAD
"high": 38,
=======
"high": 39,
>>>>>>> dev
"low": 31
"low": 32
},
"high_issues": {
"issues": [
Expand Down Expand Up @@ -2805,7 +2797,6 @@
"src_char": "113:1"
},
{
<<<<<<< HEAD
"contract_path": "src/AssertStateChange.sol",
"line_no": 8,
"src": "131:3",
Expand All @@ -2816,12 +2807,12 @@
"line_no": 12,
"src": "199:4",
"src_char": "199:4"
=======
},
{
"contract_path": "src/BuiltinSymbolShadow.sol",
"line_no": 8,
"src": "125:41",
"src_char": "125:41"
>>>>>>> dev
},
{
"contract_path": "src/ContractLocksEther.sol",
Expand Down Expand Up @@ -5038,7 +5029,6 @@
]
},
{
<<<<<<< HEAD
"title": "Incorrect use of `assert()`",
"description": "Argument to `assert()` modifies the state. Use `require` for invariants modifying state.",
"detector_name": "assert-state-change",
Expand All @@ -5048,7 +5038,10 @@
"line_no": 9,
"src": "154:23",
"src_char": "154:23"
=======
}
]
},
{
"title": "Builtin Symbol Shadowing",
"description": "Name clashes with a built-in-symbol. Consider renaming it.",
"detector_name": "builtin-symbol-shadow",
Expand Down Expand Up @@ -5076,7 +5069,6 @@
"line_no": 22,
"src": "414:15",
"src_char": "414:15"
>>>>>>> dev
}
]
}
Expand Down Expand Up @@ -5152,10 +5144,7 @@
"return-bomb",
"out-of-order-retryable",
"function-initializing-state",
<<<<<<< HEAD
"assert-state-change"
=======
"assert-state-change",
"builtin-symbol-shadow"
>>>>>>> dev
]
}
65 changes: 18 additions & 47 deletions reports/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,8 @@ This report was generated by [Aderyn](https://github.com/Cyfrin/aderyn), a stati
- [L-28: Boolean equality is not required.](#l-28-boolean-equality-is-not-required)
- [L-29: Return Bomb](#l-29-return-bomb)
- [L-30: Function initializing state.](#l-30-function-initializing-state)
<<<<<<< HEAD
- [L-31: Incorrect use of `assert()`](#l-31-incorrect-use-of-assert)
=======
- [L-31: Builtin Symbol Shadowing](#l-31-builtin-symbol-shadowing)
>>>>>>> dev
- [L-32: Builtin Symbol Shadowing](#l-32-builtin-symbol-shadowing)


# Summary
Expand All @@ -91,12 +88,8 @@ This report was generated by [Aderyn](https://github.com/Cyfrin/aderyn), a stati

| Key | Value |
| --- | --- |
| .sol Files | 86 |
<<<<<<< HEAD
| Total nSLOC | 2906 |
=======
| Total nSLOC | 2890 |
>>>>>>> dev
| .sol Files | 88 |
| Total nSLOC | 3151 |


## Files Details
Expand Down Expand Up @@ -191,23 +184,15 @@ This report was generated by [Aderyn](https://github.com/Cyfrin/aderyn), a stati
| src/reused_contract_name/ContractB.sol | 7 |
| src/uniswap/UniswapV2Swapper.sol | 50 |
| src/uniswap/UniswapV3Swapper.sol | 150 |
<<<<<<< HEAD
| **Total** | **2906** |
=======
| **Total** | **2890** |
>>>>>>> dev
| **Total** | **3151** |


## Issue Summary

| Category | No. of Issues |
| --- | --- |
<<<<<<< HEAD
| High | 38 |
=======
| High | 39 |
>>>>>>> dev
| Low | 31 |
| Low | 32 |


# High Issues
Expand Down Expand Up @@ -1229,11 +1214,7 @@ If the length of a dynamic array (storage variable) directly assigned to, it may

Solidity does initialize variables by default when you declare them, however it's good practice to explicitly declare an initial value. For example, if you transfer money to an address we must make sure that the address has been initialized.

<<<<<<< HEAD
<details><summary>30 Found Instances</summary>
=======
<details><summary>25 Found Instances</summary>
>>>>>>> dev
<details><summary>32 Found Instances</summary>


- Found in src/AssemblyExample.sol [Line: 5](../tests/contract-playground/src/AssemblyExample.sol#L5)
Expand Down Expand Up @@ -2561,11 +2542,7 @@ ERC20 functions may not behave as expected. For example: return values are not a

Consider using a specific version of Solidity in your contracts instead of a wide version. For example, instead of `pragma solidity ^0.8.0;`, use `pragma solidity 0.8.0;`

<<<<<<< HEAD
<details><summary>29 Found Instances</summary>
=======
<details><summary>30 Found Instances</summary>
>>>>>>> dev
<details><summary>31 Found Instances</summary>


- Found in src/BuiltinSymbolShadow.sol [Line: 2](../tests/contract-playground/src/BuiltinSymbolShadow.sol#L2)
Expand Down Expand Up @@ -2827,11 +2804,7 @@ Check for `address(0)` when assigning values to address state variables.

Instead of marking a function as `public`, consider marking it as `external` if it is not used internally.

<<<<<<< HEAD
<details><summary>42 Found Instances</summary>
=======
<details><summary>41 Found Instances</summary>
>>>>>>> dev
<details><summary>43 Found Instances</summary>


- Found in src/ArbitraryTransferFrom.sol [Line: 28](../tests/contract-playground/src/ArbitraryTransferFrom.sol#L28)
Expand All @@ -2846,7 +2819,6 @@ Instead of marking a function as `public`, consider marking it as `external` if
function f(uint x) public view returns (uint r) {
```

<<<<<<< HEAD
- Found in src/AssertStateChange.sol [Line: 8](../tests/contract-playground/src/AssertStateChange.sol#L8)

```solidity
Expand All @@ -2857,12 +2829,12 @@ Instead of marking a function as `public`, consider marking it as `external` if

```solidity
function good() public {
=======
```

- Found in src/BuiltinSymbolShadow.sol [Line: 8](../tests/contract-playground/src/BuiltinSymbolShadow.sol#L8)

```solidity
function assert(bool condition) public {}
>>>>>>> dev
```

- Found in src/ContractLocksEther.sol [Line: 20](../tests/contract-playground/src/ContractLocksEther.sol#L20)
Expand Down Expand Up @@ -3774,11 +3746,7 @@ Using `ERC721::_mint()` can mint ERC721 tokens to addresses which don't support

Solc compiler version 0.8.20 switches the default target EVM version to Shanghai, which means that the generated bytecode will include PUSH0 opcodes. Be sure to select the appropriate EVM version in case you intend to deploy on a chain other than mainnet like L2 chains that may not support PUSH0, otherwise deployment of your contracts will fail.

<<<<<<< HEAD
<details><summary>37 Found Instances</summary>
=======
<details><summary>36 Found Instances</summary>
>>>>>>> dev
<details><summary>38 Found Instances</summary>


- Found in src/AdminContract.sol [Line: 2](../tests/contract-playground/src/AdminContract.sol#L2)
Expand Down Expand Up @@ -5150,7 +5118,6 @@ Detects the immediate initialization of state variables through function calls t



<<<<<<< HEAD
## L-31: Incorrect use of `assert()`

Argument to `assert()` modifies the state. Use `require` for invariants modifying state.
Expand All @@ -5162,8 +5129,13 @@ Argument to `assert()` modifies the state. Use `require` for invariants modifyin

```solidity
assert((s_a += 1) > 10);
=======
## L-31: Builtin Symbol Shadowing
```

</details>



## L-32: Builtin Symbol Shadowing

Name clashes with a built-in-symbol. Consider renaming it.

Expand Down Expand Up @@ -5192,7 +5164,6 @@ Name clashes with a built-in-symbol. Consider renaming it.

```solidity
event sha256();
>>>>>>> dev
```

</details>
Expand Down
33 changes: 21 additions & 12 deletions reports/report.sarif
Original file line number Diff line number Diff line change
Expand Up @@ -4274,7 +4274,6 @@
{
"physicalLocation": {
"artifactLocation": {
<<<<<<< HEAD
"uri": "src/AssertStateChange.sol"
},
"region": {
Expand All @@ -4291,13 +4290,17 @@
"region": {
"byteLength": 4,
"byteOffset": 199
=======
}
}
},
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/BuiltinSymbolShadow.sol"
},
"region": {
"byteLength": 41,
"byteOffset": 125
>>>>>>> dev
}
}
},
Expand Down Expand Up @@ -8284,13 +8287,26 @@
{
"physicalLocation": {
"artifactLocation": {
<<<<<<< HEAD
"uri": "src/AssertStateChange.sol"
},
"region": {
"byteLength": 23,
"byteOffset": 154
=======
}
}
}
],
"message": {
"text": "Argument to `assert()` modifies the state. Use `require` for invariants modifying state."
},
"ruleId": "assert-state-change"
},
{
"level": "note",
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/BuiltinSymbolShadow.sol"
},
"region": {
Expand Down Expand Up @@ -8329,21 +8345,14 @@
"region": {
"byteLength": 15,
"byteOffset": 414
>>>>>>> dev
}
}
}
],
"message": {
<<<<<<< HEAD
"text": "Argument to `assert()` modifies the state. Use `require` for invariants modifying state."
},
"ruleId": "assert-state-change"
=======
"text": "Name clashes with a built-in-symbol. Consider renaming it."
},
"ruleId": "builtin-symbol-shadow"
>>>>>>> dev
}
],
"tool": {
Expand Down

0 comments on commit 43f3adb

Please sign in to comment.