Skip to content

Commit

Permalink
cli/reportgen
Browse files Browse the repository at this point in the history
  • Loading branch information
TilakMaddy committed Aug 2, 2024
1 parent d9bb36d commit 8ab3f78
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 98 deletions.
18 changes: 0 additions & 18 deletions reports/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -4067,12 +4067,6 @@
"description": "If the assembly code contains bugs or unintended side effects, it can lead to incorrect results or vulnerabilities, which are hard to debug and resolve, especially when the function is meant to be simple and predictable.",
"detector_name": "constant-functions-assembly",
"instances": [
{
"contract_path": "src/AssemblyExample.sol",
"line_no": 6,
"src": "113:1",
"src_char": "113:1"
},
{
"contract_path": "src/ConstantFuncsAssembly.sol",
"line_no": 9,
Expand All @@ -4090,18 +4084,6 @@
"line_no": 36,
"src": "934:98",
"src_char": "934:98"
},
{
"contract_path": "src/TestERC20.sol",
"line_no": 17,
"src": "498:10",
"src_char": "498:10"
},
{
"contract_path": "src/YulReturn.sol",
"line_no": 6,
"src": "92:12",
"src_char": "92:12"
}
]
}
Expand Down
20 changes: 1 addition & 19 deletions reports/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4154,14 +4154,8 @@ The contract reads it's own variable using `this` which adds an unnecessary STAT

If the assembly code contains bugs or unintended side effects, it can lead to incorrect results or vulnerabilities, which are hard to debug and resolve, especially when the function is meant to be simple and predictable.

<details><summary>6 Found Instances</summary>


- Found in src/AssemblyExample.sol [Line: 6](../tests/contract-playground/src/AssemblyExample.sol#L6)
<details><summary>3 Found Instances</summary>

```solidity
function f(uint x) public view returns (uint r) {
```

- Found in src/ConstantFuncsAssembly.sol [Line: 9](../tests/contract-playground/src/ConstantFuncsAssembly.sol#L9)

Expand All @@ -4181,18 +4175,6 @@ If the assembly code contains bugs or unintended side effects, it can lead to in
function getConstantValue2() external pure returns (uint256) {
```

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

```solidity
function getChainId() external view returns(uint256) {
```

- Found in src/YulReturn.sol [Line: 6](../tests/contract-playground/src/YulReturn.sol#L6)

```solidity
function hasYulReturn() external pure returns(uint256) {
```

</details>


Expand Down
33 changes: 0 additions & 33 deletions reports/report.sarif
Original file line number Diff line number Diff line change
Expand Up @@ -6617,17 +6617,6 @@
{
"level": "note",
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/AssemblyExample.sol"
},
"region": {
"byteLength": 1,
"byteOffset": 113
}
}
},
{
"physicalLocation": {
"artifactLocation": {
Expand Down Expand Up @@ -6660,28 +6649,6 @@
"byteOffset": 934
}
}
},
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/TestERC20.sol"
},
"region": {
"byteLength": 10,
"byteOffset": 498
}
}
},
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/YulReturn.sol"
},
"region": {
"byteLength": 12,
"byteOffset": 92
}
}
}
],
"message": {
Expand Down
32 changes: 4 additions & 28 deletions reports/templegold-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ This report was generated by [Aderyn](https://github.com/Cyfrin/aderyn), a stati
- [L-17: Loop contains `require`/`revert` statements](#l-17-loop-contains-requirerevert-statements)
- [L-18: Incorrect Order of Division and Multiplication](#l-18-incorrect-order-of-division-and-multiplication)
- [L-19: Redundant statements have no effect.](#l-19-redundant-statements-have-no-effect)
- [L-20: Functions declared `pure` / `view` but contains assembly](#l-20-functions-declared-pure--view-but-contains-assembly)


# Summary
Expand Down Expand Up @@ -192,7 +191,7 @@ This report was generated by [Aderyn](https://github.com/Cyfrin/aderyn), a stati
| Category | No. of Issues |
| --- | --- |
| High | 10 |
| Low | 20 |
| Low | 19 |


# High Issues
Expand Down Expand Up @@ -6773,7 +6772,7 @@ Index event fields make the field more quickly accessible to off-chain tools tha

Use descriptive reason strings or custom errors for revert paths.

<details><summary>55 Found Instances</summary>
<details><summary>54 Found Instances</summary>


- Found in contracts/core/OpsManager.sol [Line: 50](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L50)
Expand All @@ -6788,12 +6787,6 @@ Use descriptive reason strings or custom errors for revert paths.
require (x >= -0x8000000000000000 && x <= 0x7FFFFFFFFFFFFFFF);
```

- Found in contracts/util/ABDKMath64x64.sol [Line: 63](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L63)

```solidity
require (x <= 0x7FFFFFFFFFFFFFFF);
```

- Found in contracts/util/ABDKMath64x64.sol [Line: 77](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L77)

```solidity
Expand Down Expand Up @@ -7010,10 +7003,10 @@ Use descriptive reason strings or custom errors for revert paths.
require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
```

- Found in contracts/util/ABDKMathQuad.sol [Line: 76](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L76)
- Found in contracts/util/ABDKMathQuad.sol [Line: 72](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L72)

```solidity
require (exponent <= 16638); // Overflow
function toInt (bytes16 x) internal pure returns (int256) {
```

- Found in contracts/util/ABDKMathQuad.sol [Line: 86](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L86)
Expand Down Expand Up @@ -8654,20 +8647,3 @@ Remove the redundant statements because no code will be generated and it just co



## L-20: Functions declared `pure` / `view` but contains assembly

If the assembly code contains bugs or unintended side effects, it can lead to incorrect results or vulnerabilities, which are hard to debug and resolve, especially when the function is meant to be simple and predictable.

<details><summary>1 Found Instances</summary>


- Found in contracts/v2/safeGuards/ThresholdSafeGuard.sol [Line: 182](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/ThresholdSafeGuard.sol#L182)

```solidity
function checkTransaction(
```

</details>



0 comments on commit 8ab3f78

Please sign in to comment.