From 19891e6a0b5474b9ea6827ddb90bb9388f7acfc0 Mon Sep 17 00:00:00 2001 From: grandizzy <38490174+grandizzy@users.noreply.github.com> Date: Tue, 18 Jun 2024 21:50:57 +0300 Subject: [PATCH] feat: add invariant excludeSelector helper (#569) --- src/StdInvariant.sol | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/StdInvariant.sol b/src/StdInvariant.sol index 7620cbf3..056db98f 100644 --- a/src/StdInvariant.sol +++ b/src/StdInvariant.sol @@ -29,6 +29,7 @@ abstract contract StdInvariant { FuzzArtifactSelector[] private _targetedArtifactSelectors; + FuzzSelector[] private _excludedSelectors; FuzzSelector[] private _targetedSelectors; FuzzInterface[] private _targetedInterfaces; @@ -40,6 +41,10 @@ abstract contract StdInvariant { _excludedContracts.push(newExcludedContract_); } + function excludeSelector(FuzzSelector memory newExcludedSelector_) internal { + _excludedSelectors.push(newExcludedSelector_); + } + function excludeSender(address newExcludedSender_) internal { _excludedSenders.push(newExcludedSender_); } @@ -83,6 +88,10 @@ abstract contract StdInvariant { excludedContracts_ = _excludedContracts; } + function excludeSelectors() public view returns (FuzzSelector[] memory excludedSelectors_) { + excludedSelectors_ = _excludedSelectors; + } + function excludeSenders() public view returns (address[] memory excludedSenders_) { excludedSenders_ = _excludedSenders; }