From bce9d2a27bf41317ca2b61489d9fa9af27c97953 Mon Sep 17 00:00:00 2001 From: beeb <703631+beeb@users.noreply.github.com> Date: Mon, 7 Oct 2024 08:56:54 +0200 Subject: [PATCH] better repro --- test/Counter.t.sol | 9 +++++++-- test/TestHandler.sol | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/test/Counter.t.sol b/test/Counter.t.sol index 2693cbb..ea1d4ee 100644 --- a/test/Counter.t.sol +++ b/test/Counter.t.sol @@ -23,8 +23,13 @@ contract CounterTest is Test { targetContract(address(proxy)); - targetSender(makeAddr("alice")); - targetSender(makeAddr("bob")); + address alice = makeAddr("alice"); + address bob = makeAddr("bob"); + vm.deal(alice, 100 ether); + vm.deal(bob, 100 ether); + + targetSender(alice); + targetSender(bob); } function invariant_assume() public view { diff --git a/test/TestHandler.sol b/test/TestHandler.sol index 8ae510d..99bf1bc 100644 --- a/test/TestHandler.sol +++ b/test/TestHandler.sol @@ -21,8 +21,9 @@ contract TestHandler is Test, Initializable, UUPSUpgradeable { function fuzzHandler(address addr, uint256 amount_) external { amount_ = _bound(amount_, 500001, type(uint256).max); + addr = _boundAddress(addr); vm.startPrank(msg.sender); - this.otherExternalFunction(amount_, _boundAddress(addr)); + this.otherExternalFunction{value: 1000}(amount_, addr); vm.stopPrank(); console.log("finished execution"); } @@ -36,7 +37,7 @@ contract TestHandler is Test, Initializable, UUPSUpgradeable { return addr; } - function otherExternalFunction(uint256 amount_, address addr) external { + function otherExternalFunction(uint256 amount_, address addr) external payable { amount = amount_; test = addr; }