-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fuzz): exclude exernal libraries addresses from fuzz inputs (#9527)
- Loading branch information
Showing
9 changed files
with
98 additions
and
13 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
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
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
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,43 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity ^0.8.18; | ||
|
||
import "ds-test/test.sol"; | ||
|
||
library ExternalLibrary { | ||
function doWork(uint256 a) public returns (uint256) { | ||
return a++; | ||
} | ||
} | ||
|
||
contract Counter { | ||
uint256 public number; | ||
|
||
function setNumber(uint256 newNumber) public { | ||
ExternalLibrary.doWork(1); | ||
} | ||
|
||
function increment() public {} | ||
} | ||
|
||
// https://github.com/foundry-rs/foundry/issues/8639 | ||
contract Issue8639Test is DSTest { | ||
Counter counter; | ||
|
||
function setUp() public { | ||
counter = new Counter(); | ||
} | ||
|
||
/// forge-config: default.fuzz.runs = 1000 | ||
/// forge-config: default.fuzz.seed = '100' | ||
function test_external_library_address(address test) public { | ||
require(test != address(ExternalLibrary)); | ||
} | ||
} | ||
|
||
contract Issue8639AnotherTest is DSTest { | ||
/// forge-config: default.fuzz.runs = 1000 | ||
/// forge-config: default.fuzz.seed = '100' | ||
function test_another_external_library_address(address test) public { | ||
require(test != address(ExternalLibrary)); | ||
} | ||
} |