Skip to content

Commit

Permalink
cli/reportgen
Browse files Browse the repository at this point in the history
  • Loading branch information
TilakMaddy committed Jul 31, 2024
1 parent bf644d1 commit 364227b
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 25 deletions.
78 changes: 66 additions & 12 deletions reports/report.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files_summary": {
"total_source_units": 74,
"total_sloc": 2074
"total_sloc": 2117
},
"files_details": {
"files_details": [
Expand Down Expand Up @@ -39,7 +39,7 @@
},
{
"file_path": "src/ContractLocksEther.sol",
"n_sloc": 78
"n_sloc": 121
},
{
"file_path": "src/ContractWithTodo.sol",
Expand Down Expand Up @@ -1513,9 +1513,21 @@
},
{
"contract_path": "src/ContractLocksEther.sol",
"line_no": 121,
"src": "3950:11",
"src_char": "3950:11"
"line_no": 131,
"src": "4205:11",
"src_char": "4205:11"
},
{
"contract_path": "src/ContractLocksEther.sol",
"line_no": 167,
"src": "5373:11",
"src_char": "5373:11"
},
{
"contract_path": "src/ContractLocksEther.sol",
"line_no": 194,
"src": "6342:11",
"src_char": "6342:11"
},
{
"contract_path": "src/SendEtherNoChecks.sol",
Expand Down Expand Up @@ -1993,6 +2005,12 @@
"src": "1517:20",
"src_char": "1517:20"
},
{
"contract_path": "src/ContractLocksEther.sol",
"line_no": 162,
"src": "5185:18",
"src_char": "5185:18"
},
{
"contract_path": "src/DeprecatedOZFunctions.sol",
"line_no": 32,
Expand Down Expand Up @@ -2250,9 +2268,21 @@
},
{
"contract_path": "src/ContractLocksEther.sol",
"line_no": 108,
"src": "3383:10",
"src_char": "3383:10"
"line_no": 118,
"src": "3653:10",
"src_char": "3653:10"
},
{
"contract_path": "src/ContractLocksEther.sol",
"line_no": 155,
"src": "4877:10",
"src_char": "4877:10"
},
{
"contract_path": "src/ContractLocksEther.sol",
"line_no": 181,
"src": "5775:10",
"src_char": "5775:10"
},
{
"contract_path": "src/ContractWithTodo.sol",
Expand Down Expand Up @@ -2655,14 +2685,38 @@
{
"contract_path": "src/ContractLocksEther.sol",
"line_no": 102,
"src": "3171:56",
"src_char": "3171:56"
"src": "3143:56",
"src_char": "3143:56"
},
{
"contract_path": "src/ContractLocksEther.sol",
"line_no": 105,
"src": "3263:54",
"src_char": "3263:54"
"src": "3235:54",
"src_char": "3235:54"
},
{
"contract_path": "src/ContractLocksEther.sol",
"line_no": 139,
"src": "4367:56",
"src_char": "4367:56"
},
{
"contract_path": "src/ContractLocksEther.sol",
"line_no": 142,
"src": "4459:54",
"src_char": "4459:54"
},
{
"contract_path": "src/ContractLocksEther.sol",
"line_no": 175,
"src": "5563:56",
"src_char": "5563:56"
},
{
"contract_path": "src/ContractLocksEther.sol",
"line_no": 178,
"src": "5655:54",
"src_char": "5655:54"
},
{
"contract_path": "src/TestERC20.sol",
Expand Down
72 changes: 63 additions & 9 deletions reports/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ This report was generated by [Aderyn](https://github.com/Cyfrin/aderyn), a stati
| Key | Value |
| --- | --- |
| .sol Files | 74 |
| Total nSLOC | 2074 |
| Total nSLOC | 2117 |


## Files Details
Expand All @@ -91,7 +91,7 @@ This report was generated by [Aderyn](https://github.com/Cyfrin/aderyn), a stati
| src/Casting.sol | 126 |
| src/CompilerBugStorageSignedIntegerArray.sol | 13 |
| src/ConstantsLiterals.sol | 28 |
| src/ContractLocksEther.sol | 78 |
| src/ContractLocksEther.sol | 121 |
| src/ContractWithTodo.sol | 7 |
| src/Counter.sol | 20 |
| src/CrazyPragma.sol | 4 |
Expand Down Expand Up @@ -157,7 +157,7 @@ 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 |
| **Total** | **2074** |
| **Total** | **2117** |


## Issue Summary
Expand Down Expand Up @@ -1445,7 +1445,7 @@ The patterns `if (… || true)` and `if (.. && false)` will always evaluate to t

Introduce checks for `msg.sender` in the function

<details><summary>11 Found Instances</summary>
<details><summary>13 Found Instances</summary>


- Found in src/CallGraphTests.sol [Line: 38](../tests/contract-playground/src/CallGraphTests.sol#L38)
Expand All @@ -1460,7 +1460,19 @@ Introduce checks for `msg.sender` in the function
function takeEthBack(uint256 amount) external {
```

- Found in src/ContractLocksEther.sol [Line: 121](../tests/contract-playground/src/ContractLocksEther.sol#L121)
- Found in src/ContractLocksEther.sol [Line: 131](../tests/contract-playground/src/ContractLocksEther.sol#L131)

```solidity
function takeEthBack(uint256 amount) external {
```

- Found in src/ContractLocksEther.sol [Line: 167](../tests/contract-playground/src/ContractLocksEther.sol#L167)

```solidity
function takeEthBack(uint256 amount) external {
```

- Found in src/ContractLocksEther.sol [Line: 194](../tests/contract-playground/src/ContractLocksEther.sol#L194)

```solidity
function takeEthBack(uint256 amount) external {
Expand Down Expand Up @@ -1986,7 +1998,7 @@ Openzeppelin has deprecated several functions and replaced with newer versions.

ERC20 functions may not behave as expected. For example: return values are not always meaningful. It is recommended to use OpenZeppelin's SafeERC20 library.

<details><summary>11 Found Instances</summary>
<details><summary>12 Found Instances</summary>


- Found in src/ArbitraryTransferFrom.sol [Line: 16](../tests/contract-playground/src/ArbitraryTransferFrom.sol#L16)
Expand All @@ -2007,6 +2019,12 @@ ERC20 functions may not behave as expected. For example: return values are not a
s_token.transferFrom(msg.sender, to, amount);
```

- Found in src/ContractLocksEther.sol [Line: 162](../tests/contract-playground/src/ContractLocksEther.sol#L162)

```solidity
recipient.transfer(amount);
```

- Found in src/DeprecatedOZFunctions.sol [Line: 32](../tests/contract-playground/src/DeprecatedOZFunctions.sol#L32)

```solidity
Expand Down Expand Up @@ -2241,7 +2259,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.

<details><summary>27 Found Instances</summary>
<details><summary>29 Found Instances</summary>


- Found in src/ArbitraryTransferFrom.sol [Line: 28](../tests/contract-playground/src/ArbitraryTransferFrom.sol#L28)
Expand Down Expand Up @@ -2274,7 +2292,19 @@ Instead of marking a function as `public`, consider marking it as `external` if
function getBalance() public view returns (uint256) {
```

- Found in src/ContractLocksEther.sol [Line: 108](../tests/contract-playground/src/ContractLocksEther.sol#L108)
- Found in src/ContractLocksEther.sol [Line: 118](../tests/contract-playground/src/ContractLocksEther.sol#L118)

```solidity
function getBalance() public view returns (uint256) {
```

- Found in src/ContractLocksEther.sol [Line: 155](../tests/contract-playground/src/ContractLocksEther.sol#L155)

```solidity
function getBalance() public view returns (uint256) {
```

- Found in src/ContractLocksEther.sol [Line: 181](../tests/contract-playground/src/ContractLocksEther.sol#L181)

```solidity
function getBalance() public view returns (uint256) {
Expand Down Expand Up @@ -2641,7 +2671,7 @@ If the same constant literal value is used multiple times, create a constant sta

Index event fields make the field more quickly accessible to off-chain tools that parse events. However, note that each index field costs extra gas during emission, so it's not necessarily best to index the maximum allowed per event (three fields). Each event should use three indexed fields if there are three or more fields, and gas usage is not particularly of concern for the events in question. If there are fewer than three fields, all of the fields should be indexed.

<details><summary>14 Found Instances</summary>
<details><summary>18 Found Instances</summary>


- Found in src/ContractLocksEther.sol [Line: 7](../tests/contract-playground/src/ContractLocksEther.sol#L7)
Expand Down Expand Up @@ -2686,6 +2716,30 @@ Index event fields make the field more quickly accessible to off-chain tools tha
event Transferred(address indexed to, uint256 amount);
```

- Found in src/ContractLocksEther.sol [Line: 139](../tests/contract-playground/src/ContractLocksEther.sol#L139)

```solidity
event Deposited(address indexed sender, uint256 amount);
```

- Found in src/ContractLocksEther.sol [Line: 142](../tests/contract-playground/src/ContractLocksEther.sol#L142)

```solidity
event Transferred(address indexed to, uint256 amount);
```

- Found in src/ContractLocksEther.sol [Line: 175](../tests/contract-playground/src/ContractLocksEther.sol#L175)

```solidity
event Deposited(address indexed sender, uint256 amount);
```

- Found in src/ContractLocksEther.sol [Line: 178](../tests/contract-playground/src/ContractLocksEther.sol#L178)

```solidity
event Transferred(address indexed to, uint256 amount);
```

- Found in src/TestERC20.sol [Line: 14](../tests/contract-playground/src/TestERC20.sol#L14)

```solidity
Expand Down
Loading

0 comments on commit 364227b

Please sign in to comment.