Skip to content

Commit

Permalink
fix: multiple fuzz flakes (#11981)
Browse files Browse the repository at this point in the history
Fixes a couple of fuzz flakes that were found when fuzzing
heavily.
  • Loading branch information
smartcontracts authored Sep 18, 2024
1 parent 68b5239 commit ae37e02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import { computeCommitmentKeccak256 } from "src/L1/DataAvailabilityChallenge.sol";
import { Proxy } from "src/universal/Proxy.sol";
import { CommonTest } from "test/setup/CommonTest.sol";
import { Preinstalls } from "src/libraries/Preinstalls.sol";

contract DataAvailabilityChallengeTest is CommonTest {
function setUp() public virtual override {
Expand All @@ -33,6 +34,8 @@ contract DataAvailabilityChallengeTest is CommonTest {
function testWithdraw(address sender, uint256 amount) public {
assumePayable(sender);
assumeNotPrecompile(sender);
// EntryPoint will revert if using amount > type(uint112).max.
vm.assume(sender != Preinstalls.EntryPoint_v060);
vm.assume(sender != address(dataAvailabilityChallenge));
vm.assume(sender.balance == 0);
vm.deal(sender, amount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,12 @@ contract L2ToL2CrossDomainMessengerTest is Test {
)
external
{
// Ensure that the target contract is not a Forge contract.
assumeNotForgeAddress(_target);

// Ensure that the target contract is not CrossL2Inbox or L2ToL2CrossDomainMessenger
vm.assume(_target != Predeploys.CROSS_L2_INBOX && _target != Predeploys.L2_TO_L2_CROSS_DOMAIN_MESSENGER);
vm.assume(_target != Predeploys.CROSS_L2_INBOX);
vm.assume(_target != Predeploys.L2_TO_L2_CROSS_DOMAIN_MESSENGER);

// Ensure that the target call is payable if value is sent
if (_value > 0) assumePayable(_target);
Expand Down

0 comments on commit ae37e02

Please sign in to comment.