From 8ab3f78771047660c9f424cd2fc39e10d6cc5966 Mon Sep 17 00:00:00 2001 From: TilakMaddy Date: Fri, 2 Aug 2024 21:44:37 +0530 Subject: [PATCH] cli/reportgen --- reports/report.json | 18 ------------------ reports/report.md | 20 +------------------- reports/report.sarif | 33 --------------------------------- reports/templegold-report.md | 32 ++++---------------------------- 4 files changed, 5 insertions(+), 98 deletions(-) diff --git a/reports/report.json b/reports/report.json index 48952a3a6..ca144e501 100644 --- a/reports/report.json +++ b/reports/report.json @@ -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, @@ -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" } ] } diff --git a/reports/report.md b/reports/report.md index 1b4f63c27..92aab2951 100644 --- a/reports/report.md +++ b/reports/report.md @@ -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. -
6 Found Instances - - -- Found in src/AssemblyExample.sol [Line: 6](../tests/contract-playground/src/AssemblyExample.sol#L6) +
3 Found Instances - ```solidity - function f(uint x) public view returns (uint r) { - ``` - Found in src/ConstantFuncsAssembly.sol [Line: 9](../tests/contract-playground/src/ConstantFuncsAssembly.sol#L9) @@ -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) { - ``` -
diff --git a/reports/report.sarif b/reports/report.sarif index 187e5cd16..5e700c745 100644 --- a/reports/report.sarif +++ b/reports/report.sarif @@ -6617,17 +6617,6 @@ { "level": "note", "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "src/AssemblyExample.sol" - }, - "region": { - "byteLength": 1, - "byteOffset": 113 - } - } - }, { "physicalLocation": { "artifactLocation": { @@ -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": { diff --git a/reports/templegold-report.md b/reports/templegold-report.md index e02b058c1..c42ed71e7 100644 --- a/reports/templegold-report.md +++ b/reports/templegold-report.md @@ -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 @@ -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 @@ -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. -
55 Found Instances +
54 Found Instances - Found in contracts/core/OpsManager.sol [Line: 50](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L50) @@ -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 @@ -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) @@ -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. - -
1 Found Instances - - -- Found in contracts/v2/safeGuards/ThresholdSafeGuard.sol [Line: 182](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/ThresholdSafeGuard.sol#L182) - - ```solidity - function checkTransaction( - ``` - -
- - -