forked from Vectorized/dn404
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Invariant Suite Refactor (Vectorized#137)
* Add combined Guardian Audit fixes * Fix stack-too-deep * Fix stack-too-deep * Fix stack-too-deep * Update ArrayOps test * Optimize * Optimize * Update invariant suite * gas snapshot * update assertion message * Fix compiler warnings * Add invariant intense ci workflow for serious invariant fuzzing * Fix stack-too-deep * Change aux type in invariant handler to uint256 for futureproofness * Try fix stack-too-deep * Try fix stack-too-deep --------- Co-authored-by: Vectorized <[email protected]> Co-authored-by: Danny G <[email protected]>
- Loading branch information
1 parent
ecdc346
commit c5a20f8
Showing
10 changed files
with
920 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: ci-invariant-intense | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tests: | ||
name: Forge Testing invariant intense | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
profile: [invariant-intense-0,invariant-intense-1,invariant-intense-2,invariant-intense-3] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Install Dependencies | ||
run: forge install | ||
|
||
- name: Run Tests with ${{ matrix.profile }} | ||
run: FOUNDRY_INVARIANT_RUNS=300 forge test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.4; | ||
|
||
import {Test} from "../utils/forge-std/Test.sol"; | ||
import {StdInvariant} from "../utils/forge-std/StdInvariant.sol"; | ||
import {DN404} from "../../src/DN404.sol"; | ||
import {DN404Mirror} from "../../src/DN404Mirror.sol"; | ||
import {MockDN404CustomUnit} from "../utils/mocks/MockDN404CustomUnit.sol"; | ||
import {DN404Handler} from "./handlers/DN404Handler.sol"; | ||
import {StaticUnitInvariant} from "./StaticUnitInvariant.t.sol"; | ||
|
||
/// @dev Invariant tests with the max allowed unit. | ||
contract MaxUnitInvariant is StaticUnitInvariant { | ||
function setUp() public virtual override { | ||
StaticUnitInvariant.setUp(); | ||
} | ||
|
||
function _unit() internal pure override returns (uint256) { | ||
return type(uint96).max; | ||
} | ||
} |
Oops, something went wrong.