Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
anajuliabit committed Aug 20, 2024
1 parent 993fff1 commit 32f6c02
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
6 changes: 3 additions & 3 deletions docs/delegate-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
8 changes: 0 additions & 8 deletions docs/staking-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 2 additions & 11 deletions test/Staking.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1656,6 +1645,8 @@ contract ViewFunctions is StakingTest {
uint256 _amount2,
uint256 _jump
) public {
vm.assume(_depositor1 != _depositor2);

_amount1 = _boundToRealisticStake(_amount1);
_amount2 = _boundToRealisticStake(_amount2);

Expand Down

0 comments on commit 32f6c02

Please sign in to comment.