Closed sherlock-admin closed 1 year ago
WATCHPUG
medium
claimAssets
Checkpoint.count
Beacuse a user who claimAssets will not split the settlementFee with the other users who deposit and redeem.
settlementFee
https://github.com/sherlock-audit/2023-07-perennial/blob/main/perennial-v2/packages/perennial-vault/contracts/Vault.sol#L238-L279
https://github.com/sherlock-audit/2023-07-perennial/blob/main/perennial-v2/packages/perennial-vault/contracts/types/Checkpoint.sol#L62-L69
Manual Review
CheckpointLib.update() should only increase the count when deposit or redemption > 0.
CheckpointLib.update()
deposit
redemption
1 comment(s) were left on this issue during the judging contest.
141345 commented:
l
WATCHPUG
medium
claimAssets
should not increaseCheckpoint.count
Summary
Vulnerability Detail
Beacuse a user who
claimAssets
will not split thesettlementFee
with the other users who deposit and redeem.Impact
Code Snippet
https://github.com/sherlock-audit/2023-07-perennial/blob/main/perennial-v2/packages/perennial-vault/contracts/Vault.sol#L238-L279
https://github.com/sherlock-audit/2023-07-perennial/blob/main/perennial-v2/packages/perennial-vault/contracts/types/Checkpoint.sol#L62-L69
Tool used
Manual Review
Recommendation
CheckpointLib.update()
should only increase the count whendeposit
orredemption
> 0.