Skip to content

Commit

Permalink
Update Slither and fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmichalis committed Apr 1, 2023
1 parent af17ea0 commit fd6d6ce
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ jobs:
with:
version: nightly

- name: Compile contracts
run: forge build --force

- name: Run Slither
uses: crytic/slither-action@v0.1.1
uses: crytic/slither-action@v0.2.0
with:
ignore-compile: true
node-version: 16
slither-config: ./slither.config.json
slither-version: v0.8.3
slither-version: v0.9.2
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[profile.default]
solc = '0.8.19'
solc = '0.8.16'
bytecode_hash = 'none'
optimizer_runs = 1000000

Expand Down
3 changes: 1 addition & 2 deletions slither.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"detectors_to_run": "all",
"exclude_informational": true,
"exclude_low": true,
"filter_paths": "(lib/)",
"ignore_compile": true
"filter_paths": "(lib/|test/)"
}
6 changes: 5 additions & 1 deletion src/SampleContract.sol
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
pragma solidity 0.8.16;

contract SampleContract {
uint256 num2;

function func1(uint256 num) external {
num2 = num;

// slither-disable-start costly-loop
for (uint256 i = 0; i < num; i++) {
num2--;
}
// slither-disable-end costly-loop

assert(num2 == 0);
}

function func2(uint256 num) external {
num2 = num;

// slither-disable-start costly-loop
for (uint256 i = 0; i < num; i++) {
num2--;
}
// slither-disable-end costly-loop

assert(num2 == 0);
}
Expand Down
2 changes: 1 addition & 1 deletion test/SampleContract.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
pragma solidity 0.8.16;

import {Test} from 'forge-std/Test.sol';

Expand Down
2 changes: 1 addition & 1 deletion test/echidna/EchidnaUtils.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
pragma solidity ^0.8.16;

library EchidnaUtils {
event AssertionFailed(string msg, uint256 expected, uint256 actualValue);
Expand Down
2 changes: 1 addition & 1 deletion test/echidna/PairEchidna.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
pragma solidity ^0.8.16;

import "./EchidnaUtils.sol";

Expand Down

0 comments on commit fd6d6ce

Please sign in to comment.