diff --git a/docs/delegate-architecture.md b/docs/delegate-architecture.md index 0239b20..73fc246 100644 --- a/docs/delegate-architecture.md +++ b/docs/delegate-architecture.md @@ -108,7 +108,7 @@ Set the new staking contract address. Get a list of stake ids belonging to a user. -### `maxWithdraw(address user)` +## Security Considerations -Calculates the maximum amount of assets that a keyper can withdraw, which -represents the rewards accumulated and not claimed yet. This funciton will revert if the user has no shares. +- The contract doesn't use the Ownable2Step pattern due to the 24KB contract + size limit. diff --git a/docs/staking-architecture.md b/docs/staking-architecture.md index 147a638..372a75e 100644 --- a/docs/staking-architecture.md +++ b/docs/staking-architecture.md @@ -147,14 +147,6 @@ Set the new minimum amount of SHU tokens that must be staked by keypers. Get a list of stake ids belonging to a keyper. -### `maxWithdraw(address keyper)` - -Calculates the maximum amount of assets that a keyper can withdraw, which -represents the rewards accumulated and not claimed yet. This doesn't include -unlocked stakes. - -- if the keyper sSHU balance is less or equal than the total locked amount, the function will return 0. - ## Security Considerations - The contract doesn't use the Ownable2Step pattern due to the 24KB contract diff --git a/test/Staking.t.sol b/test/Staking.t.sol index fbb0281..827377f 100644 --- a/test/Staking.t.sol +++ b/test/Staking.t.sol @@ -1062,17 +1062,6 @@ contract ClaimRewards is StakingTest { staking.claimRewards(0); } - function testFuzz_RevertIf_KeyperHasNoSHares(address _depositor) public { - vm.assume( - _depositor != address(0) && - _depositor != ProxyUtils.getAdminAddress(address(staking)) - ); - - vm.prank(_depositor); - vm.expectRevert(BaseStaking.NoRewardsToClaim.selector); - staking.claimRewards(0); - } - function testFuzz_RevertIf_NoRewardsToClaimToThatUser( address _depositor1, address _depositor2, @@ -1656,6 +1645,8 @@ contract ViewFunctions is StakingTest { uint256 _amount2, uint256 _jump ) public { + vm.assume(_depositor1 != _depositor2); + _amount1 = _boundToRealisticStake(_amount1); _amount2 = _boundToRealisticStake(_amount2);