From ef43bc1b9b3ef3ba3478fd2b2901f55a7c146fc4 Mon Sep 17 00:00:00 2001 From: Ana Julia Date: Mon, 24 Jun 2024 08:37:42 -0300 Subject: [PATCH] improve assumptions --- src/Staking.sol | 1 + test/Staking.t.sol | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/Staking.sol b/src/Staking.sol index b8348e4..b7ef4e4 100644 --- a/src/Staking.sol +++ b/src/Staking.sol @@ -368,6 +368,7 @@ contract Staking is ERC20VotesUpgradeable, Ownable2StepUpgradeable { // Prevents the keyper from claiming more than they should uint256 maxWithdrawAmount = maxWithdraw(keyper); + console.log("maxWithdrawAmount", maxWithdrawAmount); // If the amount is greater than the max withdraw amount, the contract // will transfer the maximum amount available not the requested amount diff --git a/test/Staking.t.sol b/test/Staking.t.sol index 646e2a3..31f87e4 100644 --- a/test/Staking.t.sol +++ b/test/Staking.t.sol @@ -752,6 +752,8 @@ contract ClaimRewards is StakingTest { _amount = _boundToRealisticStake(_amount); _jump = _boundRealisticTimeAhead(_jump); + vm.assume(_depositor1 != _depositor2); + _mintGovToken(_depositor1, _amount); _mintGovToken(_depositor2, _amount); @@ -850,6 +852,11 @@ contract ClaimRewards is StakingTest { } function testFuzz_RevertIf_KeyperHasNoSHares(address _depositor) public { + vm.assume( + _depositor != address(0) && + _depositor != ProxyUtils.getAdminAddress(address(staking)) + ); + vm.prank(_depositor); vm.expectRevert(Staking.KeyperHasNoShares.selector); staking.claimRewards(0);